Skip to content

Commit a09fbb3

Browse files
committed
chore: Upgrade Gradle IntelliJ Plugin to 2.x
1 parent 4998538 commit a09fbb3

File tree

6 files changed

+165
-101
lines changed

6 files changed

+165
-101
lines changed

.github/workflows/IJ.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
IJ:
18-
- IC-2024.2
18+
- IC-2024.3
1919
steps:
2020
- uses: actions/checkout@v4
2121
- name: Set up JDK 17

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2
11-
- name: Set up JDK 11
11+
- name: Set up JDK 17
1212
uses: actions/setup-java@v3
1313
with:
14-
java-version: 11
14+
java-version: 17
1515
distribution: 'temurin'
1616
cache: 'gradle'
1717
- name: Grant execute permission for gradlew

build.gradle

Lines changed: 0 additions & 97 deletions
This file was deleted.

build.gradle.kts

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
2+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
3+
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
4+
5+
plugins {
6+
id("java") // Java support
7+
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
8+
id("jacoco") // Code coverage
9+
id("maven-publish")
10+
}
11+
12+
group = "com.redhat.devtools.intellij"
13+
version = providers.gradleProperty("projectVersion").get() // Plugin version
14+
val platformVersion = providers.gradleProperty("ideaVersion").get()
15+
val exhortRepoUser: String? = findProperty("gpr.username") as String?
16+
?: System.getenv("GITHUB_USERNAME")
17+
val exhortRepoToken: String? = findProperty("gpr.token") as String?
18+
?: System.getenv("GITHUB_TOKEN")
19+
20+
// Set the JVM language level used to build the project.
21+
java {
22+
sourceCompatibility = JavaVersion.VERSION_17
23+
targetCompatibility = JavaVersion.VERSION_17
24+
withSourcesJar()
25+
withJavadocJar()
26+
}
27+
28+
repositories {
29+
mavenLocal()
30+
mavenCentral()
31+
intellijPlatform {
32+
defaultRepositories()
33+
}
34+
maven { url = uri("https://jitpack.io") }
35+
maven {
36+
url = uri("https://maven.pkg.github.com/trustification/exhort-java-api")
37+
credentials {
38+
username = exhortRepoUser
39+
password = exhortRepoToken
40+
}
41+
}
42+
maven {
43+
url = uri("https://maven.pkg.github.com/trustification/exhort-api-spec")
44+
credentials {
45+
username = exhortRepoUser
46+
password = exhortRepoToken
47+
}
48+
}
49+
}
50+
51+
sourceSets {
52+
named("main") {
53+
java.srcDir("src/main/gen")
54+
}
55+
}
56+
57+
dependencies {
58+
intellijPlatform {
59+
intellijIdeaCommunity(platformVersion)
60+
61+
// Bundled Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
62+
val platformBundledPlugins = ArrayList<String>()
63+
platformBundledPlugins.addAll(providers.gradleProperty("platformBundledPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }.get())
64+
/*
65+
* starting from 2024.3, all json related code is know on its own plugin
66+
*/
67+
if (platformVersion.startsWith("2024.3") || platformVersion.startsWith("2025.") || platformVersion.startsWith("25")) {
68+
platformBundledPlugins.add("com.intellij.modules.json")
69+
}
70+
println("use bundled Plugins: $platformBundledPlugins")
71+
bundledPlugins(platformBundledPlugins)
72+
73+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
74+
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
75+
76+
pluginVerifier()
77+
testFramework(TestFrameworkType.Platform)
78+
}
79+
80+
implementation(libs.github.api)
81+
implementation(libs.commons.compress)
82+
implementation(libs.exhort.api.spec)
83+
implementation(libs.exhort.java.api)
84+
implementation(libs.caffeine)
85+
implementation(libs.packageurl.java)
86+
implementation(libs.commons.io)
87+
88+
// for tests
89+
testImplementation(libs.junit)
90+
}
91+
92+
tasks {
93+
wrapper {
94+
gradleVersion = providers.gradleProperty("gradleVersion").get()
95+
}
96+
97+
runIde {
98+
systemProperties["com.redhat.devtools.intellij.telemetry.mode"] = "debug"
99+
}
100+
}
101+
102+
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-tasks.html#runIdeForUiTests
103+
val runIdeForUiTests by intellijPlatformTesting.runIde.registering {
104+
task {
105+
systemProperties["com.redhat.devtools.intellij.telemetry.mode"] = "debug"
106+
}
107+
plugins {
108+
robotServerPlugin()
109+
}
110+
}
111+
112+
intellijPlatform {
113+
buildSearchableOptions = false // no custom settings, see https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#how-to-disable-building-the-searchable-options
114+
}

gradle.properties

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
ideaVersion = 2024.2
21
projectVersion=1.1.0-SNAPSHOT
32
jetBrainsToken=invalid
43
jetBrainsChannel=stable
4+
5+
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
6+
ideaVersion=2024.3
7+
8+
# Gradle Releases -> https://github.com/gradle/gradle/releases
9+
gradleVersion=8.5
10+
11+
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
12+
platformBundledPlugins=org.jetbrains.plugins.yaml,com.intellij.java
13+
platformPlugins=com.redhat.devtools.intellij.telemetry:1.1.0.52,org.jetbrains.plugins.go:242.20224.159,Docker:242.20224.361
14+
15+
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
16+
kotlin.stdlib.default.dependency=false
17+
18+
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
19+
# disabled because of issue with publish plugin -> https://github.com/gradle-nexus/publish-plugin/issues/221
20+
org.gradle.configuration-cache=false
21+
22+
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
23+
org.gradle.caching=false

gradle/libs.versions.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[versions]
2+
# libraries
3+
caffeine = "3.1.8"
4+
commons-compress = "1.21"
5+
commons-io = "2.16.1"
6+
exhort-api-spec = "1.0.6"
7+
exhort-java-api = "0.0.8-SNAPSHOT"
8+
github-api = "1.314"
9+
junit = "4.13.2"
10+
packageurl-java = "1.4.1"
11+
12+
# plugins
13+
gradleIntelliJPlugin = "2.6.0"
14+
15+
[libraries]
16+
caffeine = { group = "com.github.ben-manes.caffeine", name = "caffeine", version.ref = "caffeine" }
17+
commons-compress = { group = "org.apache.commons", name = "commons-compress", version.ref = "commons-compress" }
18+
commons-io = { group = "commons-io", name = "commons-io", version.ref = "commons-io" }
19+
exhort-api-spec = { group = "com.redhat.ecosystemappeng", name = "exhort-api-spec", version.ref = "exhort-api-spec" }
20+
exhort-java-api = { group = "com.redhat.exhort", name = "exhort-java-api", version.ref = "exhort-java-api" }
21+
github-api = { group = "org.kohsuke", name = "github-api", version.ref = "github-api" }
22+
junit = { group = "junit", name = "junit", version.ref = "junit" }
23+
packageurl-java = { group = "com.github.package-url", name = "packageurl-java", version.ref = "packageurl-java" }
24+
25+
[plugins]
26+
gradleIntelliJPlugin = { id = "org.jetbrains.intellij.platform", version.ref = "gradleIntelliJPlugin" }
27+
28+

0 commit comments

Comments
 (0)