Skip to content

Commit

Permalink
remove module name mangling workaround
Browse files Browse the repository at this point in the history
(cherry picked from commit 67b1a5f)
  • Loading branch information
neetopia committed Mar 29, 2023
1 parent f1e32f0 commit c11807b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,14 @@ class KspGradleSubplugin @Inject internal constructor(private val registry: Tool
configurePluginOptions(kspTask)
kspTask.compilerOptions.noJdk.value(kotlinCompileTask.compilerOptions.noJdk)
configureLanguageVersion(kspTask)
kspTask.compilerOptions.moduleName.convention(kotlinCompileTask.moduleName.map { "$it-ksp" })
if (kspTask.classpathSnapshotProperties.useClasspathSnapshot.get() == false) {
kspTask.compilerOptions.moduleName.convention(
kotlinCompileTask.moduleName.map { "$it-ksp" }
)
} else {
kspTask.compilerOptions.moduleName.convention(kotlinCompileTask.moduleName)
}

kspTask.moduleName.value(kotlinCompileTask.moduleName.get())
kspTask.destination.value(kspOutputDir)

Expand Down Expand Up @@ -456,7 +463,7 @@ class KspGradleSubplugin @Inject internal constructor(private val registry: Tool
kspTask.compilerOptions.freeCompilerArgs
.value(kotlinCompileTask.compilerOptions.freeCompilerArgs)
configureLanguageVersion(kspTask)
kspTask.compilerOptions.moduleName.convention(kotlinCompileTask.moduleName.map { "$it-ksp" })
kspTask.compilerOptions.moduleName.convention(kotlinCompileTask.moduleName)

kspTask.incrementalChangesTransformers.add(
createIncrementalChangesTransformer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class AndroidIncrementalIT {
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground")

@Test
fun testPlaygroundAndroid() {
private fun testWithExtraFlags(vararg extras: String) {
val gradleRunner = GradleRunner.create().withProjectDir(project.root)

gradleRunner.withArguments(
*extras,
"clean", ":application:compileDebugKotlin", "--configuration-cache-problems=warn", "--debug", "--stacktrace"
).build().let { result ->
Assert.assertEquals(TaskOutcome.SUCCESS, result.task(":workload:compileDebugKotlin")?.outcome)
Expand All @@ -51,6 +51,7 @@ class AndroidIncrementalIT {
}

gradleRunner.withArguments(
*extras,
":application:compileDebugKotlin", "--configuration-cache-problems=warn", "--debug", "--stacktrace"
).build().let { result ->
Assert.assertEquals(
Expand All @@ -59,4 +60,14 @@ class AndroidIncrementalIT {
)
}
}

@Test
fun testPlaygroundAndroid() {
testWithExtraFlags()
}

@Test
fun testPlaygroundAndroidUseClasspathSnapshotFalse() {
testWithExtraFlags("-Pkotlin.incremental.useClasspathSnapshot=false")
}
}

0 comments on commit c11807b

Please sign in to comment.