mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
Additional CI fixes (#1696)
* Fix components script compilation * Add script to run Gradle with Compose properties set up It's useful for running a single task in the included Compose build. * Set default JVM target to 11 if it is lower * Update Compose submodule
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
plugins {
|
||||
kotlin("multiplatform") apply false
|
||||
}
|
||||
|
||||
subprojects {
|
||||
version = findProperty("deploy.version") ?: property("compose.version")!!
|
||||
|
||||
|
||||
Submodule compose/frameworks/support updated: fe220467ab...3ebf1d4460
8
compose/scripts/runGradle
Executable file
8
compose/scripts/runGradle
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
. ./prepare
|
||||
|
||||
pushd ..
|
||||
./gradlew $COMPOSE_DEFAULT_GRADLE_ARGS "$@" || exit 1
|
||||
popd
|
||||
@@ -19,6 +19,7 @@ import org.gradle.api.artifacts.repositories.MavenArtifactRepository
|
||||
import org.gradle.api.plugins.ExtensionAware
|
||||
import org.jetbrains.compose.android.AndroidExtension
|
||||
import org.jetbrains.compose.desktop.DesktopExtension
|
||||
import org.jetbrains.compose.desktop.application.internal.ComposeProperties
|
||||
import org.jetbrains.compose.desktop.application.internal.configureApplicationImpl
|
||||
import org.jetbrains.compose.desktop.application.internal.currentTarget
|
||||
import org.jetbrains.compose.desktop.preview.internal.initializePreview
|
||||
@@ -58,7 +59,7 @@ class ComposePlugin : Plugin<Project> {
|
||||
project.configureExperimental(composeExtension, experimentalExtension)
|
||||
|
||||
if (androidExtension.useAndroidX) {
|
||||
println("useAndroidX is an experimental feature at the moment!")
|
||||
project.logger.warn("useAndroidX is an experimental feature at the moment!")
|
||||
RedirectAndroidVariants.androidxVersion = androidExtension.androidxVersion
|
||||
listOf(
|
||||
RedirectAndroidVariants::class.java,
|
||||
@@ -125,12 +126,14 @@ class ComposePlugin : Plugin<Project> {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
project.tasks.withType(KotlinCompile::class.java) {
|
||||
it.kotlinOptions.apply {
|
||||
jvmTarget = "1.8".takeIf { jvmTarget.toDouble() < 1.8 } ?: jvmTarget
|
||||
useIR = true
|
||||
val overrideDefaultJvmTarget = ComposeProperties.overrideKotlinJvmTarget(project.providers).get()
|
||||
project.tasks.withType(KotlinCompile::class.java) {
|
||||
it.kotlinOptions.apply {
|
||||
if (overrideDefaultJvmTarget) {
|
||||
jvmTarget = "11".takeIf { jvmTarget.toDouble() < 11 } ?: jvmTarget
|
||||
}
|
||||
useIR = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.gradle.api.provider.ProviderFactory
|
||||
|
||||
internal object ComposeProperties {
|
||||
internal const val VERBOSE = "compose.desktop.verbose"
|
||||
internal const val OVERRIDE_KOTLIN_JVM_TARGET = "compose.desktop.override.default.kotlin.jvm.target"
|
||||
internal const val PRESERVE_WD = "compose.preserve.working.dir"
|
||||
internal const val MAC_SIGN = "compose.desktop.mac.sign"
|
||||
internal const val MAC_SIGN_ID = "compose.desktop.mac.signing.identity"
|
||||
@@ -22,6 +23,11 @@ internal object ComposeProperties {
|
||||
fun isVerbose(providers: ProviderFactory): Provider<Boolean> =
|
||||
providers.findProperty(VERBOSE).toBoolean()
|
||||
|
||||
fun overrideKotlinJvmTarget(providers: ProviderFactory): Provider<Boolean> =
|
||||
providers.provider {
|
||||
providers.findProperty(OVERRIDE_KOTLIN_JVM_TARGET)?.toString() != "false"
|
||||
}
|
||||
|
||||
fun preserveWorkingDir(providers: ProviderFactory): Provider<Boolean> =
|
||||
providers.findProperty(PRESERVE_WD).toBoolean()
|
||||
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
def jvmTargetForKotlinCompile(Project project, String jvmTarget) {
|
||||
project.tasks.all {
|
||||
// tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) fails for init scripts
|
||||
if (it.class.name == "org.jetbrains.kotlin.gradle.tasks.KotlinCompile_Decorated") {
|
||||
kotlinOptions.jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
@@ -16,19 +7,4 @@ allprojects {
|
||||
}
|
||||
google()
|
||||
}
|
||||
|
||||
plugins.withId("java-base") {
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
|
||||
plugins.withId("org.jetbrains.kotlin.jvm") {
|
||||
jvmTargetForKotlinCompile(project, "11")
|
||||
}
|
||||
|
||||
plugins.withId("org.jetbrains.kotlin.multiplatform") {
|
||||
jvmTargetForKotlinCompile(project, "11")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user