From 865a91784bebb29712621fe1d399d1c60d454dd9 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Wed, 18 May 2022 14:04:15 +0200 Subject: [PATCH] Share Test: binary compatibility run configurations --- .../Test__binary_compatibility.xml | 24 +++++++++++++++++++ ...Test__binary_compatibility__overwrite_.xml | 24 +++++++++++++++++++ .../build.gradle.kts | 16 +++++++++++-- 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 .idea/runConfigurations/Test__binary_compatibility.xml create mode 100644 .idea/runConfigurations/Test__binary_compatibility__overwrite_.xml diff --git a/.idea/runConfigurations/Test__binary_compatibility.xml b/.idea/runConfigurations/Test__binary_compatibility.xml new file mode 100644 index 00000000000..97ec2a50fb4 --- /dev/null +++ b/.idea/runConfigurations/Test__binary_compatibility.xml @@ -0,0 +1,24 @@ + + + + + + + false + true + false + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Test__binary_compatibility__overwrite_.xml b/.idea/runConfigurations/Test__binary_compatibility__overwrite_.xml new file mode 100644 index 00000000000..706436be1cb --- /dev/null +++ b/.idea/runConfigurations/Test__binary_compatibility__overwrite_.xml @@ -0,0 +1,24 @@ + + + + + + + false + true + false + + + \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin-idea-for-compatibility-tests/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-idea-for-compatibility-tests/build.gradle.kts index e0f3e2051fd..6833370c795 100644 --- a/libraries/tools/kotlin-gradle-plugin-idea-for-compatibility-tests/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-idea-for-compatibility-tests/build.gradle.kts @@ -6,8 +6,18 @@ */ val testedVersion = "1.7.0-dev-2723" +val isSnapshotTest = properties.contains("kgp-idea.snapshot_test") +val resolvedTestedVersion = if (isSnapshotTest) properties["defaultSnapshotVersion"].toString() else testedVersion + //region Download and prepare classpath for specified tested version +if (isSnapshotTest) { + repositories { + clear() + mavenLocal() + } +} + val classpathDestination = layout.buildDirectory.dir("classpath") val incomingClasspath by configurations.creating { @@ -18,14 +28,16 @@ val incomingClasspath by configurations.creating { } dependencies { - incomingClasspath(kotlin("gradle-plugin-idea", testedVersion)) + incomingClasspath(kotlin("gradle-plugin-idea", resolvedTestedVersion)) } val syncClasspath by tasks.register("syncClasspath") { + if (isSnapshotTest) dependsOnKotlinGradlePluginInstall() + from(incomingClasspath) into(classpathDestination) - val testedVersionLocal = testedVersion + val testedVersionLocal = resolvedTestedVersion /* Test if the correct version was resolved */ doLast { val expectedJar = destinationDir.resolve("kotlin-gradle-plugin-idea-$testedVersionLocal.jar")