Browse Source

Use another version of Compose Compiler inside Compose Gradle plugin

sync-androidx/1.2.1
Igor Demin 2 years ago
parent
commit
dbbbfa8df4
  1. 3
      compose/build.gradle.kts
  2. 1
      gradle-plugins/buildSrc/src/main/kotlin/BuildProperties.kt
  3. 1
      gradle-plugins/compose/build.gradle.kts
  4. 2
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeCompilerKotlinSupportPlugin.kt
  5. 3
      gradle-plugins/gradle.properties

3
compose/build.gradle.kts

@ -49,9 +49,6 @@ val iconsComponents =
)
fun ComposePublishingTask.mainPublications() {
publish(":compose:compiler:compiler", publications = listOf("Maven"))
publish(":compose:compiler:compiler-hosted", publications = listOf("Maven"))
publish(
":compose:desktop:desktop",
onlyWithPlatforms = setOf(ComposePlatforms.Desktop),

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

@ -15,6 +15,7 @@ object BuildProperties {
fun composeVersion(project: Project): String =
System.getenv("COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION")
?: project.findProperty("compose.version") as String
fun composeCompilerVersion(project: Project): String = project.findProperty("compose.compiler.version") as String
fun deployVersion(project: Project): String =
System.getenv("COMPOSE_GRADLE_PLUGIN_VERSION")
?: project.findProperty("deploy.version") as String

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

@ -29,6 +29,7 @@ val buildConfig = tasks.register("buildConfig", GenerateBuildConfig::class.java)
classFqName.set("org.jetbrains.compose.ComposeBuildConfig")
generatedOutputDir.set(buildConfigDir)
fieldsToGenerate.put("composeVersion", BuildProperties.composeVersion(project))
fieldsToGenerate.put("composeCompilerVersion", BuildProperties.composeCompilerVersion(project))
fieldsToGenerate.put("composeGradlePluginVersion", BuildProperties.deployVersion(project))
fieldsToGenerate.put("experimentalOELPublication", BuildProperties.experimentalOELPublication(project))
fieldsToGenerate.put("oelAndroidXVersion", BuildProperties.oelAndroidXVersion(project).orEmpty())

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

@ -22,7 +22,7 @@ class ComposeCompilerKotlinSupportPlugin : KotlinCompilerPluginSupportPlugin {
private fun composeCompilerArtifact(artifactId: String) =
SubpluginArtifact(
groupId = "org.jetbrains.compose.compiler", artifactId = artifactId, version = composeVersion
groupId = "org.jetbrains.compose.compiler", artifactId = artifactId, version = ComposeBuildConfig.composeCompilerVersion
)
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean =

3
gradle-plugins/gradle.properties

@ -8,6 +8,9 @@ kotlin.code.style=official
# __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=0.0.0-master-dev673
compose.compiler.version=1.3.0-alpha01
compose.compiler.compatible.kotlin.version=1.7.10
# 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!

Loading…
Cancel
Save