Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KSP2: update for all, not just initial dirty sources #2175

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,16 @@ class PlaygroundIT(val useKSP2: Boolean) {
}
}

@Test
fun testEmpty() {
val gradleRunner = GradleRunner.create().withProjectDir(project.root)

File(project.root, "workload/src/main/java/Empty.kt").appendText("\n\n")
gradleRunner.withArguments("clean", "assemble", "-Pksp.incremental.log=false").build().let { result ->
Assert.assertEquals(TaskOutcome.SUCCESS, result.task(":workload:assemble")?.outcome)
}
}

companion object {
@JvmStatic
@Parameterized.Parameters(name = "KSP2={0}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ class KotlinSymbolProcessing(
)
var allDirtyKSFiles = incrementalContext.calcDirtyFiles(allKSFiles).toList()
var newKSFiles = allDirtyKSFiles
val initialDirtySet = allDirtyKSFiles.toSet()

val targetPlatform = ResolverAAImpl.ktModule.targetPlatform
val symbolProcessorEnvironment = SymbolProcessorEnvironment(
Expand Down Expand Up @@ -589,7 +588,7 @@ class KotlinSymbolProcessing(

if (!logger.hasError) {
incrementalContext.updateCachesAndOutputs(
initialDirtySet,
allDirtyKSFiles,
codeGenerator.outputs,
codeGenerator.sourceToOutputs
)
Expand Down
Loading