-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
170 lines (146 loc) · 5.81 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
170 lines (146 loc) · 5.81 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import org.jetbrains.changelog.Changelog
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask
import org.jetbrains.intellij.platform.gradle.tasks.aware.SplitModeAware
plugins {
id("java")
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.intellij.platform")
alias(libs.plugins.changelog)
alias(libs.plugins.detekt)
alias(libs.plugins.qodana)
alias(libs.plugins.kover)
id("rpc") apply false
id("org.jetbrains.kotlin.plugin.serialization") apply false
}
group = providers.gradleProperty("pluginGroup").get()
version = providers.gradleProperty("pluginVersion").get()
kotlin {
jvmToolchain(21)
}
subprojects {
apply(plugin = "org.jetbrains.intellij.platform.module")
apply(plugin = "rpc")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
kotlin {
jvmToolchain(21)
}
dependencies {
intellijPlatform {
intellijIdea(providers.gradleProperty("platformVersion"))
}
}
}
dependencies {
detektPlugins(libs.detekt.formatting)
testImplementation(libs.junit)
testImplementation(libs.opentest4j)
intellijPlatform {
intellijIdea(providers.gradleProperty("platformVersion"))
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
bundledModules(providers.gradleProperty("platformBundledModules").map { it.split(',') })
testFramework(TestFrameworkType.Platform)
pluginVerifier(libs.versions.pluginVerifier.get())
pluginModule(implementation(project(":shared")))
pluginModule(implementation(project(":frontend")))
pluginModule(implementation(project(":client")))
pluginModule(implementation(project(":backend")))
}
}
changelog {
groups.empty()
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
}
intellijPlatform {
splitMode = providers.gradleProperty("splitMode").map { it.toBoolean() }.orElse(true)
pluginInstallationTarget = SplitModeAware.PluginInstallationTarget.BOTH
pluginConfiguration {
name = providers.gradleProperty("pluginName")
version = providers.gradleProperty("pluginVersion")
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"
with(it.lines()) {
if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n")
}
}
changeNotes = with(changelog) {
renderItem(
(getOrNull(providers.gradleProperty("pluginVersion").get()) ?: getLatest())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML,
)
}
ideaVersion {
sinceBuild = providers.gradleProperty("pluginSinceBuild")
}
}
signing {
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
privateKey = providers.environmentVariable("PRIVATE_KEY")
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
}
publishing {
token = providers.environmentVariable("PUBLISH_TOKEN")
channels = providers.gradleProperty("pluginVersion").map {
listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" })
}
}
pluginVerification {
// Default gating set is [COMPATIBILITY_PROBLEMS, INTERNAL_API_USAGES, OVERRIDE_ONLY_API_USAGES].
// Drop only INTERNAL_API_USAGES: split mode's RPC stack (RemoteApiProviderService, the remoteApiProvider
// EP, ProjectId/VirtualFileId) is @ApiStatus.Internal with no stable equivalent. The javacv missing-package
// problems that previously forced externalPrefixes are gone now that the content-module jars are named to
// match their module ids (see each subproject's composedJar override) — the verifier resolves the
// descriptors and no longer falls back to scanning javacv.
// Split mode's client editor adds @ApiStatus.Internal RD APIs
// (rdclient.*, intellij.rd.*) under the same INTERNAL_API_USAGES drop.
failureLevel = listOf(
VerifyPluginTask.FailureLevel.COMPATIBILITY_PROBLEMS,
VerifyPluginTask.FailureLevel.OVERRIDE_ONLY_API_USAGES,
)
ides {
val pinned = providers.gradleProperty("verifierIde").orNull
if (pinned.isNullOrBlank()) {
recommended()
} else {
val (type, version) = pinned.split("-", limit = 2)
.also { require(it.size == 2) { "verifierIde must be 'TYPE-VERSION' (e.g. IU-2025.2.6.2), got '$pinned'" } }
create(type, version)
}
}
}
}
kover {
reports {
total {
xml {
onCheck = true
}
}
}
}
detekt {
buildUponDefaultConfig = true
config.setFrom(files("$projectDir/detekt.yml"))
basePath.set(projectDir)
// Sources moved into content modules; point detekt at them so the root task still lints the codebase.
source.setFrom(subprojects.map { it.layout.projectDirectory.dir("src/main/kotlin") })
}
tasks.withType<dev.detekt.gradle.Detekt>().configureEach {
reports {
html.required.set(true)
sarif.required.set(true)
}
}
tasks {
wrapper {
gradleVersion = providers.gradleProperty("gradleVersion").get()
}
}