Skip to content

Commit

Permalink
Update default Kotlin and Compose versions in Gradle tests (#2030)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyTsvetkov authored Apr 21, 2022
1 parent 362c61a commit f281b75
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions gradle-plugins/compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ tasks.withType<Test>().configureEach {

dependsOn(":publishToMavenLocal")
systemProperty("compose.plugin.version", BuildProperties.deployVersion(project))
systemProperty("kotlin.version", project.property("kotlin.version").toString())
}

task("printAllAndroidxReplacements") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ package org.jetbrains.compose.test

@Suppress("EnumEntryName")
enum class TestKotlinVersion(val versionString: String) {
// __KOTLIN_COMPOSE_VERSION__
Default("1.6.10")
Default(TestProperties.defaultKotlinVersion)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
package org.jetbrains.compose.test

object TestProperties {
val defaultKotlinVersion: String
get() = notNullSystemProperty("kotlin.version")

val composeVersion: String
get() = System.getProperty("compose.plugin.version")!!
get() = notNullSystemProperty("compose.plugin.version")

val gradleVersionForTests: String?
get() = System.getProperty("gradle.version.for.tests")

private fun notNullSystemProperty(property: String): String =
System.getProperty(property) ?: error("The '$property' system property is not set")
}
8 changes: 7 additions & 1 deletion gradle-plugins/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ kotlin.code.style=official
# unless overridden by COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION env var.
#
# __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=1.1.0
compose.version=0.0.0-master-dev673

# A version of Kotlin expected by __LATEST_COMPOSE_RELEASE_VERSION__
# This Kotlin version should be used in test or for checking plugin's compatibility,
# not for building the Gradle plugin itself!
# __KOTLIN_COMPOSE_VERSION__
kotlin.version=1.6.21

# A version of Gradle plugin, that will be published,
# unless overridden by COMPOSE_GRADLE_PLUGIN_VERSION env var.
Expand Down

0 comments on commit f281b75

Please sign in to comment.