Skip to content

Commit

Permalink
Relocate a bundled KotlinPoet to the internal package
Browse files Browse the repository at this point in the history
  • Loading branch information
terrakok committed Feb 6, 2024
1 parent 322f2e9 commit 84e5298
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle-plugins/compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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>("shadowJar") {
for (packageToRelocate in packagesToRelocate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Original file line number Diff line number Diff line change
@@ -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", "")
}
Original file line number Diff line number Diff line change
@@ -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")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
kotlin("multiplatform").apply(false)
id("org.jetbrains.compose").apply(false)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.jvmargs=-Xmx8096M
Original file line number Diff line number Diff line change
@@ -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()
}
}
2 changes: 1 addition & 1 deletion gradle-plugins/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 84e5298

Please sign in to comment.