-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
147 lines (125 loc) · 3.32 KB
/
build.gradle.kts
File metadata and controls
147 lines (125 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import org.jetbrains.changelog.Changelog
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
val pluginName: String by project
val pluginVersion: String by project
val pluginSinceIdeaBuild: String by project
val ideVersion: String by project
val javaVersion: String by project
val clojureVersion: String by project
val cljsVersion: String by project
val artifactsPath: String by project
val ourGradleVersion: String by project
plugins {
id("org.jetbrains.intellij.platform") version "2.10.5"
id("org.jetbrains.changelog") version "2.5.0"
id("idea")
id("java")
kotlin("jvm") version "2.3.0"
}
kotlin {
compilerOptions {
jvmTarget = JvmTarget.valueOf("JVM_$javaVersion")
apiVersion = KotlinVersion.KOTLIN_2_1
}
}
tasks.withType<JavaCompile> {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
version = pluginVersion
repositories {
mavenCentral()
maven { url = uri("https://clojars.org/repo") }
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
intellijIdeaCommunity(ideVersion)
bundledPlugin("com.intellij.copyright")
bundledPlugin("com.intellij.java")
testFramework(TestFrameworkType.Platform)
}
testImplementation("junit:junit:4.13.2")
testRuntimeOnly("org.clojure:clojure:$clojureVersion")
testRuntimeOnly("org.clojure:clojurescript:$cljsVersion")
}
idea {
module {
generatedSourceDirs.add(file("gen"))
}
}
intellijPlatform {
pluginConfiguration {
name = pluginName
version = ideVersion
ideaVersion {
sinceBuild = pluginSinceIdeaBuild
}}
}
changelog {
header.set("${{ -> version.get() }}")
headerParserRegex.set("""(\d+(\.\d+)+)""")
itemPrefix.set("*")
unreleasedTerm.set("Unreleased")
}
val buildClojureKitJar = tasks.register<Jar>("buildClojureKitJar") {
dependsOn("assemble")
archiveBaseName.set("Clojure-kit")
destinationDirectory.set(file(artifactsPath))
manifest {
from("$rootDir/resources/META-INF/MANIFEST.MF")
}
from(sourceSets.main.get().output)
}
tasks {
withType<Test> {
useJUnit()
include("**/*Test.class")
isScanForTestClasses = false
ignoreFailures = true
}
withType<Javadoc>().configureEach {
(options as StandardJavadocDocletOptions).apply {
addStringOption("Xdoclint:none", "-quiet")
}
}
sourceSets {
main {
java.srcDirs("src", "gen")
resources.srcDirs("resources")
}
test {
java.srcDirs("tests")
}
}
buildSearchableOptions {
enabled = false
}
patchPluginXml {
changeNotes = provider {
changelog.renderItem(
changelog
.getUnreleased()
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML
) + "<a href=\"https://github.com/gregsh/Clojure-Kit/blob/master/CHANGELOG.md\">Full change log...</a>"
}
}
val buildClojureKitZip = register<Zip>("buildClojureKitZip") {
dependsOn(buildClojureKitJar)
archiveBaseName.set("ClojureKit")
destinationDirectory.set(file(artifactsPath))
from(buildClojureKitJar.get().outputs) {
into("/ClojureKit/lib")
}
}
register("artifacts") {
dependsOn(buildClojureKitJar, buildClojureKitZip)
}
defaultTasks("clean", "artifacts", "test")
}