Browse Source

Allow customizing Compose compiler plugin (#2347)

By default, the Compose Multiplatform Gradle plugin
uses `org.jetbrains.compose.compiler:compiler:<COMPOSE_VERSION>`
as a compiler plugin .
However, a new version of Kotlin might be incompatible with
the default version of compiler plugin. Previously, that forced
users to update to a new version of Compose Gradle plugin & Compose libraries
in order to use a new version of Kotlin. Accordingly, Compose framework developers
had to release a new version of all libraries, when a new version of Kotlin is released.

Some time ago the Compose team at Google made it possible to update a compiler plugin
without updating the Gradle plugin and/or all Compose libraries
https://developer.android.com/jetpack/androidx/releases/compose-kotlin

This change allows to specify a custom compiler artifact by using the following DSL:
```
compose {
    kotlinCompilerPlugin.set("<VERSION<")
    // or
    kotlinCompilerPlugin.set("<GROUP_ID>:<ARTIFACT_ID>:<VERSION>")
}
```
pull/2353/head
Alexey Tsvetkov 2 years ago committed by GitHub
parent
commit
58b0a22fb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      gradle-plugins/buildSrc/src/main/kotlin/BuildProperties.kt
  2. 14
      gradle-plugins/compose/build.gradle.kts
  3. 23
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeCompilerKotlinSupportPlugin.kt
  4. 11
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeExtension.kt
  5. 66
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/internal/ComposeCompilerArtifactProvider.kt
  6. 11
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt
  7. 20
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestProperties.kt
  8. 24
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/DesktopApplicationTest.kt
  9. 14
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt
  10. 107
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/unit/ComposeCompilerArtifactProviderTest.kt
  11. 9
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/unit/FileHashTest.kt
  12. 10
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/GradlePluginTestBase.kt
  13. 2
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/GradleTestNameGenerator.kt
  14. 12
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestKotlinVersion.kt
  15. 14
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProject.kt
  16. 5
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProjects.kt
  17. 29
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProperties.kt
  18. 6
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/assertUtils.kt
  19. 2
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/fileUtils.kt
  20. 2
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/processUtils.kt
  21. 2
      gradle-plugins/compose/src/test/resources/junit-platform.properties
  22. 31
      gradle-plugins/compose/src/test/test-projects/application/androidx-compiler/build.gradle
  23. BIN
      gradle-plugins/compose/src/test/test-projects/application/androidx-compiler/main-image.expected.png
  24. 11
      gradle-plugins/compose/src/test/test-projects/application/androidx-compiler/settings.gradle
  25. 76
      gradle-plugins/compose/src/test/test-projects/application/androidx-compiler/src/main/kotlin/Main.kt
  26. 2
      gradle-plugins/compose/src/test/test-projects/application/defaultArgs/settings.gradle
  27. 2
      gradle-plugins/compose/src/test/test-projects/application/defaultArgsOverride/settings.gradle
  28. 2
      gradle-plugins/compose/src/test/test-projects/application/javaLogger/settings.gradle
  29. 2
      gradle-plugins/compose/src/test/test-projects/application/jvm/settings.gradle
  30. 2
      gradle-plugins/compose/src/test/test-projects/application/jvmKotlinDsl/settings.gradle
  31. 2
      gradle-plugins/compose/src/test/test-projects/application/macOptions/settings.gradle
  32. 2
      gradle-plugins/compose/src/test/test-projects/application/macSign/settings.gradle
  33. 2
      gradle-plugins/compose/src/test/test-projects/application/moduleClashCli/settings.gradle
  34. 2
      gradle-plugins/compose/src/test/test-projects/application/mpp/settings.gradle
  35. 2
      gradle-plugins/compose/src/test/test-projects/application/optionsWithSpaces/settings.gradle
  36. 2
      gradle-plugins/compose/src/test/test-projects/application/proguard/settings.gradle
  37. 2
      gradle-plugins/compose/src/test/test-projects/application/resources/settings.gradle
  38. 2
      gradle-plugins/compose/src/test/test-projects/application/unpackSkiko/settings.gradle
  39. 2
      gradle-plugins/compose/src/test/test-projects/misc/jsMpp/settings.gradle
  40. 2
      gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/settings.gradle
  41. 21
      gradle-plugins/gradle.properties

9
gradle-plugins/buildSrc/src/main/kotlin/BuildProperties.kt

@ -15,7 +15,14 @@ object BuildProperties {
fun composeVersion(project: Project): String = fun composeVersion(project: Project): String =
System.getenv("COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION") System.getenv("COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION")
?: project.findProperty("compose.version") as String ?: project.findProperty("compose.version") as String
fun composeCompilerVersion(project: Project): String = project.findProperty("compose.compiler.version") as String fun composeCompilerVersion(project: Project): String =
project.findProperty("compose.compiler.version") as String
fun composeCompilerCompatibleKotlinVersion(project: Project): String =
project.findProperty("compose.compiler.compatible.kotlin.version") as String
fun testsAndroidxCompilerVersion(project: Project): String =
project.findProperty("compose.tests.androidx.compiler.version") as String
fun testsAndroidxCompilerCompatibleVersion(project: Project): String =
project.findProperty("compose.tests.androidx.compatible.kotlin.version") as String
fun deployVersion(project: Project): String = fun deployVersion(project: Project): String =
System.getenv("COMPOSE_GRADLE_PLUGIN_VERSION") System.getenv("COMPOSE_GRADLE_PLUGIN_VERSION")
?: project.findProperty("deploy.version") as String ?: project.findProperty("deploy.version") as String

14
gradle-plugins/compose/build.gradle.kts

@ -66,6 +66,7 @@ dependencies {
testImplementation(gradleTestKit()) testImplementation(gradleTestKit())
testImplementation(platform("org.junit:junit-bom:5.7.0")) testImplementation(platform("org.junit:junit-bom:5.7.0"))
testImplementation("org.junit.jupiter:junit-jupiter") testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation(kotlin("gradle-plugin-api"))
// include relocated download task to avoid potential runtime conflicts // include relocated download task to avoid potential runtime conflicts
embedded("de.undercouch:gradle-download-task:4.1.1") embedded("de.undercouch:gradle-download-task:4.1.1")
@ -105,7 +106,7 @@ val javaHomeForTests: String? = when {
} }
val isWindows = getCurrentOperatingSystem().isWindows val isWindows = getCurrentOperatingSystem().isWindows
val gradleTestsPattern = "org.jetbrains.compose.gradle.*" val gradleTestsPattern = "org.jetbrains.compose.test.tests.integration.*"
// check we don't accidentally including unexpected classes (e.g. from embedded dependencies) // check we don't accidentally including unexpected classes (e.g. from embedded dependencies)
val checkJar by tasks.registering { val checkJar by tasks.registering {
@ -161,7 +162,7 @@ fun testGradleVersion(gradleVersion: String) {
tasks.test.get().let { defaultTest -> tasks.test.get().let { defaultTest ->
classpath = defaultTest.classpath classpath = defaultTest.classpath
} }
systemProperty("gradle.version.for.tests", gradleVersion) systemProperty("compose.tests.gradle.version", gradleVersion)
filter { filter {
includeTestsMatching(gradleTestsPattern) includeTestsMatching(gradleTestsPattern)
} }
@ -177,8 +178,13 @@ tasks.withType<Test>().configureEach {
configureJavaForComposeTest() configureJavaForComposeTest()
dependsOn(":publishToMavenLocal") dependsOn(":publishToMavenLocal")
systemProperty("compose.plugin.version", BuildProperties.deployVersion(project))
systemProperty("kotlin.version", project.property("kotlin.version").toString()) systemProperty("compose.tests.compose.gradle.plugin.version", BuildProperties.deployVersion(project))
for ((k, v) in project.properties) {
if (k.startsWith("compose.")) {
systemProperty(k, v.toString())
}
}
} }
task("printAllAndroidxReplacements") { task("printAllAndroidxReplacements") {

23
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeCompilerKotlinSupportPlugin.kt

@ -5,25 +5,32 @@
package org.jetbrains.compose package org.jetbrains.compose
import org.gradle.api.Project
import org.gradle.api.provider.Provider import org.gradle.api.provider.Provider
import org.jetbrains.compose.internal.ComposeCompilerArtifactProvider
import org.jetbrains.compose.internal.webExt import org.jetbrains.compose.internal.webExt
import org.jetbrains.kotlin.gradle.plugin.* import org.jetbrains.kotlin.gradle.plugin.*
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget
class ComposeCompilerKotlinSupportPlugin : KotlinCompilerPluginSupportPlugin { class ComposeCompilerKotlinSupportPlugin : KotlinCompilerPluginSupportPlugin {
private var composeCompilerArtifactProvider = ComposeCompilerArtifactProvider { null }
override fun apply(target: Project) {
super.apply(target)
target.plugins.withType(ComposePlugin::class.java) {
val composeExt = target.extensions.getByType(ComposeExtension::class.java)
composeCompilerArtifactProvider = ComposeCompilerArtifactProvider { composeExt.kotlinCompilerPlugin.orNull }
}
}
override fun getCompilerPluginId(): String = override fun getCompilerPluginId(): String =
"androidx.compose.compiler.plugins.kotlin" "androidx.compose.compiler.plugins.kotlin"
override fun getPluginArtifactForNative(): SubpluginArtifact =
composeCompilerArtifact("compiler-hosted")
override fun getPluginArtifact(): SubpluginArtifact = override fun getPluginArtifact(): SubpluginArtifact =
composeCompilerArtifact("compiler") composeCompilerArtifactProvider.compilerArtifact
private fun composeCompilerArtifact(artifactId: String) = override fun getPluginArtifactForNative(): SubpluginArtifact =
SubpluginArtifact( composeCompilerArtifactProvider.compilerHostedArtifact
groupId = "org.jetbrains.compose.compiler", artifactId = artifactId, version = ComposeBuildConfig.composeCompilerVersion
)
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean = override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean =
when (kotlinCompilation.target.platformType) { when (kotlinCompilation.target.platformType) {

11
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeExtension.kt

@ -5,6 +5,15 @@
package org.jetbrains.compose package org.jetbrains.compose
import org.gradle.api.model.ObjectFactory
import org.gradle.api.plugins.ExtensionAware import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.provider.Property
import org.jetbrains.compose.desktop.application.internal.nullableProperty
import javax.inject.Inject
abstract class ComposeExtension @Inject constructor(
objects: ObjectFactory
) : ExtensionAware {
val kotlinCompilerPlugin: Property<String?> = objects.nullableProperty()
}
abstract class ComposeExtension : ExtensionAware

66
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/internal/ComposeCompilerArtifactProvider.kt

@ -0,0 +1,66 @@
/*
* Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
package org.jetbrains.compose.internal
import org.jetbrains.compose.ComposeBuildConfig
import org.jetbrains.kotlin.gradle.plugin.SubpluginArtifact
internal class ComposeCompilerArtifactProvider(private val customPluginString: () -> String?) {
val compilerArtifact: SubpluginArtifact
get() {
val customPlugin = customPluginString()
val customCoordinates = customPlugin?.split(":")
return when (customCoordinates?.size) {
null -> DefaultCompiler.pluginArtifact
1 -> {
val customVersion = customCoordinates[0]
check(customVersion.isNotBlank()) { "'compose.kotlinCompilerPlugin' cannot be blank!" }
DefaultCompiler.pluginArtifact.copy(version = customVersion)
}
3 -> DefaultCompiler.pluginArtifact.copy(
groupId = customCoordinates[0],
artifactId = customCoordinates[1],
version = customCoordinates[2]
)
else -> error("""
Illegal format of 'compose.kotlinCompilerPlugin' property.
Expected format: either '<VERSION>' or '<GROUP_ID>:<ARTIFACT_ID>:<VERSION>'
Actual value: '$customPlugin'
""".trimIndent())
}
}
val compilerHostedArtifact: SubpluginArtifact
get() = compilerArtifact.run {
val newArtifactId =
if (groupId == DefaultCompiler.GROUP_ID && artifactId == DefaultCompiler.ARTIFACT_ID) {
DefaultCompiler.HOSTED_ARTIFACT_ID
} else artifactId
copy(artifactId = newArtifactId)
}
internal object DefaultCompiler {
const val GROUP_ID = "org.jetbrains.compose.compiler"
const val ARTIFACT_ID = "compiler"
const val HOSTED_ARTIFACT_ID = "compiler-hosted"
const val VERSION = ComposeBuildConfig.composeCompilerVersion
val pluginArtifact: SubpluginArtifact
get() = SubpluginArtifact(groupId = GROUP_ID, artifactId = ARTIFACT_ID, version = VERSION)
}
}
internal fun SubpluginArtifact.copy(
groupId: String? = null,
artifactId: String? = null,
version: String? = null
): SubpluginArtifact =
SubpluginArtifact(
groupId = groupId ?: this.groupId,
artifactId = artifactId ?: this.artifactId,
version = version ?: this.version
)

11
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt

@ -1,11 +0,0 @@
/*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
package org.jetbrains.compose.test
@Suppress("EnumEntryName")
enum class TestKotlinVersion(val versionString: String) {
Default(TestProperties.defaultKotlinVersion)
}

20
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestProperties.kt

@ -1,20 +0,0 @@
/*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
package org.jetbrains.compose.test
object TestProperties {
val defaultKotlinVersion: String
get() = notNullSystemProperty("kotlin.version")
val composeVersion: String
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")
}

24
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/gradle/DesktopApplicationTest.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/DesktopApplicationTest.kt

@ -1,21 +1,22 @@
/* /*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. * Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose.gradle package org.jetbrains.compose.test.tests.integration
import org.gradle.internal.impldep.org.testng.Assert import org.gradle.internal.impldep.org.testng.Assert
import org.gradle.testkit.runner.TaskOutcome import org.gradle.testkit.runner.TaskOutcome
import org.jetbrains.compose.desktop.application.internal.* import org.jetbrains.compose.desktop.application.internal.*
import org.jetbrains.compose.test.* import org.jetbrains.compose.test.utils.*
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assumptions
import org.junit.jupiter.api.Test
import java.io.File import java.io.File
import java.util.* import java.util.*
import java.util.jar.JarFile import java.util.jar.JarFile
import kotlin.collections.HashSet import kotlin.collections.HashSet
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assumptions
import org.junit.jupiter.api.Test
class DesktopApplicationTest : GradlePluginTestBase() { class DesktopApplicationTest : GradlePluginTestBase() {
@Test @Test
@ -56,6 +57,17 @@ class DesktopApplicationTest : GradlePluginTestBase() {
} }
} }
@Test
fun testAndroidxCompiler() = with(testProject(TestProjects.androidxCompiler, defaultAndroidxCompilerEnvironment)) {
gradle(":runDistributable").build().checks { check ->
val actualMainImage = file("main-image.actual.png")
val expectedMainImage = file("main-image.expected.png")
assert(actualMainImage.readBytes().contentEquals(expectedMainImage.readBytes())) {
"The actual image '$actualMainImage' does not match the expected image '$expectedMainImage'"
}
}
}
@Test @Test
fun kotlinDsl(): Unit = with(testProject(TestProjects.jvmKotlinDsl)) { fun kotlinDsl(): Unit = with(testProject(TestProjects.jvmKotlinDsl)) {
gradle(":package", "--dry-run").build() gradle(":package", "--dry-run").build()

14
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/gradle/GradlePluginTest.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt

@ -1,25 +1,23 @@
/* /*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. * Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose.gradle package org.jetbrains.compose.test.tests.integration
import org.gradle.testkit.runner.TaskOutcome
import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.PreviewLogger import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.PreviewLogger
import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.RemoteConnection import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.RemoteConnection
import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.receiveConfigFromGradle import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.receiveConfigFromGradle
import org.jetbrains.compose.test.GradlePluginTestBase import org.jetbrains.compose.test.utils.*
import org.jetbrains.compose.test.TestKotlinVersion
import org.jetbrains.compose.test.TestProjects
import org.jetbrains.compose.test.checks
import org.junit.jupiter.api.Test
import java.net.ServerSocket import java.net.ServerSocket
import java.net.Socket import java.net.Socket
import java.net.SocketTimeoutException import java.net.SocketTimeoutException
import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
import kotlin.concurrent.thread import kotlin.concurrent.thread
import org.gradle.testkit.runner.TaskOutcome
import org.junit.jupiter.api.Test
class GradlePluginTest : GradlePluginTestBase() { class GradlePluginTest : GradlePluginTestBase() {
@Test @Test

107
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/unit/ComposeCompilerArtifactProviderTest.kt

@ -0,0 +1,107 @@
/*
* Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
package org.jetbrains.compose.test.tests.unit
import org.jetbrains.compose.internal.ComposeCompilerArtifactProvider
import org.jetbrains.compose.internal.copy
import org.jetbrains.compose.test.utils.TestProperties
import org.jetbrains.kotlin.gradle.plugin.SubpluginArtifact
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.*
internal class ComposeCompilerArtifactProviderTest {
@Test
fun defaultCompilerArtifact() {
assertArtifactEquals(
Expected.jbCompiler,
Actual.compiler(null)
)
}
@Test
fun defaultCompilerHostedArtifact() {
assertArtifactEquals(
Expected.jbCompilerHosted,
Actual.compilerHosted(null)
)
}
@Test
fun customVersion() {
assertArtifactEquals(
Expected.jbCompiler.copy(version = "10.20.30"),
Actual.compiler("10.20.30")
)
}
@Test
fun customCompiler() {
assertArtifactEquals(
Expected.googleCompiler.copy(version = "1.3.1"),
Actual.compiler("androidx.compose.compiler:compiler:1.3.1")
)
}
@Test
fun customCompilerHosted() {
// check that we don't replace artifactId for non-jb compiler
assertArtifactEquals(
Expected.googleCompiler.copy(version = "1.3.1"),
Actual.compilerHosted("androidx.compose.compiler:compiler:1.3.1")
)
}
@Test
fun illegalCompiler() {
testIllegalCompiler("androidx.compose.compiler:compiler")
testIllegalCompiler("a:b:c:d")
testIllegalCompiler("")
}
private fun testIllegalCompiler(pluginString: String?) {
try {
Actual.compiler(pluginString)
} catch (e: Exception) {
return
}
error("Expected error, but illegal value was accepted: '$pluginString'")
}
object Actual {
fun compiler(pluginString: String?) =
ComposeCompilerArtifactProvider { pluginString }.compilerArtifact
fun compilerHosted(pluginString: String?) =
ComposeCompilerArtifactProvider { pluginString }.compilerHostedArtifact
}
object Expected {
val jbCompiler: SubpluginArtifact
get() = SubpluginArtifact(
groupId = "org.jetbrains.compose.compiler",
artifactId = "compiler",
version = TestProperties.composeCompilerVersion
)
val jbCompilerHosted: SubpluginArtifact
get() = jbCompiler.copy(artifactId = "compiler-hosted")
val googleCompiler: SubpluginArtifact
get() = jbCompiler.copy(groupId = "androidx.compose.compiler")
}
private fun assertArtifactEquals(
expected: SubpluginArtifact,
actual: SubpluginArtifact
) {
assertEquals(expected.asString(), actual.asString())
}
private fun SubpluginArtifact.asString(): String =
"SubpluginArtifact(groupId = '$groupId', artifactId = '$artifactId', version = '$version')"
}

9
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/FileHashTest.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/unit/FileHashTest.kt

@ -1,14 +1,15 @@
/* /*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. * Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose package org.jetbrains.compose.test.tests.unit
import org.gradle.internal.impldep.org.testng.Assert
import org.jetbrains.compose.desktop.application.internal.OS import org.jetbrains.compose.desktop.application.internal.OS
import org.jetbrains.compose.desktop.application.internal.currentOS import org.jetbrains.compose.desktop.application.internal.currentOS
import org.jetbrains.compose.desktop.application.internal.files.contentHash import org.jetbrains.compose.desktop.application.internal.files.contentHash
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
import org.junit.jupiter.api.io.TempDir import org.junit.jupiter.api.io.TempDir
import java.io.File import java.io.File
@ -40,7 +41,7 @@ class FileHashTest {
val initHash = initJar.contentHash() val initHash = initJar.contentHash()
val modifiedHash = modifiedJar.contentHash() val modifiedHash = modifiedJar.contentHash()
Assert.assertNotEquals(modifiedHash, initHash) assertNotEquals(modifiedHash, initHash)
} }
private fun createJar(outputFileName: String, vararg files: File): File { private fun createJar(outputFileName: String, vararg files: File): File {

10
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/GradlePluginTestBase.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/GradlePluginTestBase.kt

@ -1,9 +1,9 @@
/* /*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. * Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose.test package org.jetbrains.compose.test.utils
import org.junit.jupiter.api.io.TempDir import org.junit.jupiter.api.io.TempDir
import java.io.File import java.io.File
@ -15,6 +15,12 @@ abstract class GradlePluginTestBase {
val defaultTestEnvironment: TestEnvironment val defaultTestEnvironment: TestEnvironment
get() = TestEnvironment(workingDir = testWorkDir) get() = TestEnvironment(workingDir = testWorkDir)
val defaultAndroidxCompilerEnvironment: TestEnvironment
get() = defaultTestEnvironment.copy(
kotlinVersion = TestKotlinVersion.AndroidxCompatible,
composeCompilerArtifact = "androidx.compose.compiler:compiler:${TestProperties.androidxCompilerVersion}"
)
fun testProject( fun testProject(
name: String, name: String,
testEnvironment: TestEnvironment = defaultTestEnvironment testEnvironment: TestEnvironment = defaultTestEnvironment

2
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/GradleTestNameGenerator.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/GradleTestNameGenerator.kt

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose.test package org.jetbrains.compose.test.utils
import org.junit.jupiter.api.DisplayNameGenerator import org.junit.jupiter.api.DisplayNameGenerator

12
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestKotlinVersion.kt

@ -0,0 +1,12 @@
/*
* Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
package org.jetbrains.compose.test.utils
@Suppress("EnumEntryName")
enum class TestKotlinVersion(val versionString: String) {
Default(TestProperties.composeCompilerCompatibleKotlinVersion),
AndroidxCompatible(TestProperties.androidxCompilerCompatibleKotlinVersion)
}

14
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestProject.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProject.kt

@ -1,9 +1,9 @@
/* /*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. * Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose.test package org.jetbrains.compose.test.utils
import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.GradleRunner
import org.jetbrains.compose.desktop.application.internal.ComposeProperties import org.jetbrains.compose.desktop.application.internal.ComposeProperties
@ -12,7 +12,8 @@ import java.io.File
data class TestEnvironment( data class TestEnvironment(
val workingDir: File, val workingDir: File,
val kotlinVersion: TestKotlinVersion = TestKotlinVersion.Default, val kotlinVersion: TestKotlinVersion = TestKotlinVersion.Default,
val composeVersion: String = TestProperties.composeVersion val composeGradlePluginVersion: String = TestProperties.composeGradlePluginVersion,
val composeCompilerArtifact: String? = null
) )
class TestProject( class TestProject(
@ -38,9 +39,12 @@ class TestProject(
if (orig.name.endsWith(".gradle") || orig.name.endsWith(".gradle.kts")) { if (orig.name.endsWith(".gradle") || orig.name.endsWith(".gradle.kts")) {
val origContent = orig.readText() val origContent = orig.readText()
val newContent = origContent var newContent = origContent
.replace("COMPOSE_VERSION_PLACEHOLDER", testEnvironment.composeVersion) .replace("COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER", testEnvironment.composeGradlePluginVersion)
.replace("KOTLIN_VERSION_PLACEHOLDER", testEnvironment.kotlinVersion.versionString) .replace("KOTLIN_VERSION_PLACEHOLDER", testEnvironment.kotlinVersion.versionString)
if (testEnvironment.composeCompilerArtifact != null) {
newContent = newContent.replace("COMPOSE_COMPILER_ARTIFACT_PLACEHOLDER", testEnvironment.composeCompilerArtifact)
}
target.writeText(newContent) target.writeText(newContent)
} else { } else {
orig.copyTo(target) orig.copyTo(target)

5
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestProjects.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProjects.kt

@ -1,14 +1,15 @@
/* /*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. * Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose.test package org.jetbrains.compose.test.utils
object TestProjects { object TestProjects {
const val jvm = "application/jvm" const val jvm = "application/jvm"
const val mpp = "application/mpp" const val mpp = "application/mpp"
const val proguard = "application/proguard" const val proguard = "application/proguard"
const val androidxCompiler = "application/androidx-compiler"
const val jvmKotlinDsl = "application/jvmKotlinDsl" const val jvmKotlinDsl = "application/jvmKotlinDsl"
const val moduleClashCli = "application/moduleClashCli" const val moduleClashCli = "application/moduleClashCli"
const val javaLogger = "application/javaLogger" const val javaLogger = "application/javaLogger"

29
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProperties.kt

@ -0,0 +1,29 @@
/*
* Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
package org.jetbrains.compose.test.utils
object TestProperties {
val composeCompilerVersion: String
get() = notNullSystemProperty("compose.compiler.version")
val composeCompilerCompatibleKotlinVersion: String
get() = notNullSystemProperty("compose.compiler.compatible.kotlin.version")
val androidxCompilerVersion: String
get() = notNullSystemProperty("compose.tests.androidx.compiler.version")
val androidxCompilerCompatibleKotlinVersion: String
get() = notNullSystemProperty("compose.tests.androidx.compiler.compatible.kotlin.version")
val composeGradlePluginVersion: String
get() = notNullSystemProperty("compose.tests.compose.gradle.plugin.version")
val gradleVersionForTests: String?
get() = System.getProperty("compose.tests.gradle.version")
private fun notNullSystemProperty(property: String): String =
System.getProperty(property) ?: error("The '$property' system property is not set")
}

6
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/assertUtils.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/assertUtils.kt

@ -1,16 +1,14 @@
/* /*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. * Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose.test package org.jetbrains.compose.test.utils
import org.gradle.internal.impldep.junit.framework.Assert
import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.TaskOutcome import org.gradle.testkit.runner.TaskOutcome
import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Assertions
import java.io.File import java.io.File
import kotlin.math.exp
internal fun <T> Collection<T>.checkContains(vararg elements: T) { internal fun <T> Collection<T>.checkContains(vararg elements: T) {
val expectedElements = elements.toMutableSet() val expectedElements = elements.toMutableSet()

2
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/fileUtils.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/fileUtils.kt

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose.test package org.jetbrains.compose.test.utils
import java.io.File import java.io.File

2
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/processUtils.kt → gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/processUtils.kt

@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/ */
package org.jetbrains.compose.test package org.jetbrains.compose.test.utils
import java.io.File import java.io.File

2
gradle-plugins/compose/src/test/resources/junit-platform.properties

@ -1 +1 @@
junit.jupiter.displayname.generator.default=org.jetbrains.compose.test.GradleTestNameGenerator junit.jupiter.displayname.generator.default=org.jetbrains.compose.test.utils.GradleTestNameGenerator

31
gradle-plugins/compose/src/test/test-projects/application/androidx-compiler/build.gradle

@ -0,0 +1,31 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.compose"
}
repositories {
google()
jetbrainsCompose()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation compose.desktop.currentOs
}
compose {
kotlinCompilerPlugin.set("COMPOSE_COMPILER_ARTIFACT_PLACEHOLDER")
desktop {
application {
mainClass = "Main"
args(project.projectDir.absolutePath)
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
}
args(project.projectDir.absolutePath)
}
}
}

BIN
gradle-plugins/compose/src/test/test-projects/application/androidx-compiler/main-image.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

11
gradle-plugins/compose/src/test/test-projects/application/androidx-compiler/settings.gradle

@ -0,0 +1,11 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {
mavenLocal()
gradlePluginPortal()
}
}
rootProject.name = "simple"

76
gradle-plugins/compose/src/test/test-projects/application/androidx-compiler/src/main/kotlin/Main.kt

@ -0,0 +1,76 @@
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.GenericShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.renderComposeScene
import org.jetbrains.skia.EncodedImageFormat
import java.io.File
import java.util.*
object Main {
@JvmStatic
@OptIn(ExperimentalComposeUiApi::class)
fun main(args: Array<String>) {
val workingDir = args.getOrNull(0)?.let { File(it) }
workingDir?.mkdirs()
if (workingDir == null || !workingDir.isDirectory) {
error("Working directory must be passes as the first argument. '$workingDir' is not a directory")
}
val image = renderComposeScene(height = 10, width = 10) {
mainShape()
}
val encodedImage = image.encodeToData(EncodedImageFormat.PNG) ?: error("Could not encode image as png")
workingDir.resolve("main-image.actual.png").writeBytes(encodedImage.bytes)
val mainMethods = this.javaClass.declaredMethods
.mapTo(TreeSet()) { it.name }
.joinToString("\n")
workingDir.resolve("main-methods.actual.txt").writeText(mainMethods)
}
@Composable
fun mainShape() {
triangle(Color.Magenta)
}
@Composable
fun unused() {
transitivelyUnused()
}
@Composable
fun transitivelyUnused() {
triangle(Color.Gray)
}
@Composable
fun keptByKeepRule() {
fillShape(Color.Blue, CircleShape)
}
}
@Composable
fun triangle(color: Color) {
fillShape(color, GenericShape { size, _ ->
moveTo(size.width / 2f, 0f)
lineTo(size.width, size.height)
lineTo(0f, size.height)
})
}
@Composable
fun fillShape(color: Color, shape: Shape){
Column(modifier = Modifier.fillMaxWidth().wrapContentSize(Alignment.Center)) {
Box(
modifier = Modifier.clip(shape).fillMaxSize().background(color)
)
}
}

2
gradle-plugins/compose/src/test/test-projects/application/defaultArgs/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/defaultArgsOverride/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/javaLogger/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/jvm/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/jvmKotlinDsl/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/macOptions/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/macSign/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/moduleClashCli/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/mpp/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/optionsWithSpaces/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/proguard/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/resources/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/application/unpackSkiko/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/misc/jsMpp/settings.gradle

@ -1,7 +1,7 @@
pluginManagement { pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

2
gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/settings.gradle

@ -2,7 +2,7 @@ pluginManagement {
plugins { plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER' id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_VERSION_PLACEHOLDER' id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
} }
repositories { repositories {
mavenLocal() mavenLocal()

21
gradle-plugins/gradle.properties

@ -1,25 +1,16 @@
org.gradle.parallel=true org.gradle.parallel=true
kotlin.code.style=official kotlin.code.style=official
# A version of Compose libraries,
# that will be used by published Gradle plugin,
# unless overridden by COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION env var.
#
# __LATEST_COMPOSE_RELEASE_VERSION__ # __LATEST_COMPOSE_RELEASE_VERSION__
# Default version of Compose Libraries used by Gradle plugin
compose.version=1.2.0-alpha01-dev774 compose.version=1.2.0-alpha01-dev774
# Default version of Compose Compiler used by Gradle plugin
compose.compiler.version=1.3.0-alpha01 compose.compiler.version=1.3.0-alpha01
# Default version of Kotlin compatible with compose.compiler.version
# See the corresponding version here: https://developer.android.com/jetpack/androidx/releases/compose-kotlin
# (note, that for the 'org.jetbrains.compose` build we usualy keep only Major and Minor versions the same)
# This is only used on CI for now.
compose.compiler.compatible.kotlin.version=1.7.10 compose.compiler.compatible.kotlin.version=1.7.10
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin
# A version of Kotlin expected by __LATEST_COMPOSE_RELEASE_VERSION__ compose.tests.androidx.compiler.version=1.3.1
# This Kotlin version should be used in test or for checking plugin's compatibility, compose.tests.androidx.compiler.compatible.kotlin.version=1.7.10
# not for building the Gradle plugin itself!
# __KOTLIN_COMPOSE_VERSION__
kotlin.version=1.7.10
# A version of Gradle plugin, that will be published, # A version of Gradle plugin, that will be published,
# unless overridden by COMPOSE_GRADLE_PLUGIN_VERSION env var. # unless overridden by COMPOSE_GRADLE_PLUGIN_VERSION env var.

Loading…
Cancel
Save