diff --git a/gradle-plugins/compose/build.gradle.kts b/gradle-plugins/compose/build.gradle.kts index b0865b2d8c6..e89fdd48f20 100644 --- a/gradle-plugins/compose/build.gradle.kts +++ b/gradle-plugins/compose/build.gradle.kts @@ -72,7 +72,7 @@ dependencies { embedded(project(":jdk-version-probe")) } -val packagesToRelocate = listOf("de.undercouch") +val packagesToRelocate = listOf("de.undercouch", "com.squareup.kotlinpoet") val shadow = tasks.named("shadowJar") { for (packageToRelocate in packagesToRelocate) { 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 18e08731cbc..9a6a5d3e44f 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 @@ -222,4 +222,10 @@ class ResourcesTest : GradlePluginTestBase() { assert(file("src/commonMain/composeResources/values/strings.xml").readLines().size == 513) } } + + //https://github.com/gmazzo/gradle-buildconfig-plugin/issues/131 + @Test + fun testBundledKotlinPoet(): Unit = with(testProject("misc/bundledKotlinPoet")) { + gradle("generateBuildConfig") + } } \ No newline at end of file diff --git a/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/app/build.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/app/build.gradle.kts new file mode 100644 index 00000000000..5e0fd3e9fa9 --- /dev/null +++ b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/app/build.gradle.kts @@ -0,0 +1,25 @@ +plugins { + kotlin("multiplatform") + id("org.jetbrains.compose") + id("com.github.gmazzo.buildconfig") +} + +group = "app.group" + +kotlin { + jvm() + + sourceSets { + commonMain { + dependencies { + implementation(compose.runtime) + implementation(compose.material) + implementation(compose.components.resources) + } + } + } +} + +buildConfig { + buildConfigField(String::class.java, "str", "") +} diff --git a/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/app/src/commonMain/kotlin/App.kt b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/app/src/commonMain/kotlin/App.kt new file mode 100644 index 00000000000..e831ab588a7 --- /dev/null +++ b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/app/src/commonMain/kotlin/App.kt @@ -0,0 +1,9 @@ +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import app.group.empty_res.generated.resources.Res + +@Composable +fun App() { + val res = Res + Text("text") +} diff --git a/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/build.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/build.gradle.kts new file mode 100644 index 00000000000..53f913fce78 --- /dev/null +++ b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + kotlin("multiplatform").apply(false) + id("org.jetbrains.compose").apply(false) +} diff --git a/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/gradle.properties b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/gradle.properties new file mode 100644 index 00000000000..c13202c0d57 --- /dev/null +++ b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx8096M \ No newline at end of file diff --git a/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/settings.gradle.kts b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/settings.gradle.kts new file mode 100644 index 00000000000..af0c57f19b6 --- /dev/null +++ b/gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/settings.gradle.kts @@ -0,0 +1,24 @@ +rootProject.name = "bundled_kp" +include(":app") +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.compose").version("COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER") + id("com.github.gmazzo.buildconfig").version("5.3.5") + } +} +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/gradle/libs.versions.toml b/gradle-plugins/gradle/libs.versions.toml index 1b70767c496..5a2fc3056a3 100644 --- a/gradle-plugins/gradle/libs.versions.toml +++ b/gradle-plugins/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] kotlin = "1.9.0" gradle-download-plugin = "5.5.0" -kotlin-poet = "1.14.2" +kotlin-poet = "1.16.0" plugin-android = "7.3.0" shadow-jar = "8.1.1" publish-plugin = "1.2.1"