forked from JetBrains/intellij-bsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
151 lines (131 loc) · 4.92 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
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.intellij.platform.gradle.Constants
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask
plugins {
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
alias(libs.plugins.intellij)
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
alias(libs.plugins.changelog)
id("java-test-fixtures")
id("intellijbsp.kotlin-conventions")
}
val myToken: String by project
val releaseChannel: String by project
group = Plugin.group
version = Plugin.version
dependencies {
implementation(project(":jps-compilation"))
implementation(project(":protocol"))
implementation(project(":workspacemodel"))
implementation(libs.bsp4j) {
exclude(group = "com.google.guava", "guava")
}
implementation(libs.gson)
testImplementation(libs.junitJupiter)
testImplementation(libs.kotest)
testFixturesImplementation(libs.junitJupiter)
testFixturesImplementation(libs.kotest)
intellijPlatform {
intellijIdeaCommunity(Platform.version)
plugins(Platform.plugins)
bundledPlugins(Platform.bundledPlugins)
zipSigner()
pluginVerifier()
instrumentationTools()
testFramework(TestFrameworkType.Plugin.Java)
testFramework(TestFrameworkType.JUnit5)
}
}
tasks.runIde {
jvmArgs("-Didea.log.trace.categories=" +
"#org.jetbrains.plugins.bsp," +
"#org.jetbrains.magicmetamodel.impl.PerformanceLogger")
}
// Configure gradle-intellij-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
intellijPlatform {
tasks {
printProductsReleases {
channels = listOf(ProductRelease.Channel.EAP)
types = listOf(IntelliJPlatformType.IntellijIdeaCommunity)
untilBuild = provider { null }
doLast {
val latestEap = productsReleases.get().max()
}
}
}
pluginConfiguration {
name = Plugin.name
ideaVersion {
sinceBuild = Plugin.sinceBuild
untilBuild = Plugin.untilBuild
}
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
description = File(projectDir, "README.md").readText().lines().run {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"
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").run { markdownToHTML(this) }
// Get the latest available change notes from the changelog file
changeNotes = provider { changelog.renderItem(changelog.getLatest(), Changelog.OutputType.HTML) }
}
publishing {
token = provider { myToken }
// 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. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
// Release channel is set via command-line param "releaseChannel"
// Marketplace token is set via command-line parm "myToken"
// Example command "./gradlew publishPlugin -PmyToken="perm:YOUR_TOKEN -PreleaseChannel=nightly"
channels = provider { listOf(releaseChannel) }
}
verifyPlugin {
ides {
recommended()
}
failureLevel = setOf(
VerifyPluginTask.FailureLevel.COMPATIBILITY_PROBLEMS,
VerifyPluginTask.FailureLevel.NOT_DYNAMIC
)
teamCityOutputFormat = true
}
}
configurations {
getByName(JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME) {
extendsFrom(getByName(Constants.Configurations.INTELLIJ_PLATFORM_TEST_DEPENDENCIES))
}
}
// Configure gradle-changelog-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
version.set(Plugin.version)
groups.set(emptyList())
}
allprojects {
tasks.withType<Test>().configureEach {
useJUnitPlatform()
// disable the malfunctioned platform listener com.intellij.tests.JUnit5TestSessionListener
// this listener caused the CI tests to fail with
// AlreadyDisposedException: Already disposed: Application (containerState DISPOSE_COMPLETED)
// TODO: follow up https://youtrack.jetbrains.com/issue/IDEA-337508/AlreadyDisposedException-Already-disposed-Application-containerState-DISPOSECOMPLETED-after-junit5-tests-on-TeamCity
systemProperty("intellij.build.test.ignoreFirstAndLastTests", "true")
}
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
tasks {
test {
classpath -= classpath.filter { it.name.contains("kotlin-compiler-embeddable") }
}
}