-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.gradle.kts
127 lines (106 loc) · 2.99 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
fun properties(key: String) = project.findProperty(key)?.toString()
plugins {
id("org.jetbrains.intellij") version "1.2.1"
id("org.jetbrains.changelog") version "1.3.1"
id("idea")
id("java")
id("org.jetbrains.kotlin.jvm") version "1.4.10"
}
version = properties("pluginVersion").toString()
repositories {
mavenCentral()
maven { url = uri("https://clojars.org/repo") }
}
dependencies {
compileOnly("org.jetbrains:annotations:22.0.0")
testRuntimeOnly("org.clojure:clojure:${properties("clojureVersion")}")
testRuntimeOnly("org.clojure:clojurescript:${properties("cljsVersion")}")
compileOnly(files("${System.getProperties()["java.home"]}/../lib/tools.jar"))
}
idea {
module {
generatedSourceDirs.add(file("gen"))
}
}
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("ideaVersion"))
type.set("IC")
plugins.set(listOf("copyright", "java"))
updateSinceUntilBuild.set(false)
}
changelog {
header.set("${{ -> version.get() }}")
headerParserRegex.set("""(\d+(\.\d+)+)""")
itemPrefix.set("*")
unreleasedTerm.set("Unreleased")
}
val artifactsPath = properties("artifactsPath").toString()
val buildClojureKitJar = tasks.create<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<JavaCompile> {
sourceCompatibility = properties("javaVersion")
targetCompatibility = properties("javaVersion")
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = properties("javaVersion")!!
apiVersion = properties("kotlinApiVersion")!!
}
}
withType<Test> {
useJUnit()
include("**/*Test.class")
isScanForTestClasses = false
ignoreFailures = true
}
withType<Javadoc>().configureEach {
(options as StandardJavadocDocletOptions).apply {
addStringOption("Xdoclint:none", "-quiet")
}
}
wrapper {
gradleVersion = properties("gradleVersion")
}
sourceSets {
main {
java.srcDirs("src", "gen")
resources.srcDirs("resources")
}
test {
java.srcDirs("tests")
}
}
buildSearchableOptions {
enabled = false
}
patchPluginXml {
sinceBuild.set(properties("pluginSinceIdeaBuild"))
changeNotes.set(provider {
changelog.run {
getOrNull(project.version.toString()) ?: getLatest()
}.toHTML() + "<a href=\"https://github.com/gregsh/Clojure-Kit/blob/master/CHANGELOG.md\">Full change log...</a>"
})
}
val buildClojureKitZip = create<Zip>("buildClojureKitZip") {
dependsOn(buildClojureKitJar)
archiveBaseName.set("ClojureKit")
destinationDirectory.set(file(artifactsPath))
from(buildClojureKitJar.outputs) {
into("/ClojureKit/lib")
}
}
create("artifacts") {
dependsOn(buildClojureKitJar, buildClojureKitZip)
}
defaultTasks("clean", "artifacts", "test")
}