Browse Source

Support OEL publication in gradle plugin (#1285)

* switching to oel compose branch

* Implementation of OEL publishing

* Changed based on Code Review

* Revert `support` folder

Co-authored-by: Igor Demin <igordmn@gmail.com>
pull/1287/head
akurasov 3 years ago committed by GitHub
parent
commit
05d218b718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      gradle-plugins/buildSrc/src/main/kotlin/BuildProperties.kt
  2. 2
      gradle-plugins/compose/build.gradle.kts
  3. 2
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt

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

@ -19,4 +19,8 @@ object BuildProperties {
?: project.findProperty("deploy.version") as String ?: project.findProperty("deploy.version") as String
fun isComposeWithWeb(project: Project): Boolean = fun isComposeWithWeb(project: Project): Boolean =
project.findProperty("compose.with.web") == "true" project.findProperty("compose.with.web") == "true"
fun experimentalOELPublication(project: Project): Boolean =
project.findProperty("oel.publication") == "true"
fun oelAndroidXVersion(project: Project): String? =
project.findProperty("oel.androidx.version") as String?
} }

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

@ -28,6 +28,8 @@ val buildConfig = tasks.register("buildConfig", GenerateBuildConfig::class.java)
generatedOutputDir.set(buildConfigDir) generatedOutputDir.set(buildConfigDir)
fieldsToGenerate.put("composeVersion", BuildProperties.composeVersion(project)) fieldsToGenerate.put("composeVersion", BuildProperties.composeVersion(project))
fieldsToGenerate.put("isComposeWithWeb", BuildProperties.isComposeWithWeb(project)) fieldsToGenerate.put("isComposeWithWeb", BuildProperties.isComposeWithWeb(project))
fieldsToGenerate.put("experimentalOELPublication", BuildProperties.experimentalOELPublication(project))
fieldsToGenerate.put("oelAndroidXVersion", BuildProperties.oelAndroidXVersion(project).orEmpty())
} }
tasks.named("compileKotlin") { tasks.named("compileKotlin") {
dependsOn(buildConfig) dependsOn(buildConfig)

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

@ -71,7 +71,7 @@ class ComposePlugin : Plugin<Project> {
//redirecting all android artifacts to androidx.compose //redirecting all android artifacts to androidx.compose
project.dependencies.modules { project.dependencies.modules {
if (!androidExtension.useAndroidX) { if (!androidExtension.useAndroidX && !ComposeBuildConfig.experimentalOELPublication) {
// Replace 'androidx.compose' artifacts by 'org.jetbrains.compose' artifacts. // Replace 'androidx.compose' artifacts by 'org.jetbrains.compose' artifacts.
// It is needed, because 'org.jetbrains.compose' artifacts are the same artifacts as 'androidx.compose' // It is needed, because 'org.jetbrains.compose' artifacts are the same artifacts as 'androidx.compose'
// (but with different version). // (but with different version).

Loading…
Cancel
Save