-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
123 lines (100 loc) · 3.46 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
123 lines (100 loc) · 3.46 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
import org.jetbrains.changelog.Changelog
fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
plugins {
id("java")
id("org.jetbrains.intellij") version "1.14.1"
id("org.jetbrains.kotlin.jvm") version "1.8.21"
id("org.jetbrains.changelog") version "2.1.0"
}
group = properties("pluginGroup").get()
version = properties("pluginVersion").get()
val javaVersion = properties("javaVersion").get()
val pluginVersion = properties("pluginVersion").get()
// Configure gradle-changelog-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
path.set("${project.projectDir}/docs/CHANGELOG.md")
version.set(properties("pluginVersion").get())
header.set(provider { version.get() })
itemPrefix.set("-")
keepUnreleasedSection.set(true)
unreleasedTerm.set("Changelog")
groups.set(listOf("Features", "Fixes", "Removals", "Other"))
}
tasks {
patchPluginXml {
version.set(properties("pluginVersion").get())
sinceBuild.set(properties("pluginSinceBuild").get())
untilBuild.set(properties("pluginUntilBuild").get())
val changelog = project.changelog // local variable for configuration cache compatibility
// Get the latest available change notes from the changelog file
changeNotes.set(provider {
with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML,
)
}
})
}
wrapper {
gradleVersion = properties("gradleVersion").get()
}
// Set the JVM compatibility versions
withType<JavaCompile> {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
withType<Copy> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
dependsOn("patchChangelog")
token.set(System.getenv("PUBLISH_TOKEN") ?: file("./publishToken").readText().trim())
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels.set(properties("pluginVersion")
.map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) })
}
buildSearchableOptions {
enabled = false
}
compileKotlin {
kotlinOptions.jvmTarget = javaVersion
}
compileTestKotlin {
kotlinOptions.jvmTarget = javaVersion
}
}
repositories {
mavenCentral()
}
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
pluginName.set(properties("pluginName").get())
version.set(properties("platformVersion").get())
type.set(properties("platformType").get())
downloadSources.set(true)
instrumentCode.set(true)
updateSinceUntilBuild.set(true)
plugins.set(
listOf(
"java",
)
)
}
dependencies {
// https://mvnrepository.com/artifact/commons-io/commons-io
implementation("commons-io:commons-io:2.11.0")
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation("org.apache.commons:commons-lang3:3.12.0")
}