From 39615632ebc6996b0fa51dc723ad895acb43b0fd Mon Sep 17 00:00:00 2001 From: Konstantin Tskhovrebov Date: Tue, 10 Dec 2024 14:07:28 +0100 Subject: [PATCH 01/10] Revert "Resources improvements for native macOS app (#5169)" This reverts commit 5870305e0bc3fdd293d2e47c023882f8c0d3d439. --- .../compose/resources/ResourceReader.macos.kt | 28 +--- .../compose/resources/IosResources.kt | 17 +-- .../compose/resources/IosResourcesTasks.kt | 12 +- .../test/tests/integration/ResourcesTest.kt | 122 ------------------ .../appModule/build.gradle.kts | 2 - .../composeResources/values/macos_strings.xml | 3 - .../kotlin/me/sample/app/App.macos.kt | 10 -- .../cmplib/build.gradle.kts | 2 - .../featureModule/build.gradle.kts | 2 - .../kmpResourcePublication/gradle.properties | 1 - .../misc/macosResources/build.gradle.kts | 32 ----- .../expected/macosResources.podspec | 54 -------- .../misc/macosResources/gradle.properties | 2 - .../misc/macosResources/settings.gradle.kts | 24 ---- .../drawable/compose-multiplatform.xml | 36 ------ .../src/commonMain/kotlin/App.kt | 39 ------ .../composeResources/drawable/icon.xml | 36 ------ .../misc/testResources/build.gradle.kts | 3 - .../misc/testResources/gradle.properties | 3 +- 19 files changed, 11 insertions(+), 417 deletions(-) delete mode 100644 gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/src/macosMain/composeResources/values/macos_strings.xml delete mode 100644 gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/src/macosMain/kotlin/me/sample/app/App.macos.kt delete mode 100644 gradle-plugins/compose/src/test/test-projects/misc/macosResources/build.gradle.kts delete mode 100644 gradle-plugins/compose/src/test/test-projects/misc/macosResources/expected/macosResources.podspec delete mode 100644 gradle-plugins/compose/src/test/test-projects/misc/macosResources/gradle.properties delete mode 100644 gradle-plugins/compose/src/test/test-projects/misc/macosResources/settings.gradle.kts delete mode 100644 gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/commonMain/composeResources/drawable/compose-multiplatform.xml delete mode 100644 gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/commonMain/kotlin/App.kt delete mode 100644 gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/macosMain/composeResources/drawable/icon.xml diff --git a/components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/ResourceReader.macos.kt b/components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/ResourceReader.macos.kt index 61ddd3aa9a..4b042d1108 100644 --- a/components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/ResourceReader.macos.kt +++ b/components/resources/library/src/macosMain/kotlin/org/jetbrains/compose/resources/ResourceReader.macos.kt @@ -39,32 +39,12 @@ internal actual fun getPlatformResourceReader(): ResourceReader = object : Resou private fun getPathOnDisk(path: String): String { val fm = NSFileManager.defaultManager() val currentDirectoryPath = fm.currentDirectoryPath - val pathFix = getPathWithoutPackage(path) return listOf( - // Framework binary - // todo: support fallback path at bundle root? - NSBundle.mainBundle.resourcePath + "/compose-resources/" + path, - // Executable binary //todo in future bundle resources with app and use all sourceSets (skikoMain, nativeMain) - "$currentDirectoryPath/src/macosMain/composeResources/$pathFix", - "$currentDirectoryPath/src/macosTest/composeResources/$pathFix", - "$currentDirectoryPath/src/commonMain/composeResources/$pathFix", - "$currentDirectoryPath/src/commonTest/composeResources/$pathFix" + "$currentDirectoryPath/src/macosMain/composeResources/$path", + "$currentDirectoryPath/src/macosTest/composeResources/$path", + "$currentDirectoryPath/src/commonMain/composeResources/$path", + "$currentDirectoryPath/src/commonTest/composeResources/$path" ).firstOrNull { p -> fm.fileExistsAtPath(p) } ?: throw MissingResourceException(path) } - - private fun getPathWithoutPackage(path: String): String { - // At the moment resources are not bundled when running a macOS executable binary. - // As a workaround, load the resources from the actual path on disk. So the - // "composeResources/PACKAGE/" prefix must be removed. For example: - // "composeResources/chat_mpp.shared.generated.resources/drawable/background.jpg" - // Will be transformed into: - // "drawable/background.jpg" - // In the future when resources are bundled when running macOS executable binary this - // workaround is no longer needed. - require(path.startsWith("composeResources/")) { "Invalid path: $path" } - return path - .substringAfter("composeResources/") // remove "composeResources/" part - .substringAfter("/") // remove PACKAGE path - } } \ No newline at end of file diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResources.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResources.kt index ccb994d4ef..ef6caa15b7 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResources.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResources.kt @@ -33,7 +33,7 @@ internal fun Project.configureSyncIosComposeResources( } kotlinExtension.targets.withType(KotlinNativeTarget::class.java).all { nativeTarget -> - if (nativeTarget.isIosOrMacTarget()) { + if (nativeTarget.isIosTarget()) { nativeTarget.binaries.withType(Framework::class.java).all { iosFramework -> val frameworkClassifier = iosFramework.getClassifier() val checkNoSandboxTask = tasks.registerOrConfigure( @@ -116,7 +116,6 @@ private fun Framework.getClassifier(): String { } internal fun Framework.getSyncResourcesTaskName() = "sync${getClassifier()}ComposeResourcesForIos" - private fun Framework.isCocoapodsFramework() = name.startsWith("pod") private fun Framework.getFinalResourcesDir(): Provider { @@ -126,9 +125,9 @@ private fun Framework.getFinalResourcesDir(): Provider { } else { providers.environmentVariable("BUILT_PRODUCTS_DIR") .zip( - providers.environmentVariable("UNLOCALIZED_RESOURCES_FOLDER_PATH") - ) { builtProductsDir, unlocalizedResourcesFolderPath -> - File("$builtProductsDir/$unlocalizedResourcesFolderPath/$IOS_COMPOSE_RESOURCES_ROOT_DIR").canonicalPath + providers.environmentVariable("CONTENTS_FOLDER_PATH") + ) { builtProductsDir, contentsFolderPath -> + File("$builtProductsDir/$contentsFolderPath/$IOS_COMPOSE_RESOURCES_ROOT_DIR").canonicalPath } .flatMap { project.objects.directoryProperty().apply { set(File(it)) } @@ -143,10 +142,4 @@ private fun KotlinNativeTarget.isIosDeviceTarget(): Boolean = konanTarget === KonanTarget.IOS_ARM64 private fun KotlinNativeTarget.isIosTarget(): Boolean = - isIosSimulatorTarget() || isIosDeviceTarget() - -private fun KotlinNativeTarget.isMacTarget(): Boolean = - konanTarget === KonanTarget.MACOS_X64 || konanTarget === KonanTarget.MACOS_ARM64 - -private fun KotlinNativeTarget.isIosOrMacTarget(): Boolean = - isIosTarget() || isMacTarget() + isIosSimulatorTarget() || isIosDeviceTarget() \ No newline at end of file diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResourcesTasks.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResourcesTasks.kt index 62afc07983..b024e9412b 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResourcesTasks.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResourcesTasks.kt @@ -118,17 +118,7 @@ private fun getRequestedKonanTargetsByXcode(platform: String, archs: List { - targets.addAll(archs.map { arch -> - when (arch) { - "arm64" -> KonanTarget.MACOS_ARM64 - "x86_64" -> KonanTarget.MACOS_X64 - else -> error("Unknown macOS arch: '$arch'") - } - }) - } - - else -> error("Unknown Apple platform: '$platform'") + else -> error("Unknown iOS platform: '$platform'") } return targets.toList() diff --git a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt index 68ff7907ac..3e0e271927 100644 --- a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt +++ b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt @@ -280,13 +280,6 @@ class ResourcesTest : GradlePluginTestBase() { libpath("iossimulatorarm64", "-kotlin_resources.kotlin_resources.zip") ) checkResourcesZip(iossimulatorarm64ResZip, resourcesFiles, false) - - val macosx64ResZip = - file(libpath("macosx64", "-kotlin_resources.kotlin_resources.zip")) - checkResourcesZip(macosx64ResZip, resourcesFiles, false) - val macosarm64ResZip = - file(libpath("macosarm64", "-kotlin_resources.kotlin_resources.zip")) - checkResourcesZip(macosarm64ResZip, resourcesFiles, false) } val jsResZip = file(libpath("js", "-kotlin_resources.kotlin_resources.zip")) checkResourcesZip(jsResZip, resourcesFiles, false) @@ -307,13 +300,6 @@ class ResourcesTest : GradlePluginTestBase() { ":appModule:iosSimulatorArm64Test" } gradle(iosTask) - - val macosTask = if (currentArch == Arch.X64) { - ":appModule:macosX64Test" - } else { - ":appModule:macosArm64Test" - } - gradle(macosTask) } file("featureModule/src/commonMain/kotlin/me/sample/app/Feature.kt").modify { content -> @@ -701,95 +687,6 @@ class ResourcesTest : GradlePluginTestBase() { } } - @Test - fun macosResources() { - Assumptions.assumeTrue(currentOS == OS.MacOS) - val macosEnv = mapOf( - "PLATFORM_NAME" to "macosx", - "ARCHS" to "arm64", - "CONFIGURATION" to "Debug", - ) - val testEnv = defaultTestEnvironment.copy( - additionalEnvVars = macosEnv - ) - - with(TestProject("misc/macosResources", testEnv)) { - gradle(":podspec", "-Pkotlin.native.cocoapods.generate.wrapper=true").checks { - assertEqualTextFiles( - file("macosResources.podspec"), - file("expected/macosResources.podspec") - ) - file("build/compose/cocoapods/compose-resources").checkExists() - } - - gradle( - ":syncFramework", - "-Pkotlin.native.cocoapods.platform=${macosEnv["PLATFORM_NAME"]}", - "-Pkotlin.native.cocoapods.archs=${macosEnv["ARCHS"]}", - "-Pkotlin.native.cocoapods.configuration=${macosEnv["CONFIGURATION"]}", - "--dry-run" - ).checks { - check.taskSkipped(":generateComposeResClass") - - check.taskSkipped(":convertXmlValueResourcesForCommonMain") - check.taskSkipped(":copyNonXmlValueResourcesForCommonMain") - check.taskSkipped(":prepareComposeResourcesTaskForCommonMain") - check.taskSkipped(":generateResourceAccessorsForCommonMain") - - check.taskSkipped(":convertXmlValueResourcesForNativeMain") - check.taskSkipped(":copyNonXmlValueResourcesForNativeMain") - check.taskSkipped(":prepareComposeResourcesTaskForNativeMain") - check.taskSkipped(":generateResourceAccessorsForNativeMain") - - check.taskSkipped(":convertXmlValueResourcesForAppleMain") - check.taskSkipped(":copyNonXmlValueResourcesForAppleMain") - check.taskSkipped(":prepareComposeResourcesTaskForAppleMain") - check.taskSkipped(":generateResourceAccessorsForAppleMain") - - check.taskSkipped(":convertXmlValueResourcesForMacosMain") - check.taskSkipped(":copyNonXmlValueResourcesForMacosMain") - check.taskSkipped(":prepareComposeResourcesTaskForMacosMain") - check.taskSkipped(":generateResourceAccessorsForMacosMain") - - check.taskSkipped(":convertXmlValueResourcesForMacosX64Main") - check.taskSkipped(":copyNonXmlValueResourcesForMacosX64Main") - check.taskSkipped(":prepareComposeResourcesTaskForMacosX64Main") - check.taskSkipped(":generateResourceAccessorsForMacosX64Main") - - check.taskSkipped(":syncPodComposeResourcesForIos") - } - gradle(":syncPodComposeResourcesForIos").checks { - check.taskNoSource(":convertXmlValueResourcesForCommonMain") - check.taskSuccessful(":copyNonXmlValueResourcesForCommonMain") - check.taskSuccessful(":prepareComposeResourcesTaskForCommonMain") - check.taskSkipped(":generateResourceAccessorsForCommonMain") - - check.taskNoSource(":convertXmlValueResourcesForNativeMain") - check.taskNoSource(":copyNonXmlValueResourcesForNativeMain") - check.taskNoSource(":prepareComposeResourcesTaskForNativeMain") - check.taskSkipped(":generateResourceAccessorsForNativeMain") - - check.taskNoSource(":convertXmlValueResourcesForAppleMain") - check.taskNoSource(":copyNonXmlValueResourcesForAppleMain") - check.taskNoSource(":prepareComposeResourcesTaskForAppleMain") - check.taskSkipped(":generateResourceAccessorsForAppleMain") - - check.taskNoSource(":convertXmlValueResourcesForMacosMain") - check.taskSuccessful(":copyNonXmlValueResourcesForMacosMain") - check.taskSuccessful(":prepareComposeResourcesTaskForMacosMain") - check.taskSkipped(":generateResourceAccessorsForMacosMain") - - check.taskNoSource(":convertXmlValueResourcesForMacosX64Main") - check.taskNoSource(":copyNonXmlValueResourcesForMacosX64Main") - check.taskNoSource(":prepareComposeResourcesTaskForMacosX64Main") - check.taskSkipped(":generateResourceAccessorsForMacosX64Main") - - file("build/compose/cocoapods/compose-resources/composeResources/macosresources.generated.resources/drawable/compose-multiplatform.xml").checkExists() - file("build/compose/cocoapods/compose-resources/composeResources/macosresources.generated.resources/drawable/icon.xml").checkExists() - } - } - } - @Test fun iosTestResources() { Assumptions.assumeTrue(currentOS == OS.MacOS) @@ -805,21 +702,6 @@ class ResourcesTest : GradlePluginTestBase() { } } - @Test - fun macosTestResources() { - Assumptions.assumeTrue(currentOS == OS.MacOS) - with(testProject("misc/macosResources")) { - gradle(":linkDebugTestMacosX64", "--dry-run").checks { - check.taskSkipped(":copyTestComposeResourcesForMacosX64") - check.taskSkipped(":linkDebugTestMacosX64") - } - gradle(":copyTestComposeResourcesForMacosX64").checks { - file("build/bin/macosX64/debugTest/compose-resources/composeResources/macosresources.generated.resources/drawable/compose-multiplatform.xml").checkExists() - file("build/bin/macosX64/debugTest/compose-resources/composeResources/macosresources.generated.resources/drawable/icon.xml").checkExists() - } - } - } - @Test fun checkTestResources() { with(testProject("misc/testResources")) { @@ -832,10 +714,6 @@ class ResourcesTest : GradlePluginTestBase() { check.logContains("Configure test resources for 'iosArm64' target") check.logContains("Configure main resources for 'iosSimulatorArm64' target") check.logContains("Configure test resources for 'iosSimulatorArm64' target") - check.logContains("Configure main resources for 'macosX64' target") - check.logContains("Configure test resources for 'macosX64' target") - check.logContains("Configure main resources for 'macosArm64' target") - check.logContains("Configure test resources for 'macosArm64' target") check.taskSuccessful(":desktopTest") } diff --git a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/build.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/build.gradle.kts index 07f8005434..2c3b6955ef 100644 --- a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/build.gradle.kts +++ b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/build.gradle.kts @@ -13,8 +13,6 @@ kotlin { iosX64() iosArm64() iosSimulatorArm64() - macosX64() - macosArm64() js { browser() } wasmJs { browser() } diff --git a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/src/macosMain/composeResources/values/macos_strings.xml b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/src/macosMain/composeResources/values/macos_strings.xml deleted file mode 100644 index f9f89e586b..0000000000 --- a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/src/macosMain/composeResources/values/macos_strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - macOS string - \ No newline at end of file diff --git a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/src/macosMain/kotlin/me/sample/app/App.macos.kt b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/src/macosMain/kotlin/me/sample/app/App.macos.kt deleted file mode 100644 index 4a4927ee00..0000000000 --- a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/appModule/src/macosMain/kotlin/me/sample/app/App.macos.kt +++ /dev/null @@ -1,10 +0,0 @@ -package me.sample.app - -import androidx.compose.runtime.Composable -import kmpresourcepublication.appmodule.generated.resources.Res -import kmpresourcepublication.appmodule.generated.resources.macOS_str -import org.jetbrains.compose.resources.stringResource - -@Composable -actual fun getPlatformSpecificString(): String = - stringResource(Res.string.macOS_str) \ No newline at end of file diff --git a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/cmplib/build.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/cmplib/build.gradle.kts index 609f087d4a..cc5a941daf 100644 --- a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/cmplib/build.gradle.kts +++ b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/cmplib/build.gradle.kts @@ -22,8 +22,6 @@ kotlin { iosX64() iosArm64() iosSimulatorArm64() - macosX64() - macosArm64() js { browser() } wasmJs { browser() } diff --git a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/featureModule/build.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/featureModule/build.gradle.kts index 2ae9d3cefa..bd92b891d6 100644 --- a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/featureModule/build.gradle.kts +++ b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/featureModule/build.gradle.kts @@ -11,8 +11,6 @@ kotlin { iosX64() iosArm64() iosSimulatorArm64() - macosX64() - macosArm64() js { browser() } wasmJs { browser() } diff --git a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/gradle.properties b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/gradle.properties index 3ae7c5803a..9cd73d38eb 100644 --- a/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/gradle.properties +++ b/gradle-plugins/compose/src/test/test-projects/misc/kmpResourcePublication/gradle.properties @@ -5,4 +5,3 @@ android.useAndroidX=true org.jetbrains.compose.experimental.uikit.enabled=true org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.wasm.enabled=true -org.jetbrains.compose.experimental.macos.enabled=true diff --git a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/build.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/macosResources/build.gradle.kts deleted file mode 100644 index 2e30c124f4..0000000000 --- a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/build.gradle.kts +++ /dev/null @@ -1,32 +0,0 @@ -plugins { - kotlin("multiplatform") - kotlin("plugin.compose") - kotlin("native.cocoapods") - id("org.jetbrains.compose") -} - -kotlin { - cocoapods { - version = "1.0" - summary = "Some description for a Kotlin/Native module" - homepage = "Link to a Kotlin/Native module homepage" - pod("Base64", "1.1.2") - framework { - baseName = "shared" - isStatic = true - } - } - - macosX64() - macosArm64() - - sourceSets { - commonMain { - dependencies { - implementation(compose.runtime) - implementation(compose.material) - implementation(compose.components.resources) - } - } - } -} diff --git a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/expected/macosResources.podspec b/gradle-plugins/compose/src/test/test-projects/misc/macosResources/expected/macosResources.podspec deleted file mode 100644 index b4f476089e..0000000000 --- a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/expected/macosResources.podspec +++ /dev/null @@ -1,54 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = 'macosResources' - spec.version = '1.0' - spec.homepage = 'Link to a Kotlin/Native module homepage' - spec.source = { :http=> ''} - spec.authors = '' - spec.license = '' - spec.summary = 'Some description for a Kotlin/Native module' - spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework' - spec.libraries = 'c++' - - spec.dependency 'Base64', '1.1.2' - - if !Dir.exist?('build/cocoapods/framework/shared.framework') || Dir.empty?('build/cocoapods/framework/shared.framework') - raise " - - Kotlin framework 'shared' doesn't exist yet, so a proper Xcode project can't be generated. - 'pod install' should be executed after running ':generateDummyFramework' Gradle task: - - ./gradlew :generateDummyFramework - - Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)" - end - - spec.xcconfig = { - 'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO', - } - - spec.pod_target_xcconfig = { - 'KOTLIN_PROJECT_PATH' => '', - 'PRODUCT_MODULE_NAME' => 'shared', - } - - spec.script_phases = [ - { - :name => 'Build macosResources', - :execution_position => :before_compile, - :shell_path => '/bin/sh', - :script => <<-SCRIPT - if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then - echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\"" - exit 0 - fi - set -ev - REPO_ROOT="$PODS_TARGET_SRCROOT" - "$REPO_ROOT/gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \ - -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \ - -Pkotlin.native.cocoapods.archs="$ARCHS" \ - -Pkotlin.native.cocoapods.configuration="$CONFIGURATION" - SCRIPT - } - ] - spec.resources = ['build/compose/cocoapods/compose-resources'] -end \ No newline at end of file diff --git a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/gradle.properties b/gradle-plugins/compose/src/test/test-projects/misc/macosResources/gradle.properties deleted file mode 100644 index dc1dcfb61b..0000000000 --- a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -org.gradle.jvmargs=-Xmx8096M -org.jetbrains.compose.experimental.macos.enabled=true \ No newline at end of file diff --git a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/settings.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/macosResources/settings.gradle.kts deleted file mode 100644 index fe637593ae..0000000000 --- a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/settings.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -rootProject.name = "macosResources" -pluginManagement { - repositories { - mavenLocal() - gradlePluginPortal() - google() - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - } - plugins { - id("org.jetbrains.kotlin.multiplatform").version("KOTLIN_VERSION_PLACEHOLDER") - id("org.jetbrains.kotlin.plugin.compose").version("KOTLIN_VERSION_PLACEHOLDER") - id("org.jetbrains.kotlin.native.cocoapods").version("KOTLIN_VERSION_PLACEHOLDER") - id("org.jetbrains.compose").version("COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER") - } -} -dependencyResolutionManagement { - repositories { - mavenLocal() - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - mavenCentral() - gradlePluginPortal() - google() - } -} \ No newline at end of file diff --git a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/commonMain/composeResources/drawable/compose-multiplatform.xml b/gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/commonMain/composeResources/drawable/compose-multiplatform.xml deleted file mode 100644 index 792ad8f711..0000000000 --- a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/commonMain/composeResources/drawable/compose-multiplatform.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - diff --git a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/commonMain/kotlin/App.kt b/gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/commonMain/kotlin/App.kt deleted file mode 100644 index 17641ca754..0000000000 --- a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/commonMain/kotlin/App.kt +++ /dev/null @@ -1,39 +0,0 @@ -import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.material.Button -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import org.jetbrains.compose.resources.ExperimentalResourceApi -import org.jetbrains.compose.resources.painterResource -import iosResources.generated.resources.* - -@OptIn(ExperimentalResourceApi::class) -@Composable -fun App() { - MaterialTheme { - var greetingText by remember { mutableStateOf("Hello, World!") } - var showImage by remember { mutableStateOf(false) } - Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { - Button(onClick = { - showImage = !showImage - }) { - Text(greetingText) - } - AnimatedVisibility(showImage) { - Image( - painterResource(Res.drawable.compose_multiplatform), - null - ) - } - } - } -} diff --git a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/macosMain/composeResources/drawable/icon.xml b/gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/macosMain/composeResources/drawable/icon.xml deleted file mode 100644 index 792ad8f711..0000000000 --- a/gradle-plugins/compose/src/test/test-projects/misc/macosResources/src/macosMain/composeResources/drawable/icon.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - diff --git a/gradle-plugins/compose/src/test/test-projects/misc/testResources/build.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/testResources/build.gradle.kts index e0886927c1..6ded4832b3 100644 --- a/gradle-plugins/compose/src/test/test-projects/misc/testResources/build.gradle.kts +++ b/gradle-plugins/compose/src/test/test-projects/misc/testResources/build.gradle.kts @@ -15,9 +15,6 @@ kotlin { iosArm64() iosSimulatorArm64() - macosX64() - macosArm64() - sourceSets { commonMain { dependencies { diff --git a/gradle-plugins/compose/src/test/test-projects/misc/testResources/gradle.properties b/gradle-plugins/compose/src/test/test-projects/misc/testResources/gradle.properties index 2f532ce0ea..f4d7109663 100644 --- a/gradle-plugins/compose/src/test/test-projects/misc/testResources/gradle.properties +++ b/gradle-plugins/compose/src/test/test-projects/misc/testResources/gradle.properties @@ -1,4 +1,3 @@ org.gradle.jvmargs=-Xmx8096M android.useAndroidX=true -org.jetbrains.compose.experimental.jscanvas.enabled=true -org.jetbrains.compose.experimental.macos.enabled=true \ No newline at end of file +org.jetbrains.compose.experimental.jscanvas.enabled=true \ No newline at end of file From e9597e71931dc38de8171605ce701efe8a6f4d8c Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Wed, 11 Dec 2024 14:03:45 +0100 Subject: [PATCH 02/10] Changelog script. Read dependencies, support N/A (#5181) Fixes https://youtrack.jetbrains.com/issue/CMP-7203/Changelog-script.-Generate-Dependencies-section Fixes https://youtrack.jetbrains.com/issue/CMP-7137/Changelog-script-small-fixes - Read dependencies from git repos - Support N/A - Supports any prefix. For example `- (experimental) Change` - Try to fix the line start Can be read commit by commit. --- .github/PULL_REQUEST_TEMPLATE.md | 8 +- tools/changelog.main.kts | 218 ++++++++++++++++++++++--------- 2 files changed, 158 insertions(+), 68 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c48fb88983..13a5c22c76 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,16 +15,18 @@ This should be tested by QA ## Release Notes