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

Running kspCommonMainKotlinMetadata twice turns generated files into directories #2230

Closed
eygraber opened this issue Nov 22, 2024 · 0 comments · Fixed by #2231
Closed

Running kspCommonMainKotlinMetadata twice turns generated files into directories #2230

eygraber opened this issue Nov 22, 2024 · 0 comments · Fixed by #2231

Comments

@eygraber
Copy link

eygraber commented Nov 22, 2024

Tested with 2.1.0-RC2-1.0.28 and 2.0.21-1.0.28.

Using https://github.com/eygraber/kotlin-inject/tree/ksp2, if you run ./gradlew :integration-tests:module:kspCommonMainKotlinMetadata it succeeds, and there are two generated Kotlin files under integration-tests/module/build/generated/ksp/metadata/commonMain/kotlin/me/tatarka/inject/test/module

If you then run it again, it fails with:

e: [ksp] java.io.FileNotFoundException: /home/eli/workspace/kotlin-inject/integration-tests/module/build/generated/ksp/metadata/commonMain/kotlin/me/tatarka/inject/test/module/InjectExternalParentComponent.kt (Is a directory)

and all of the files under integration-tests/module/build/generated/ksp/metadata/commonMain/kotlin/me/tatarka/inject/test/module are directories.

Running the task again after the failure succeeds.

Adding the following to integration-tests/module/build.gradle.kts prints false during the run that the task fails, indicating that it is probably something in the task that is changing the file into a directory:

tasks.all {
    if(name == "kspCommonMainKotlinMetadata") {
        doFirst {
            println("!!!!!!!!!!!!!!!${File("/home/eli/workspace/kotlin-inject/integration-tests/module/build/generated/ksp/metadata/commonMain/kotlin/me/tatarka/inject/test/module/InjectExternalParentComponent.kt").isDirectory}")
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant