Browse Source

Use another version of Compose Compiler inside Compose Gradle plugin (#2256)

* Use another version of Compose Compiler inside Compose Gradle plugin

* Update gradle.properties
pull/2259/head
Igor Demin 2 years ago committed by GitHub
parent
commit
33237b662e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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. 7
      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 =

7
gradle-plugins/gradle.properties

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