Skip to content

Commit d328471

Browse files
authored
Merge pull request #2359 from digma-ai/upgrade-intellij-platform-plugin-to-2.0
upgrade to intellij platform gradle plugin 2.0.0 release Closes #2286
2 parents ad344ad + 8539dba commit d328471

File tree

30 files changed

+313
-171
lines changed

30 files changed

+313
-171
lines changed

.github/workflows/build-workflow.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,12 @@ jobs:
5252

5353
- name: Build Plugin
5454
if: ${{ inputs.build-with-rider != 'true' }}
55-
env:
56-
POSTHOG_TOKEN_URL: ${{ secrets.POSTHOG_TOKEN_URL }}
5755
run: ./gradlew clean test buildPlugin --no-configuration-cache -PbuildProfile=${{ inputs.build-profile }} -PbuildSearchableOptions=true
5856

5957
- name: Build Plugin with Rider
6058
if: ${{ inputs.build-with-rider == 'true' }}
61-
env:
62-
POSTHOG_TOKEN_URL: ${{ secrets.POSTHOG_TOKEN_URL }}
6359
run: ./gradlew clean test buildPlugin --no-configuration-cache -PbuildWithRider=true -PbuildProfile=${{ inputs.build-profile }} -PbuildSearchableOptions=true
6460

65-
- name: Validate posthog url
66-
uses: ./github-actions/validate-posthog-url
67-
with:
68-
build-profile: ${{ inputs.build-profile }}
69-
7061
- name: Prepare Plugin Artifact
7162
if: ${{ inputs.build-with-rider != 'true' }}
7263
id: artifact

.github/workflows/publish-workflow.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,7 @@ jobs:
7171
./gradlew --no-configuration-cache -PbuildProfile=${{ inputs.build-profile }} patchChangelog --release-note="$CHANGELOG"
7272
7373
- name: Build plugin
74-
env:
75-
POSTHOG_TOKEN_URL: ${{ secrets.POSTHOG_TOKEN_URL }}
76-
run: ./gradlew buildPlugin --no-configuration-cache -PbuildProfile=${{ inputs.build-profile }} -PbuildSearchableOptions=true
77-
78-
- name: Validate posthog url
79-
uses: ./github-actions/validate-posthog-url
80-
with:
81-
build-profile: ${{ inputs.build-profile }}
74+
run: ./gradlew test buildPlugin --no-configuration-cache -PbuildProfile=${{ inputs.build-profile }} -PbuildSearchableOptions=true
8275

8376

8477
# Publish the plugin to the Marketplace
@@ -88,7 +81,6 @@ jobs:
8881
DIGMA_JB_PRIVATE_KEY_PASSWORD: ${{ secrets.DIGMA_JB_PRIVATE_KEY_PASSWORD }}
8982
DIGMA_JB_CERTIFICATE_CHAIN_FILE: ${{ secrets.DIGMA_JB_CERTIFICATE_CHAIN_FILE }}
9083
DIGMA_JB_PRIVATE_KEY_FILE: ${{ secrets.DIGMA_JB_PRIVATE_KEY_FILE }}
91-
POSTHOG_TOKEN_URL: ${{ secrets.POSTHOG_TOKEN_URL }}
9284
run: ./gradlew publishPlugin --no-configuration-cache -PbuildProfile=${{ inputs.build-profile }} -PbuildSearchableOptions=true
9385

9486

build.gradle.kts

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import common.currentProfile
33
import common.dynamicPlatformType
44
import common.platformVersion
55
import common.properties
6+
import common.useBinaryInstaller
67
import common.withCurrentProfile
78
import org.apache.tools.ant.filters.ReplaceTokens
89
import org.jetbrains.changelog.date
@@ -74,7 +75,7 @@ dependencies {
7475

7576
val version = project.platformVersion()
7677
//the intellij product. we use the create method because it may be Idea,Rider,Pycharm etc.
77-
create(platformType, version)
78+
create(platformType, version, project.useBinaryInstaller())
7879

7980
pluginModule(implementation(project(":ide-common")))
8081
pluginModule(implementation(project(":jvm-common")))
@@ -180,7 +181,7 @@ intellijPlatform {
180181

181182

182183
//todo: run plugin verifier for resharper: https://blog.jetbrains.com/dotnet/2023/05/26/the-api-verifier/
183-
verifyPlugin {
184+
pluginVerification {
184185
//our plugin id is "org.digma.intellij", lately jetbrains added a check that
185186
// plugin id doesn't contain the word intellij and treats it as error. so we need
186187
// '-mute TemplateWordInPluginId' to silence this error.
@@ -190,16 +191,23 @@ intellijPlatform {
190191
//use the same platformType and version as in intellijPlatform dependencies
191192
//Note: recommended() doesn't work well, sometimes tries to resolve a wrong IDE and fails in GitHub
192193
withCurrentProfile { buildProfile ->
193-
ide(platformType,buildProfile.platformVersion)
194-
195-
if (!buildProfile.isEAP) {
196-
select {
197-
types =
198-
listOf(IntelliJPlatformType.IntellijIdeaCommunity, IntelliJPlatformType.IntellijIdeaUltimate)
199-
channels = listOf(ProductRelease.Channel.RELEASE)
200-
sinceBuild = project.currentProfile().pluginSinceBuild
201-
untilBuild = project.currentProfile().pluginUntilBuild
202-
}
194+
//ide doesn't work with EAP that needs to be downloaded from maven and not CDN
195+
//there is a feature request: https://github.com/JetBrains/intellij-platform-gradle-plugin/issues/1715
196+
//ide(platformType, buildProfile.platformVersion)
197+
//use recommended() and hope it doesn't fail too much because sometimes it does fail for unknown reasons
198+
recommended()
199+
200+
val channel = if (buildProfile.isEAP) {
201+
ProductRelease.Channel.EAP
202+
} else {
203+
ProductRelease.Channel.RELEASE
204+
}
205+
select {
206+
types =
207+
listOf(IntelliJPlatformType.IntellijIdeaCommunity, IntelliJPlatformType.IntellijIdeaUltimate)
208+
channels = listOf(channel)
209+
sinceBuild = project.currentProfile().pluginSinceBuild
210+
untilBuild = project.currentProfile().pluginUntilBuild
203211
}
204212
}
205213
}
@@ -260,9 +268,9 @@ tasks {
260268

261269
val deleteLog by registering(Delete::class) {
262270
outputs.upToDateWhen { false }
263-
val ideFolderName = if(platformType == IntelliJPlatformType.Rider){
271+
val ideFolderName = if (platformType == IntelliJPlatformType.Rider) {
264272
"${platformType.code}-${project.currentProfile().riderVersion}"
265-
}else{
273+
} else {
266274
"${platformType.code}-${project.currentProfile().platformVersion}"
267275
}
268276
project.layout.buildDirectory.dir("idea-sandbox/$ideFolderName/log").get().asFile.walk().forEach {
@@ -310,27 +318,7 @@ tasks {
310318
}
311319

312320

313-
val posthogTokenUrlFile = file("${project.sourceSets.main.get().output.resourcesDir?.absolutePath}/posthog-token-url.txt")
314-
val injectPosthogTokenUrlTask by registering {
315-
316-
inputs.property("token",System.getenv("POSTHOG_TOKEN_URL") ?: "")
317-
outputs.files(posthogTokenUrlFile)
318-
319-
doLast {
320-
logger.lifecycle("injecting posthog token url")
321-
val url = System.getenv("POSTHOG_TOKEN_URL") ?: ""
322-
posthogTokenUrlFile.writeText(url)
323-
}
324-
}
325-
326-
327-
jar{
328-
inputs.files(injectPosthogTokenUrlTask)
329-
}
330-
331-
332321
processResources {
333-
finalizedBy(injectPosthogTokenUrlTask)
334322

335323
exclude("**/webview/global-env-vars.txt")
336324

building-how-to/build-all-profiles.sh

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,56 +8,93 @@ set -e
88

99
# there is no need to send the oldest profile, its the default if not sent. its here just as example
1010

11-
# todo: add 242
12-
1311
## check that profile aliases work
12+
echo "############ building with lowest ################"
1413
./gradlew clean buildPlugin -PbuildProfile=lowest
14+
for i in {1..5}; do echo; done
15+
16+
echo "############ building with latest ################"
1517
./gradlew clean buildPlugin -PbuildProfile=latest
18+
for i in {1..5}; do echo; done
19+
20+
echo "############ building with eap ################"
1621
./gradlew clean buildPlugin -PbuildProfile=eap
22+
for i in {1..5}; do echo; done
1723

24+
echo "############ building with default ################"
25+
./gradlew clean buildPlugin
26+
for i in {1..5}; do echo; done
1827

28+
echo "############ building with 231 ################"
1929
./gradlew clean buildPlugin -PbuildProfile=p231
30+
for i in {1..5}; do echo; done
31+
32+
echo "############ building with 232 ################"
2033
./gradlew clean buildPlugin -PbuildProfile=p232
34+
for i in {1..5}; do echo; done
35+
36+
echo "############ building with 233 ################"
2137
./gradlew clean buildPlugin -PbuildProfile=p233
38+
for i in {1..5}; do echo; done
39+
40+
echo "############ building with 241 ################"
2241
./gradlew clean buildPlugin -PbuildProfile=p241
23-
./gradlew clean buildPlugin -PbuildProfile=p242
42+
for i in {1..5}; do echo; done
2443

44+
echo "############ building with 232 ################"
45+
./gradlew clean buildPlugin -PbuildProfile=p242
46+
for i in {1..5}; do echo; done
2547

2648
###################### idea ultimate
2749

50+
echo "############ building with ultimate default ################"
2851
./gradlew clean buildPlugin -PbuildWIthUltimate=true
52+
for i in {1..5}; do echo; done
53+
54+
echo "############ building with ultimate 231 ################"
2955
./gradlew clean buildPlugin -PbuildWIthUltimate=true -PbuildProfile=p231
56+
for i in {1..5}; do echo; done
57+
58+
echo "############ building with ultimate 232 ################"
3059
./gradlew clean buildPlugin -PbuildWIthUltimate=true -PbuildProfile=p232
60+
for i in {1..5}; do echo; done
61+
62+
echo "############ building with ultimate 233 ################"
3163
./gradlew clean buildPlugin -PbuildWIthUltimate=true -PbuildProfile=p233
64+
for i in {1..5}; do echo; done
65+
66+
echo "############ building with ultimate 241 ################"
3267
./gradlew clean buildPlugin -PbuildWIthUltimate=true -PbuildProfile=p241
68+
for i in {1..5}; do echo; done
69+
70+
echo "############ building with ultimate 242 ################"
3371
./gradlew clean buildPlugin -PbuildWIthUltimate=true -PbuildProfile=p242
72+
for i in {1..5}; do echo; done
73+
3474

3575

3676

3777
################# rider
78+
echo "############ building with rider default ################"
3879
./gradlew clean buildPlugin -PbuildWithRider=true
39-
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p231
40-
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p232
41-
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p233
42-
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p241
43-
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p242
80+
for i in {1..5}; do echo; done
4481

45-
###################### pycharm
46-
47-
#./gradlew clean buildPlugin -PbuildWithPycharm=true
48-
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p231
49-
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p232
50-
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p233
51-
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p241
52-
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p242
82+
echo "############ building with rider 231 ################"
83+
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p231
84+
for i in {1..5}; do echo; done
5385

86+
echo "############ building with rider 232 ################"
87+
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p232
88+
for i in {1..5}; do echo; done
5489

55-
###################### pycharm pro
90+
echo "############ building with rider 233 ################"
91+
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p233
92+
for i in {1..5}; do echo; done
5693

57-
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true
58-
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p231
59-
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p232
60-
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p233
61-
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p241
62-
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p242
94+
echo "############ building with rider 241 ################"
95+
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p241
96+
for i in {1..5}; do echo; done
6397

98+
echo "############ building with rider 242 ################"
99+
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p242
100+
for i in {1..5}; do echo; done

building-how-to/build-and-verify-all-profiles.sh

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,95 @@ set -e
99
# there is no need to send the oldest profile, its the default if not sent. its here just as example
1010

1111
## check that profile aliases work
12+
echo "############ building with lowest ################"
1213
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=lowest
14+
for i in {1..5}; do echo; done
15+
16+
echo "############ building with latest ################"
1317
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=latest
18+
for i in {1..5}; do echo; done
19+
20+
echo "############ building with eap ################"
1421
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=eap
22+
for i in {1..5}; do echo; done
23+
24+
echo "############ building with default ################"
25+
./gradlew clean buildPlugin verifyPlugin
26+
for i in {1..5}; do echo; done
1527

28+
echo "############ building with 231 ################"
1629
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p231
30+
for i in {1..5}; do echo; done
31+
32+
echo "############ building with 232 ################"
1733
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p232
34+
for i in {1..5}; do echo; done
35+
36+
echo "############ building with 233 ################"
1837
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p233
38+
for i in {1..5}; do echo; done
39+
40+
echo "############ building with 241 ################"
1941
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p241
20-
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p242
42+
for i in {1..5}; do echo; done
2143

44+
echo "############ building with 232 ################"
45+
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p242
46+
for i in {1..5}; do echo; done
2247

2348
###################### idea ultimate
2449

50+
echo "############ building with ultimate default ################"
2551
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true
52+
for i in {1..5}; do echo; done
53+
54+
echo "############ building with ultimate 231 ################"
2655
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true -PbuildProfile=p231
56+
for i in {1..5}; do echo; done
57+
58+
echo "############ building with ultimate 232 ################"
2759
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true -PbuildProfile=p232
60+
for i in {1..5}; do echo; done
61+
62+
echo "############ building with ultimate 233 ################"
2863
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true -PbuildProfile=p233
64+
for i in {1..5}; do echo; done
65+
66+
echo "############ building with ultimate 241 ################"
2967
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true -PbuildProfile=p241
68+
for i in {1..5}; do echo; done
69+
70+
echo "############ building with ultimate 242 ################"
3071
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true -PbuildProfile=p242
72+
for i in {1..5}; do echo; done
73+
3174

3275

3376

3477
################# rider
78+
echo "############ building with rider default ################"
3579
./gradlew clean buildPlugin -PbuildWithRider=true
80+
for i in {1..5}; do echo; done
81+
82+
echo "############ building with rider 231 ################"
3683
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p231
84+
for i in {1..5}; do echo; done
85+
86+
echo "############ building with rider 232 ################"
3787
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p232
88+
for i in {1..5}; do echo; done
89+
90+
echo "############ building with rider 233 ################"
3891
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p233
92+
for i in {1..5}; do echo; done
93+
94+
echo "############ building with rider 241 ################"
3995
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p241
96+
for i in {1..5}; do echo; done
97+
98+
echo "############ building with rider 242 ################"
4099
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p242
100+
for i in {1..5}; do echo; done
41101

42102
###################### pycharm
43103

common-build-logic/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ repositories {
1111
}
1212

1313
dependencies {
14-
implementation("org.jetbrains.intellij.platform:intellij-platform-gradle-plugin:2.0.0-beta8")
14+
//when updating intellij-platform-gradle-plugin update also org.jetbrains.intellij.platform.settings plugin
15+
// in settings file to the same version. we need to maintain it in two places, unfortunately.
16+
implementation("org.jetbrains.intellij.platform:intellij-platform-gradle-plugin:2.0.0")
1517
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
1618
implementation("com.glovoapp.gradle:versioning:1.1.10")
1719
implementation("de.undercouch:gradle-download-task:5.6.0")

common-build-logic/src/main/kotlin/common-java.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ tasks {
9393
})
9494

9595
testLogging {
96+
showStandardStreams = false
9697
lifecycle {
9798
events = mutableSetOf(TestLogEvent.FAILED)
9899
exceptionFormat = TestExceptionFormat.SHORT
@@ -111,8 +112,6 @@ tasks {
111112
}
112113
info.events = debug.events
113114
info.exceptionFormat = debug.exceptionFormat
114-
115-
116115
}
117116

118117
addTestOutputListener { testDescriptor, outputEvent ->

0 commit comments

Comments
 (0)