forked from zxj5470/BugKotlinDocument
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
73 lines (64 loc) · 1.7 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
import org.gradle.api.JavaVersion.VERSION_17
fun properties(key: String) = project.findProperty(key)?.toString() ?: ""
fun env(key: String) = System.getenv(key)
plugins {
id("java")
id("org.jetbrains.intellij") version "1.9.0"
kotlin("jvm") version "1.8.20"
}
group = properties("pluginGroup")
version = properties("pluginVersion")
repositories {
mavenLocal()
mavenCentral()
maven("https://jitpack.io")
}
java {
sourceCompatibility = VERSION_17
targetCompatibility = VERSION_17
}
dependencies {
// implementation(kotlin("stdlib"))
}
intellij {
type.set(properties("platformType")) // Target IDE Platform
updateSinceUntilBuild.set(false)
version.set(properties("platformVersion"))
plugins.set(listOf("Kotlin"))
}
tasks {
buildSearchableOptions {
enabled = false
}
patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))
pluginDescription.set(file("description.html").readText())
changeNotes.set(file("changeNotes.html").readText())
}
wrapper {
gradleVersion = properties("gradleVersion")
distributionType = Wrapper.DistributionType.ALL
}
withType<JavaCompile> {
sourceCompatibility = VERSION_17.toString()
targetCompatibility = VERSION_17.toString()
options.encoding = "UTF-8"
}
compileKotlin {
kotlinOptions.jvmTarget = VERSION_17.toString()
}
compileTestKotlin {
kotlinOptions.jvmTarget = VERSION_17.toString()
// kotlinOptions.freeCompilerArgs += listOf("-Xcontext-receivers")
}
signPlugin {
certificateChain.set(env("CERTIFICATE_CHAIN"))
privateKey.set(env("PRIVATE_KEY"))
password.set(env("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
token.set(env("PUBLISH_TOKEN"))
}
}