From 2e641803843f9196d514b2b1287f6cfc0e5208e9 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 4 Mar 2024 17:39:09 +0100 Subject: [PATCH] Fix package name of generated Res file when project is building for JsTarget (#4295) (#4300) Origin: https://github.com/JetBrains/compose-multiplatform/pull/4296 --------- Co-authored-by: Suhaib Roomy --- .../org/jetbrains/compose/resources/ResourcesGenerator.kt | 2 +- .../jetbrains/compose/test/tests/integration/ResourcesTest.kt | 4 ++-- .../test-projects/misc/commonResources/settings.gradle.kts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/ResourcesGenerator.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/ResourcesGenerator.kt index d654751662..642719f749 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/ResourcesGenerator.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/ResourcesGenerator.kt @@ -116,7 +116,7 @@ private fun Project.configureResourceGenerator(commonComposeResourcesDir: File, val group = project.group.toString().lowercase().asUnderscoredIdentifier() append(group) if (group.isNotEmpty()) append(".") - append(project.name.lowercase()) + append(project.name.lowercase().asUnderscoredIdentifier()) append(".generated.resources") } } 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 10b07a11bb..e98dc3ea4f 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 @@ -179,7 +179,7 @@ class ResourcesTest : GradlePluginTestBase() { checkAndroidApk("full", "debug", commonResourcesFiles) checkAndroidApk("full", "release", commonResourcesFiles) - val desktopJar = file("build/libs/resources_test-desktop.jar") + val desktopJar = file("build/libs/Resources-Test-desktop.jar") assertTrue(desktopJar.exists()) ZipFile(desktopJar).use { zip -> commonResourcesFiles.forEach { res -> @@ -206,7 +206,7 @@ class ResourcesTest : GradlePluginTestBase() { } private fun TestProject.checkAndroidApk(flavor: String, type: String, commonResourcesFiles: Sequence) { - val apk = file("build/outputs/apk/$flavor/$type/resources_test-$flavor-$type.apk") + val apk = file("build/outputs/apk/$flavor/$type/Resources-Test-$flavor-$type.apk") assertTrue(apk.exists()) ZipFile(apk).use { zip -> commonResourcesFiles.forEach { res -> diff --git a/gradle-plugins/compose/src/test/test-projects/misc/commonResources/settings.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/commonResources/settings.gradle.kts index 09cf8bcfc6..19b673273f 100644 --- a/gradle-plugins/compose/src/test/test-projects/misc/commonResources/settings.gradle.kts +++ b/gradle-plugins/compose/src/test/test-projects/misc/commonResources/settings.gradle.kts @@ -1,4 +1,4 @@ -rootProject.name = "resources_test" +rootProject.name = "Resources-Test" pluginManagement { repositories { mavenLocal()