Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8467b89

Browse files
authored
impl: support for unlimited 'Until Build' setting (#549)
* chore: upgrade Gradle to 8.5 the latest versionThis upgrade is needed in order to be able to upgrade the gateway/intellijplatform plugins.* chore: upgrade Gradle IntelliJ PluginThis is needed in order to be able to specify "unlimited until builds".IntelliJ Platform Gradle Plugin 2.x is the build system that supersedesthe Gradle IntelliJ Plugin 1.x, and this is the version that comes withthe ability to provide unlimited until build support.This is a major overhaul of the DSL, I've tested these changes locally withGW 2023.3 (the minimum supported version), and I've also compared the plugin.xmlwith a previous version to make sure it is generated correctly.* impl: support for unlimited 'Until Build' settingEvery time a new GW version is released we need to change the untilBuild setting.With latest IntelliJ Platform Plugin we can provide unlimited upper range with nomanual intervention each time a new release is happening.* chore: simplify build scriptUse gateway DSL to provide the platform type and version.The plugin verification as well as the platform type depends on the versions in the format "2025.x"* fix: merge from main was botched* fix: missing junit4 dependency for IntelliJ test frameworkWe don't have any UI tests but the test task still fails because it misses junit 4 dependencies.For the unit tests we use kotlin tests library with junit 5 as a backend.* fix: task was renamedlistProductsReleases was renamed to printProductsReleases in version 2.x* chore: use latest version 2.6.0 for the platform plugin
1 parent6d0d826 commit8467b89

File tree

8 files changed

+184
-119
lines changed

8 files changed

+184
-119
lines changed

‎.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ jobs:
8282
echo "::set-output name=name::$NAME"
8383
echo "::set-output name=changelog::$CHANGELOG"
8484
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
85-
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
85+
# prepare list of IDEs for Plugin Verifier
86+
./gradlew printProductsReleases
8687
8788
# Run plugin build
8889
-name:Run Build

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
## Gradle
1515
.gradle
1616
build
17+
jvm/
1718

1819
## Qodana
1920
.qodana

‎build.gradle.kts

Lines changed: 129 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
importorg.jetbrains.changelog.Changelog
12
importorg.jetbrains.changelog.markdownToHTML
2-
importorg.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
importorg.jetbrains.intellij.platform.gradle.IntelliJPlatformType
34

45
funproperties(key:String)= project.findProperty(key).toString()
56

@@ -10,18 +11,34 @@ plugins {
1011
id("groovy")
1112
// Kotlin support
1213
id("org.jetbrains.kotlin.jvm") version"1.9.23"
13-
// Gradle IntelliJ Plugin
14-
id("org.jetbrains.intellij") version"1.13.3"
14+
// Gradle IntelliJPlatformPlugin
15+
id("org.jetbrains.intellij.platform") version"2.6.0"
1516
// Gradle Changelog Plugin
1617
id("org.jetbrains.changelog") version"2.2.1"
1718
// Gradle Qodana Plugin
1819
id("org.jetbrains.qodana") version"0.1.13"
20+
// Gradle Kover Plugin
21+
id("org.jetbrains.kotlinx.kover") version"0.9.1"
1922
// Generate Moshi adapters.
2023
id("com.google.devtools.ksp") version"1.9.23-1.0.20"
2124
}
2225

23-
group= properties("pluginGroup")
24-
version= properties("pluginVersion")
26+
group= providers.gradleProperty("pluginGroup").get()
27+
version= providers.gradleProperty("pluginVersion").get()
28+
29+
// Set the JVM language level used to build the project.
30+
kotlin {
31+
jvmToolchain(17)
32+
}
33+
34+
// Configure project's dependencies
35+
repositories {
36+
mavenCentral()
37+
// IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
38+
intellijPlatform {
39+
defaultRepositories()
40+
}
41+
}
2542

2643
dependencies {
2744
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.12.0"))
@@ -37,23 +54,83 @@ dependencies {
3754
implementation("org.zeroturnaround:zt-exec:1.12")
3855

3956
testImplementation(kotlin("test"))
40-
}
57+
// required by the unit tests
58+
testImplementation(kotlin("test-junit5"))
59+
// required by IntelliJ test framework
60+
testImplementation("junit:junit:4.13.2")
4161

42-
// Configure project's dependencies
43-
repositories {
44-
mavenCentral()
45-
maven(url="https://www.jetbrains.com/intellij-repository/snapshots")
62+
63+
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
64+
intellijPlatform {
65+
gateway(providers.gradleProperty("platformVersion"))
66+
67+
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
68+
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
69+
70+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
71+
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
72+
73+
pluginVerifier()
74+
}
4675
}
4776

4877
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
49-
intellij {
50-
pluginName.set(properties("pluginName"))
51-
version.set(properties("platformVersion"))
52-
type.set(properties("platformType"))
53-
54-
downloadSources.set(properties("platformDownloadSources").toBoolean())
55-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
56-
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
78+
intellijPlatform {
79+
buildSearchableOptions=false
80+
instrumentCode=true
81+
82+
pluginConfiguration {
83+
name= providers.gradleProperty("pluginName")
84+
version= providers.gradleProperty("pluginVersion")
85+
86+
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
87+
description= providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
88+
val start="<!-- Plugin description -->"
89+
val end="<!-- Plugin description end -->"
90+
91+
with(it.lines()) {
92+
if (!containsAll(listOf(start, end))) {
93+
throwGradleException("Plugin description section not found in README.md:\n$start ...$end")
94+
}
95+
subList(indexOf(start)+1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
96+
}
97+
}
98+
99+
val changelog= project.changelog// local variable for configuration cache compatibility
100+
// Get the latest available change notes from the changelog file
101+
changeNotes= providers.gradleProperty("pluginVersion").map { pluginVersion->
102+
with(changelog) {
103+
renderItem(
104+
(getOrNull(pluginVersion)?: getUnreleased())
105+
.withHeader(false)
106+
.withEmptySections(false),
107+
Changelog.OutputType.HTML,
108+
)
109+
}
110+
}
111+
112+
ideaVersion {
113+
sinceBuild= providers.gradleProperty("pluginSinceBuild")
114+
untilBuild= provider {null }
115+
}
116+
}
117+
118+
pluginVerification {
119+
ides {
120+
providers.gradleProperty("verifyVersions").get().split(',').map(String::trim).forEach { version->
121+
ide(IntelliJPlatformType.Gateway, version)
122+
}
123+
}
124+
}
125+
126+
publishing {
127+
token= providers.environmentVariable("PUBLISH_TOKEN")
128+
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
129+
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
130+
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
131+
channels= providers.gradleProperty("pluginVersion")
132+
.map {listOf(it.substringAfter('-',"").substringBefore('.').ifEmpty {"default" }) }
133+
}
57134
}
58135

59136
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
@@ -62,6 +139,17 @@ changelog {
62139
groups.set(emptyList())
63140
}
64141

142+
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
143+
kover {
144+
reports {
145+
total {
146+
xml {
147+
onCheck=true
148+
}
149+
}
150+
}
151+
}
152+
65153
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
66154
qodana {
67155
cachePath.set(projectDir.resolve(".qodana").canonicalPath)
@@ -72,88 +160,43 @@ qodana {
72160

73161
tasks {
74162
buildPlugin {
163+
archiveBaseName= providers.gradleProperty("artifactName").get()
75164
exclude {"coroutines"in it.name }
76165
}
77166
prepareSandbox {
78167
exclude {"coroutines"in it.name }
79168
}
80169

81-
// Set the JVM compatibility versions
82-
properties("javaVersion").let {
83-
withType<JavaCompile> {
84-
sourceCompatibility= it
85-
targetCompatibility= it
86-
}
87-
withType<KotlinCompile> {
88-
kotlinOptions.jvmTarget= it
89-
}
90-
}
91-
92170
wrapper {
93-
gradleVersion= properties("gradleVersion")
94-
}
95-
96-
instrumentCode {
97-
compilerVersion.set(properties("instrumentationCompiler"))
98-
}
99-
100-
// TODO - this fails with linkage error, but we don't need it now
101-
// because the plugin does not provide anything to search for in Preferences
102-
buildSearchableOptions {
103-
isEnabled=false
104-
}
105-
106-
patchPluginXml {
107-
version.set(properties("pluginVersion"))
108-
sinceBuild.set(properties("pluginSinceBuild"))
109-
untilBuild.set(properties("pluginUntilBuild"))
110-
111-
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
112-
pluginDescription.set(
113-
projectDir.resolve("README.md").readText().lines().run {
114-
val start="<!-- Plugin description -->"
115-
val end="<!-- Plugin description end -->"
116-
117-
if (!containsAll(listOf(start, end))) {
118-
throwGradleException("Plugin description section not found in README.md:\n$start ...$end")
119-
}
120-
subList(indexOf(start)+1, indexOf(end))
121-
}.joinToString("\n").run { markdownToHTML(this) },
122-
)
123-
124-
// Get the latest available change notes from the changelog file
125-
changeNotes.set(
126-
provider {
127-
changelog.run {
128-
getOrNull(properties("pluginVersion"))?: getLatest()
129-
}.toHTML()
130-
},
131-
)
132-
}
133-
134-
runIde {
135-
autoReloadPlugins.set(true)
136-
}
137-
138-
// Configure UI tests plugin
139-
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
140-
runIdeForUiTests {
141-
systemProperty("robot-server.port","8082")
142-
systemProperty("ide.mac.message.dialogs.as.sheets","false")
143-
systemProperty("jb.privacy.policy.text","<!--999.999-->")
144-
systemProperty("jb.consents.confirmation.enabled","false")
171+
gradleVersion= providers.gradleProperty("gradleVersion").get()
145172
}
146173

147174
publishPlugin {
148-
dependsOn("patchChangelog")
149-
token.set(System.getenv("PUBLISH_TOKEN"))
175+
dependsOn(patchChangelog)
150176
}
151177

152178
test {
153179
useJUnitPlatform()
154180
}
181+
}
182+
183+
intellijPlatformTesting {
184+
runIde {
185+
register("runIdeForUiTests") {
186+
task {
187+
jvmArgumentProviders+=CommandLineArgumentProvider {
188+
listOf(
189+
"-Drobot-server.port=8082",
190+
"-Dide.mac.message.dialogs.as.sheets=false",
191+
"-Djb.privacy.policy.text=<!--999.999-->",
192+
"-Djb.consents.confirmation.enabled=false",
193+
)
194+
}
195+
}
155196

156-
runPluginVerifier {
157-
ideVersions.set(properties("verifyVersions").split(","))
197+
plugins {
198+
robotServerPlugin()
199+
}
200+
}
158201
}
159-
}
202+
}

‎gradle.properties

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
33
pluginGroup=com.coder.gateway
44
# Zip file name.
5-
pluginName=coder-gateway
5+
artifactName=coder-gateway
6+
pluginName=Coder
67
# SemVer format -> https://semver.org
7-
pluginVersion=2.20.1
8+
pluginVersion=2.20.0
89
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
910
# for insight into build numbers and IntelliJ Platform versions.
1011
pluginSinceBuild=243.26053
11-
# This should be kept up to date with the latest EAP. If the API is incompatible
12-
# with the latest stable, use the eap branch temporarily instead.
13-
pluginUntilBuild=251.*
1412
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1513
# Gateway available build versions https://www.jetbrains.com/intellij-repository/snapshots and https://www.jetbrains.com/intellij-repository/releases
1614
#
@@ -25,21 +23,23 @@ pluginUntilBuild=251.*
2523
# (for example if 233.14808-EAP-CANDIDATE-SNAPSHOT is missing then find a 233.*
2624
# that exists, ideally the most recent one, for example
2725
# 233.15325-EAP-CANDIDATE-SNAPSHOT).
28-
platformType=GW
29-
platformVersion=243.26053-EAP-CANDIDATE-SNAPSHOT
30-
instrumentationCompiler=243.26053-EAP-CANDIDATE-SNAPSHOT
26+
platformVersion=2024.3
3127
# Gateway does not have open sources.
3228
platformDownloadSources=true
29+
# available releases listed at: https://data.services.jetbrains.com/products?code=GW
3330
verifyVersions=2024.3,2025.1
3431
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
3532
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
3633
platformPlugins=
37-
# Java language level used to compile sources and to generate the files for -
38-
# Java 17 is required since 2022.2
39-
javaVersion=17
34+
# Example: platformBundledPlugins = com.intellij.java
35+
platformBundledPlugins =
4036
# Gradle Releases -> https://github.com/gradle/gradle/releases
41-
gradleVersion=7.4
37+
gradleVersion=8.5
4238
# Opt-out flag for bundling Kotlin standard library.
4339
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
4440
# suppress inspection "UnusedProperty"
4541
kotlin.stdlib.default.dependency=true
42+
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
43+
org.gradle.configuration-cache =true
44+
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
45+
org.gradle.caching =true

‎gradle/wrapper/gradle-wrapper.jar

-16 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp