-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
166 lines (145 loc) · 4.98 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.date
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
plugins {
id("java")
alias(libs.plugins.kotlin)
alias(libs.plugins.intellijPlatform)
alias(libs.plugins.changelog)
}
group = providers.gradleProperty("pluginGroup").get()
version = providers.gradleProperty("pluginVersion").get()
// Set the JVM language level used to build the project.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
maven { setUrl("https://cache-redirector.jetbrains.com/maven-central") }
intellijPlatform {
defaultRepositories()
}
}
dependencies {
implementation(libs.googleGson)
implementation(libs.microsoftApplicationInsights)
intellijPlatform {
val platformVer: String = providers.gradleProperty("platformVersion").get()
// HACK: Do not set useInstaller = true because installer version for some reason do not contain libs/testFramework.jar
rider(platformVer, useInstaller = false)
pluginVerifier()
zipSigner()
instrumentationTools()
// HACK: TestFrameworkType.Platform as of this moment does not work for rider and the warning on this page is wrong.
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#testing
testFramework(TestFrameworkType.Bundled)
}
}
intellijPlatform {
instrumentCode = true
pluginConfiguration {
val plugInVer: String = providers.gradleProperty("pluginVersion").get()
version = plugInVer
ideaVersion {
sinceBuild = providers.gradleProperty("pluginSinceBuild")
untilBuild = if (providers.gradleProperty("pluginUntilBuild").get().isEmpty())
provider { null }
else
providers.gradleProperty("pluginUntilBuild")
}
}
pluginVerification {
ides {
recommended()
}
}
}
changelog {
val plugInVer: String = providers.gradleProperty("pluginVersion").get()
version.set(plugInVer)
path.set(file("CHANGELOG.md").canonicalPath)
header.set(provider { "[${version.get()}] - ${date("yyyy-MM-dd")}" })
headerParserRegex.set("""(\d+\.\d+\.\d+[\-\w]*)""".toRegex())
introduction.set(
"""
All notable changes to this project are documented in this file.
> The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
""".trimIndent()
)
itemPrefix.set("-")
keepUnreleasedSection.set(true)
unreleasedTerm.set("[Unreleased]")
groups.set(listOf("Notes", "Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"))
lineSeparator.set("\n")
combinePreReleases.set(true)
}
tasks {
wrapper {
gradleVersion = libs.versions.gradle.get()
}
publishPlugin {
dependsOn("patchChangelog")
val plugInVer: String = providers.gradleProperty("pluginVersion").get()
val items: String = if (plugInVer.split("-").size > 1)
plugInVer.split("-")[1]
else
"default"
token.set(System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken"))
channels.set(listOf(items))
}
patchPluginXml {
val plugInVer: String = providers.gradleProperty("pluginVersion").get()
val versionExists = changelog.has(plugInVer)
if (versionExists) {
changeNotes.set(provider {
changelog.renderItem(
changelog
.get(plugInVer)
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML
)
}
)
} else {
changeNotes.set(provider {
changelog.renderItem(
changelog
.getUnreleased()
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML
)
}
)
}
}
test {
dependencies {
testImplementation(libs.junitJupiter)
testRuntimeOnly(libs.junitJupiterEngine)
testImplementation(libs.mockito)
testImplementation(libs.testNg)
testRuntimeOnly(libs.testNgEngine)
}
systemProperty("LOCAL_ENV_RUN", "true") //For use with 'BaseTestWithSolution' and TestNG
useJUnitPlatform()
minHeapSize = "512m"
maxHeapSize = "1024m"
testLogging {
showStandardStreams = true
exceptionFormat = TestExceptionFormat.FULL
}
}
runIde {
autoReload = false
maxHeapSize = "2G"
}
}