Skip to content

Commit 676c364

Browse files
committed
chore: bump gradle to 9.1.0, org.jetbrains.intellij.platform plugin
1 parent fad9786 commit 676c364

File tree

6 files changed

+115
-90
lines changed

6 files changed

+115
-90
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
echo "$CHANGELOG" >> $GITHUB_OUTPUT
6060
echo "EOF" >> $GITHUB_OUTPUT
6161
62-
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
62+
./gradlew printProductsReleases # prepare list of IDEs for Plugin Verifier
6363
6464
# Run tests
6565
- name: Run Tests
@@ -82,7 +82,7 @@ jobs:
8282

8383
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
8484
- name: Run Plugin Verification tasks
85-
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
85+
run: ./gradlew verifyPlugin -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
8686

8787
# Collect Plugin Verifier Result
8888
- name: Collect Plugin Verifier Result

build.gradle.kts

Lines changed: 81 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fun properties(key: String) = project.findProperty(key).toString()
44

55
plugins {
66
id("org.jetbrains.kotlin.jvm") version "2.2.20"
7-
id("org.jetbrains.intellij") version "1.17.4"
7+
id("org.jetbrains.intellij.platform") version "2.9.0"
88
kotlin("plugin.serialization") version "2.2.20"
99

1010
// Gradle Changelog Plugin
@@ -14,88 +14,36 @@ plugins {
1414
group = properties("pluginGroup")
1515
version = properties("pluginVersion")
1616

17-
// Configure project's dependencies
18-
repositories {
19-
mavenCentral()
20-
}
21-
2217
// Set the JVM language level used to build the project.
2318
kotlin {
2419
jvmToolchain(properties("javaVersion").toInt())
2520
}
2621

27-
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
28-
intellij {
29-
pluginName.set(properties("pluginName"))
30-
version.set(properties("platformVersion"))
31-
type.set(properties("platformType"))
32-
updateSinceUntilBuild.set(false)
33-
34-
plugins.set(
35-
properties("platformPlugins").split(',')
36-
.map(String::trim)
37-
.filter(String::isNotEmpty)
38-
)
39-
}
22+
// Configure project's dependencies
23+
repositories {
24+
mavenCentral()
4025

41-
changelog {
42-
// version.set(properties("pluginVersion"))
43-
groups.empty()
44-
repositoryUrl.set(properties("pluginRepositoryUrl"))
26+
intellijPlatform {
27+
defaultRepositories()
28+
}
4529
}
4630

47-
tasks {
48-
wrapper {
49-
gradleVersion = properties("gradleVersion")
50-
}
31+
dependencies {
32+
intellijPlatform {
33+
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
5134

52-
patchPluginXml {
53-
version.set(properties("pluginVersion"))
54-
sinceBuild.set(properties("pluginSinceBuild"))
55-
// untilBuild.set(properties("pluginUntilBuild"))
35+
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
36+
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
5637

57-
// Get the latest available change notes from the changelog file
58-
changeNotes.set(provider {
59-
with(changelog) {
60-
renderItem(
61-
getOrNull(properties("pluginVersion")) ?: getUnreleased()
62-
.withHeader(false)
63-
.withEmptySections(false),
64-
Changelog.OutputType.HTML,
65-
)
66-
}
67-
})
68-
}
38+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
39+
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
6940

70-
signPlugin {
71-
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
72-
privateKey.set(System.getenv("PRIVATE_KEY"))
73-
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
74-
}
41+
// Module Dependencies. Uses `platformBundledModules` property from the gradle.properties file for bundled IntelliJ Platform modules.
42+
bundledModules(providers.gradleProperty("platformBundledModules").map { it.split(',') })
7543

76-
publishPlugin {
77-
dependsOn("patchChangelog")
78-
token.set(System.getenv("PUBLISH_TOKEN"))
44+
// testFramework(TestFrameworkType.Platform)
7945
}
80-
}
8146

82-
tasks.test {
83-
useJUnitPlatform()
84-
}
85-
86-
dependencies {
87-
// implementation("com.aallam.openai:openai-client:3.7.2") {
88-
// exclude(group = "org.slf4j", module = "slf4j-api")
89-
// // Prevents java.lang.LinkageError: java.lang.LinkageError: loader constraint violation:when resolving method 'long kotlin.time.Duration.toLong-impl(long, kotlin.time.DurationUnit)'
90-
// exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
91-
// }
92-
// implementation("io.ktor:ktor-client-cio:2.3.11") {
93-
// exclude(group = "org.slf4j", module = "slf4j-api")
94-
// // Prevents java.lang.LinkageError: java.lang.LinkageError: loader constraint violation: when resolving method 'long kotlin.time.Duration.toLong-impl(long, kotlin.time.DurationUnit)'
95-
// exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
96-
// }
97-
//
98-
// implementation("com.knuddels:jtokkit:1.0.0")
9947

10048
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
10149

@@ -122,3 +70,67 @@ dependencies {
12270
testImplementation("org.junit.jupiter:junit-jupiter:6.0.0")
12371
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
12472
}
73+
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
74+
intellijPlatform {
75+
pluginConfiguration {
76+
name = providers.gradleProperty("pluginName")
77+
version = providers.gradleProperty("platformVersion")
78+
79+
val changelog = project.changelog // local variable for configuration cache compatibility
80+
// Get the latest available change notes from the changelog file
81+
changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
82+
with(changelog) {
83+
renderItem(
84+
(getOrNull(pluginVersion) ?: getUnreleased())
85+
.withHeader(false)
86+
.withEmptySections(false),
87+
Changelog.OutputType.HTML,
88+
)
89+
}
90+
}
91+
92+
ideaVersion {
93+
sinceBuild.set(providers.gradleProperty("pluginSinceBuild"))
94+
}
95+
}
96+
97+
signing {
98+
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
99+
privateKey = providers.environmentVariable("PRIVATE_KEY")
100+
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
101+
}
102+
103+
publishing {
104+
token = providers.environmentVariable("PUBLISH_TOKEN")
105+
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
106+
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
107+
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
108+
channels = providers.gradleProperty("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
109+
}
110+
111+
pluginVerification {
112+
ides {
113+
recommended()
114+
}
115+
}
116+
}
117+
118+
changelog {
119+
// version.set(properties("pluginVersion"))
120+
groups.empty()
121+
repositoryUrl.set(properties("pluginRepositoryUrl"))
122+
}
123+
124+
tasks {
125+
wrapper {
126+
gradleVersion = properties("gradleVersion")
127+
}
128+
129+
publishPlugin {
130+
dependsOn("patchChangelog")
131+
}
132+
133+
test {
134+
useJUnitPlatform()
135+
}
136+
}

gradle.properties

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
pluginGroup = com.github.blarc
3-
pluginName = AICommits
3+
pluginName = AI Commits
44
pluginRepositoryUrl = https://github.com/Blarc/ai-commits-intellij-plugin
55
# SemVer format -> https://semver.org
66
pluginVersion = 2.16.0
@@ -13,20 +13,27 @@ pluginSinceBuild = 242
1313
platformType = IC
1414
platformVersion = 2024.2
1515

16-
# https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
17-
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
18-
platformPlugins = org.jetbrains.kotlin, org.jetbrains.plugins.github, Git4Idea, Subversion
16+
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
17+
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
18+
platformPlugins =
19+
# Example: platformBundledPlugins = com.intellij.java
20+
platformBundledPlugins = org.jetbrains.kotlin, org.jetbrains.plugins.github, Git4Idea, Subversion
21+
# Example: platformBundledModules = intellij.spellchecker
22+
platformBundledModules =
1923

2024
# If targeting 2022.3+, Java 17 is required.
2125
javaVersion = 21
2226

2327
# https://github.com/gradle/gradle/releases
24-
gradleVersion = 8.5
28+
gradleVersion = 9.1.0
2529

2630
# Opt-out flag for bundling Kotlin standard library.
2731
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
2832
# suppress inspection "UnusedProperty"
2933
kotlin.stdlib.default.dependency = false
3034

3135
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
32-
org.gradle.unsafe.configuration-cache = true
36+
org.gradle.configuration-cache = true
37+
38+
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
39+
org.gradle.caching = true

gradle/wrapper/gradle-wrapper.jar

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

gradlew

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
9088

9189
# Use the maximum available, or set MAX_FD != -1 to use that value.
9290
MAX_FD=maximum
@@ -133,26 +131,29 @@ location of your Java installation."
133131
fi
134132
else
135133
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137137
138138
Please set the JAVA_HOME variable in your environment to match the
139139
location of your Java installation."
140+
fi
140141
fi
141142

142143
# Increase the maximum file descriptors if we can.
143144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
146147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
148149
MAX_FD=$( ulimit -H -n ) ||
149150
warn "Could not query maximum file descriptor limit"
150151
esac
151152
case $MAX_FD in #(
152153
'' | soft) :;; #(
153154
*)
154155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
156157
ulimit -n "$MAX_FD" ||
157158
warn "Could not set maximum file descriptor limit to $MAX_FD"
158159
esac
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
197198
done
198199
fi
199200

200-
# Collect all arguments for the java command;
201-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202-
# shell script including quotes and variable substitutions, so put them in
203-
# double quotes to make sure that they get re-expanded; and
204-
# * put everything else in single quotes, so that it's not re-expanded.
201+
202+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204+
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
205210

206211
set -- \
207212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

0 commit comments

Comments
 (0)