Skip to content

Commit c4d050b

Browse files
authored
Update IntelliJ Platform Gradle Plugin to 2.0.0 (#4704)
1 parent a7e2b3c commit c4d050b

File tree

6 files changed

+22
-39
lines changed

6 files changed

+22
-39
lines changed

buildSrc/src/main/kotlin/temp-toolkit-intellij-root-conventions.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ dependencies {
7373
create(type, version, useInstaller = false)
7474
}
7575

76-
implementation(project(":plugin-toolkit:jetbrains-core"))
7776
implementation(project(":plugin-toolkit:jetbrains-ultimate"))
7877
project.findProject(":plugin-toolkit:jetbrains-gateway")?.let {
7978
// does this need to be the instrumented variant?
@@ -85,11 +84,6 @@ dependencies {
8584
resharperDlls(project(":plugin-toolkit:jetbrains-rider", configuration = "resharperDlls"))
8685
}
8786

88-
// Enable coverage for the UI test target IDE
89-
ciOnly {
90-
extensions.getByType<JacocoPluginExtension>().applyTo(tasks.withType<TestIdeUiTask>())
91-
}
92-
9387
tasks.withType<TestIdeUiTask>().configureEach {
9488
systemProperty("robot-server.port", remoteRobotPort)
9589
// mac magic

buildSrc/src/main/kotlin/toolkit-integration-testing.gradle.kts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import org.jetbrains.intellij.platform.gradle.Constants.Configurations.Attributes
5+
import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformTestingExtension
56
import software.aws.toolkits.gradle.ciOnly
67
import software.aws.toolkits.gradle.findFolders
78
import software.aws.toolkits.gradle.intellij.IdeVersions
@@ -58,12 +59,11 @@ idea {
5859
testResourceDirs = testResourceDirs + integrationTests.resources.srcDirs
5960
}
6061
}
61-
62-
val integTestTask = tasks.register<Test>("integrationTest") {
62+
val integrationTestConfiguration: Test.() -> Unit = {
6363
group = LifecycleBasePlugin.VERIFICATION_GROUP
6464
description = "Runs the integration tests."
6565
testClassesDirs = integrationTests.output.classesDirs
66-
classpath = integrationTests.runtimeClasspath
66+
classpath += integrationTests.runtimeClasspath
6767

6868
ciOnly {
6969
environment.remove("AWS_ACCESS_KEY_ID")
@@ -74,15 +74,16 @@ val integTestTask = tasks.register<Test>("integrationTest") {
7474
mustRunAfter(tasks.test)
7575
}
7676

77-
tasks.check {
78-
dependsOn(integrationTests.compileJavaTaskName, integrationTests.getCompileTaskName("kotlin"))
79-
}
80-
81-
afterEvaluate {
82-
plugins.withType<ToolkitIntellijSubpluginPlugin>().configureEach {
83-
// intellij plugin overrides with instrumented classes that we don't want or need
84-
integTestTask.configure {
85-
testClassesDirs = integrationTests.output.classesDirs
77+
extensions.findByType<IntelliJPlatformTestingExtension>()?.let {
78+
val integrationTest by it.testIde.registering {
79+
task {
80+
integrationTestConfiguration(this)
8681
}
8782
}
83+
} ?: run {
84+
val integrationTest by tasks.registering(Test::class, integrationTestConfiguration)
85+
}
86+
87+
tasks.check {
88+
dependsOn(integrationTests.compileJavaTaskName, integrationTests.getCompileTaskName("kotlin"))
8889
}

buildSrc/src/main/kotlin/toolkit-intellij-plugin.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
44
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
5-
import org.jetbrains.intellij.platform.gradle.tasks.aware.TestableAware
5+
import org.jetbrains.intellij.platform.gradle.tasks.aware.SandboxAware
66
import software.aws.toolkits.gradle.ciOnly
77
import software.aws.toolkits.gradle.intellij.ToolkitIntelliJExtension
88

@@ -34,10 +34,10 @@ dependencies {
3434
ciOnly {
3535
abstract class NoopBuildService : BuildService<BuildServiceParameters.None> {}
3636
val noopService = gradle.sharedServices.registerIfAbsent("noopService", NoopBuildService::class.java) {
37-
maxParallelUsages = 4
37+
maxParallelUsages = 2
3838
}
3939

40-
tasks.matching { it is TestableAware }.configureEach {
40+
tasks.matching { it is Test || it is SandboxAware }.configureEach {
4141
usesService(noopService)
4242
}
4343
}

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ awsSdk = "2.26.25"
77
commonmark = "0.22.0"
88
detekt = "1.23.6"
99
intellijExt = "1.1.8"
10-
intellijGradle = "2.0.0-beta9"
10+
intellijGradle = "2.0.0"
1111
intellijRemoteRobot = "0.11.22"
1212
jackson = "2.16.1"
1313
jacoco = "0.8.12"

plugins/toolkit/intellij-standalone/build.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
import org.jetbrains.intellij.platform.gradle.Constants.Tasks
4-
import org.jetbrains.intellij.platform.gradle.tasks.PatchPluginXmlTask
53
import software.aws.toolkits.gradle.findFolders
64
import software.aws.toolkits.gradle.intellij.IdeVersions
75

@@ -23,15 +21,10 @@ intellijPlatform {
2321
dependencies {
2422
intellijPlatform {
2523
localPlugin(project(":plugin-core"))
24+
pluginModule(project(":plugin-toolkit:jetbrains-core"))
2625
}
2726
}
2827

29-
tasks.jarSearchableOptions {
30-
dependsOn(":plugin-toolkit:jetbrains-core:${Tasks.PATCH_PLUGIN_XML}")
31-
32-
pluginXml.set(project(":plugin-toolkit:jetbrains-core").tasks.maybeCreate<PatchPluginXmlTask>(Tasks.PATCH_PLUGIN_XML).outputFile)
33-
}
34-
3528
tasks.check {
3629
val serviceSubdirs = project(":plugin-toolkit").subprojects
3730
.map { it.name }.filter { it != "intellij" }.filter { it != "intellij-standalone" }

plugins/toolkit/jetbrains-gateway/build.gradle.kts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import net.bytebuddy.utility.RandomString
66
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
7-
import org.jetbrains.intellij.platform.gradle.tasks.PatchPluginXmlTask
87
import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
98
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated
109
import software.aws.toolkits.gradle.intellij.IdeFlavor
@@ -51,6 +50,7 @@ val gatewayOnlyResourcesJar by tasks.registering(Jar::class) {
5150

5251
listOf(
5352
"intellijPlatformDependency",
53+
"intellijPlatformDependency_integrationTest",
5454
"intellijPluginVerifierIdesDependency",
5555
).forEach { configurationName ->
5656
configurations[configurationName].dependencies.addLater(
@@ -66,14 +66,15 @@ listOf(
6666

6767
dependencies {
6868
intellijPlatform {
69+
pluginModule(project(":plugin-toolkit:jetbrains-core", "gatewayArtifacts"))
70+
6971
pluginVerifier()
7072

7173
testFramework(TestFrameworkType.Bundled)
7274
}
7375

74-
// link against :j-c: and rely on :intellij:buildPlugin to pull in :j-c:instrumentedJar, but gateway variant when runIde/buildPlugin from :jetbrains-gateway
76+
// link against :j-c: and rely on :intellij-standalone:composeJar to pull in :j-c:instrumentedJar, but gateway variant when from :jetbrains-gateway
7577
compileOnly(project(":plugin-toolkit:jetbrains-core"))
76-
gatewayOnlyRuntimeOnly(project(":plugin-toolkit:jetbrains-core", "gatewayArtifacts"))
7778
// delete when fully split
7879
gatewayOnlyRuntimeOnly(project(":plugin-core:core"))
7980
gatewayOnlyRuntimeOnly(project(":plugin-core:jetbrains-community"))
@@ -162,12 +163,6 @@ listOf(
162163
}
163164
}
164165

165-
tasks.jarSearchableOptions {
166-
dependsOn(":plugin-toolkit:jetbrains-core:pluginXmlForGateway")
167-
168-
pluginXml.set(project(":plugin-toolkit:jetbrains-core").tasks.maybeCreate<PatchPluginXmlTask>("pluginXmlForGateway").outputFile)
169-
}
170-
171166
tasks.buildPlugin {
172167
val classifier = if (archiveClassifier.get().isNullOrBlank()) {
173168
"GW"

0 commit comments

Comments
 (0)