Share Test: binary compatibility run configurations

This commit is contained in:
sebastian.sellmair
2022-05-18 14:04:15 +02:00
committed by Space
parent 4f4f749c08
commit 865a91784b
3 changed files with 62 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: binary compatibility" type="GradleRunConfiguration" factoryName="Gradle" folderName="Tests">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":tools:binary-compatibility-validator:clean" />
<option value=":tools:binary-compatibility-validator:test" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: binary compatibility [overwrite]" type="GradleRunConfiguration" factoryName="Gradle" folderName="Tests">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-Doverwrite.output=true" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":tools:binary-compatibility-validator:clean" />
<option value=":tools:binary-compatibility-validator:test" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
@@ -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<Sync>("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")