[KPM] kotlin-gradle-plugin-idea: Implement -Psnapshot property
When set, the backwards compatibility test will run against a locally installed snapshot version KT-51262 KT-51220
This commit is contained in:
committed by
Space
parent
5ad1292b67
commit
82ec54aead
@@ -2,6 +2,10 @@ plugins {
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
object BackwardsCompatibilityTestConfiguration {
|
||||
const val minimalBackwardsCompatibleVersion = "1.7.0-dev-1868"
|
||||
}
|
||||
|
||||
kotlin.sourceSets.configureEach {
|
||||
languageSettings.apiVersion = "1.4"
|
||||
languageSettings.languageVersion = "1.4"
|
||||
@@ -19,15 +23,22 @@ dependencies {
|
||||
publish()
|
||||
|
||||
tasks.test {
|
||||
/* When -Psnapshot is set, then the test runs against a locally installed snapshot version (./gradlew install) */
|
||||
val isSnapshotTest = project.providers.gradleProperty("snapshot").isPresent
|
||||
|
||||
repositories {
|
||||
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
|
||||
if (isSnapshotTest) mavenLocal()
|
||||
}
|
||||
|
||||
/* Setup for backwards compatibility test */
|
||||
val minimalBackwardsCompatibleVersion = "1.7.0-dev-1868"
|
||||
val version = if (isSnapshotTest) properties["defaultSnapshotVersion"].toString()
|
||||
else BackwardsCompatibilityTestConfiguration.minimalBackwardsCompatibleVersion
|
||||
|
||||
val minimalBackwardsCompatibleVersionTestClasspath by configurations.creating
|
||||
|
||||
dependencies {
|
||||
minimalBackwardsCompatibleVersionTestClasspath("org.jetbrains.kotlin:kotlin-gradle-plugin-idea:$minimalBackwardsCompatibleVersion")
|
||||
minimalBackwardsCompatibleVersionTestClasspath("org.jetbrains.kotlin:kotlin-gradle-plugin-idea:$version")
|
||||
}
|
||||
|
||||
dependsOn(minimalBackwardsCompatibleVersionTestClasspath)
|
||||
|
||||
Reference in New Issue
Block a user