diff --git a/examples/chat/gradle.properties b/examples/chat/gradle.properties index 0c5787e969..8390fbc487 100644 --- a/examples/chat/gradle.properties +++ b/examples/chat/gradle.properties @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true -kotlin.native.cacheKind=none kotlin.native.useEmbeddableCompilerJar=true kotlin.mpp.androidSourceSetLayoutVersion=2 # Enable kotlin/native experimental memory model kotlin.native.binary.memoryModel=experimental kotlin.version=1.9.0 agp.version=7.1.3 -compose.version=1.4.3 +compose.version=1.5.0-beta02 diff --git a/examples/chat/shared/build.gradle.kts b/examples/chat/shared/build.gradle.kts index 9d553b73b5..f1bab781b9 100644 --- a/examples/chat/shared/build.gradle.kts +++ b/examples/chat/shared/build.gradle.kts @@ -45,7 +45,6 @@ kotlin { baseName = "shared" isStatic = true } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } sourceSets { diff --git a/examples/codeviewer/gradle.properties b/examples/codeviewer/gradle.properties index 0c5787e969..8390fbc487 100644 --- a/examples/codeviewer/gradle.properties +++ b/examples/codeviewer/gradle.properties @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true -kotlin.native.cacheKind=none kotlin.native.useEmbeddableCompilerJar=true kotlin.mpp.androidSourceSetLayoutVersion=2 # Enable kotlin/native experimental memory model kotlin.native.binary.memoryModel=experimental kotlin.version=1.9.0 agp.version=7.1.3 -compose.version=1.4.3 +compose.version=1.5.0-beta02 diff --git a/examples/codeviewer/shared/build.gradle.kts b/examples/codeviewer/shared/build.gradle.kts index d08dcbaef2..526c6f61b2 100644 --- a/examples/codeviewer/shared/build.gradle.kts +++ b/examples/codeviewer/shared/build.gradle.kts @@ -26,7 +26,6 @@ kotlin { baseName = "shared" isStatic = true } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } sourceSets { diff --git a/examples/falling-balls/gradle.properties b/examples/falling-balls/gradle.properties index 0c5787e969..8390fbc487 100644 --- a/examples/falling-balls/gradle.properties +++ b/examples/falling-balls/gradle.properties @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true -kotlin.native.cacheKind=none kotlin.native.useEmbeddableCompilerJar=true kotlin.mpp.androidSourceSetLayoutVersion=2 # Enable kotlin/native experimental memory model kotlin.native.binary.memoryModel=experimental kotlin.version=1.9.0 agp.version=7.1.3 -compose.version=1.4.3 +compose.version=1.5.0-beta02 diff --git a/examples/falling-balls/shared/build.gradle.kts b/examples/falling-balls/shared/build.gradle.kts index 11a8ee8560..8716294172 100644 --- a/examples/falling-balls/shared/build.gradle.kts +++ b/examples/falling-balls/shared/build.gradle.kts @@ -45,7 +45,6 @@ kotlin { baseName = "shared" isStatic = true } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } sourceSets { diff --git a/examples/imageviewer/gradle.properties b/examples/imageviewer/gradle.properties index ae8c087e06..efa38e2e33 100644 --- a/examples/imageviewer/gradle.properties +++ b/examples/imageviewer/gradle.properties @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true -kotlin.native.cacheKind=none kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.native.useEmbeddableCompilerJar=true # Enable kotlin/native experimental memory model kotlin.native.binary.memoryModel=experimental kotlin.version=1.9.0 agp.version=7.1.3 -compose.version=1.5.0-dev1114 +compose.version=1.5.0-beta02 diff --git a/examples/imageviewer/shared/build.gradle.kts b/examples/imageviewer/shared/build.gradle.kts index 49db30760d..5a3e685b83 100755 --- a/examples/imageviewer/shared/build.gradle.kts +++ b/examples/imageviewer/shared/build.gradle.kts @@ -26,8 +26,6 @@ kotlin { baseName = "shared" isStatic = true } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" - } sourceSets { diff --git a/examples/minesweeper/gradle.properties b/examples/minesweeper/gradle.properties index 0c5787e969..8390fbc487 100644 --- a/examples/minesweeper/gradle.properties +++ b/examples/minesweeper/gradle.properties @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true -kotlin.native.cacheKind=none kotlin.native.useEmbeddableCompilerJar=true kotlin.mpp.androidSourceSetLayoutVersion=2 # Enable kotlin/native experimental memory model kotlin.native.binary.memoryModel=experimental kotlin.version=1.9.0 agp.version=7.1.3 -compose.version=1.4.3 +compose.version=1.5.0-beta02 diff --git a/examples/minesweeper/shared/build.gradle.kts b/examples/minesweeper/shared/build.gradle.kts index 1c97c2dd07..430c4f31f7 100644 --- a/examples/minesweeper/shared/build.gradle.kts +++ b/examples/minesweeper/shared/build.gradle.kts @@ -15,16 +15,7 @@ kotlin { jvm("desktop") ios() - iosSimulatorArm64() { - // TODO: remove after 1.5 release - binaries.forEach { - it.freeCompilerArgs += listOf( - "-linker-option", "-framework", "-linker-option", "Metal", - "-linker-option", "-framework", "-linker-option", "CoreText", - "-linker-option", "-framework", "-linker-option", "CoreGraphics", - ) - } - } + iosSimulatorArm64() js(IR) { browser() @@ -54,7 +45,6 @@ kotlin { baseName = "shared" isStatic = true } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } sourceSets { diff --git a/examples/todoapp-lite/gradle.properties b/examples/todoapp-lite/gradle.properties index 0c5787e969..8390fbc487 100755 --- a/examples/todoapp-lite/gradle.properties +++ b/examples/todoapp-lite/gradle.properties @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true -kotlin.native.cacheKind=none kotlin.native.useEmbeddableCompilerJar=true kotlin.mpp.androidSourceSetLayoutVersion=2 # Enable kotlin/native experimental memory model kotlin.native.binary.memoryModel=experimental kotlin.version=1.9.0 agp.version=7.1.3 -compose.version=1.4.3 +compose.version=1.5.0-beta02 diff --git a/examples/todoapp-lite/shared/build.gradle.kts b/examples/todoapp-lite/shared/build.gradle.kts index fff63d294b..c2e8dde553 100755 --- a/examples/todoapp-lite/shared/build.gradle.kts +++ b/examples/todoapp-lite/shared/build.gradle.kts @@ -26,7 +26,6 @@ kotlin { baseName = "shared" isStatic = true } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } sourceSets { diff --git a/examples/visual-effects/gradle.properties b/examples/visual-effects/gradle.properties index 125fb44055..5b9eda536a 100644 --- a/examples/visual-effects/gradle.properties +++ b/examples/visual-effects/gradle.properties @@ -7,10 +7,9 @@ org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true kotlin.mpp.androidSourceSetLayoutVersion=2 -kotlin.native.cacheKind=none kotlin.native.useEmbeddableCompilerJar=true # Enable kotlin/native experimental memory model kotlin.native.binary.memoryModel=experimental kotlin.version=1.9.0 agp.version=7.1.3 -compose.version=1.4.3 +compose.version=1.5.0-beta02 diff --git a/examples/visual-effects/shared/build.gradle.kts b/examples/visual-effects/shared/build.gradle.kts index de48622f63..04eec1a4e9 100644 --- a/examples/visual-effects/shared/build.gradle.kts +++ b/examples/visual-effects/shared/build.gradle.kts @@ -24,7 +24,6 @@ kotlin { baseName = "shared" isStatic = true } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } sourceSets { diff --git a/examples/widgets-gallery/gradle.properties b/examples/widgets-gallery/gradle.properties index 0c5787e969..8390fbc487 100644 --- a/examples/widgets-gallery/gradle.properties +++ b/examples/widgets-gallery/gradle.properties @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true -kotlin.native.cacheKind=none kotlin.native.useEmbeddableCompilerJar=true kotlin.mpp.androidSourceSetLayoutVersion=2 # Enable kotlin/native experimental memory model kotlin.native.binary.memoryModel=experimental kotlin.version=1.9.0 agp.version=7.1.3 -compose.version=1.4.3 +compose.version=1.5.0-beta02 diff --git a/examples/widgets-gallery/shared/build.gradle.kts b/examples/widgets-gallery/shared/build.gradle.kts index 1179c0907e..85ddf1493c 100644 --- a/examples/widgets-gallery/shared/build.gradle.kts +++ b/examples/widgets-gallery/shared/build.gradle.kts @@ -26,7 +26,6 @@ kotlin { baseName = "shared" isStatic = true } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } sourceSets { diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/internal/configureNativeCompilerCaching.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/internal/configureNativeCompilerCaching.kt index 55e3a440a0..7537f89bff 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/internal/configureNativeCompilerCaching.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/internal/configureNativeCompilerCaching.kt @@ -46,9 +46,7 @@ private fun KotlinNativeTarget.checkCacheKindUserValueIsNotNone() { val value = provider.valueOrNull(cacheKindProperty) if (value != null) { if (value.equals(NONE_VALUE, ignoreCase = true)) { - ComposeMultiplatformBuildService - .getInstance(project) - .warnOnceAfterBuild(cacheKindPropertyWarningMessage(cacheKindProperty, provider)) + error(cacheKindPropertyWarningMessage(cacheKindProperty, provider)) } return } @@ -60,13 +58,13 @@ private fun cacheKindPropertyWarningMessage( cacheKindProperty: String, provider: KGPPropertyProvider ) = """ - |Warning: '$cacheKindProperty' is explicitly set to `none`. + |'$cacheKindProperty' is explicitly set to `none`. |This option significantly slows the Kotlin/Native compiler. |Compose Multiplatform Gradle plugin can set this property automatically, |when it is necessary. | * Recommended action: remove explicit '$cacheKindProperty=$NONE_VALUE' from ${provider.location}. | * Alternative action: if you are sure you need '$cacheKindProperty=$NONE_VALUE', disable - |this warning by adding '$COMPOSE_NATIVE_MANAGE_CACHE_KIND=false' to your 'gradle.properties'. + |this error by adding '$COMPOSE_NATIVE_MANAGE_CACHE_KIND=false' to your 'gradle.properties'. """.trimMargin() private fun KotlinNativeTarget.configureTargetCompilerCache(kotlinVersion: KotlinVersion) { diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/resources/configureSyncIosResources.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/resources/configureSyncIosResources.kt index e640f8e9ba..ae0a430a08 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/resources/configureSyncIosResources.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/resources/configureSyncIosResources.kt @@ -92,7 +92,11 @@ private fun SyncIosResourcesContext.configureCocoapodsResourcesAttribute() { val specAttributes = cocoapodsExt.extraSpecAttributes val resourcesSpec = specAttributes[RESOURCES_SPEC_ATTR] if (!resourcesSpec.isNullOrBlank()) { - project.logger.warn("Warning: kotlin.cocoapods.extraSpecAttributes[\"resources\"] is ignored by Compose Multiplatform's resource synchronization for iOS") + error(""" + |Kotlin.cocoapods.extraSpecAttributes["resources"] is not compatible with Compose Multiplatform's resources management for iOS. + | * Recommended action: remove extraSpecAttributes["resources"] from '${project.buildFile}' and run '${project.path}:podInstall' once; + | * Alternative action: turn off Compose Multiplatform's resources management for iOS by adding '${IosGradleProperties.SYNC_RESOURCES_PROPERTY}=false' to your gradle.properties; + """.trimMargin()) } cocoapodsExt.framework { val syncDir = syncDirFor(this).get().asFile diff --git a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt index f2cd0db71a..301f04f575 100644 --- a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt +++ b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt @@ -142,23 +142,19 @@ class GradlePluginTest : GradlePluginTestBase() { defaultTestEnvironment.copy(kotlinVersion = kotlinVersion) ) - val cacheKindWarning = "Warning: 'kotlin.native.cacheKind' is explicitly set to `none`" + val cacheKindError = "'kotlin.native.cacheKind' is explicitly set to `none`" val args = arrayOf("build", "--dry-run", "-Pkotlin.native.cacheKind=none") with(nativeCacheKindWarningProject(kotlinVersion = TestKotlinVersions.v1_8_20)) { - gradle(*args).checks { - check.logContainsOnce(cacheKindWarning) - } - // check that the warning is shown even when the configuration is loaded from cache - gradle(*args).checks { - check.logContainsOnce(cacheKindWarning) + gradleFailure(*args).checks { + check.logContains(cacheKindError) } } testWorkDir.deleteRecursively() testWorkDir.mkdirs() with(nativeCacheKindWarningProject(kotlinVersion = TestKotlinVersions.v1_9_0) ) { - gradle(*args).checks { - check.logContainsOnce(cacheKindWarning) + gradleFailure(*args).checks { + check.logContains(cacheKindError) } } }