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

Make KSP compatible with Gradle's isolated projects #2315

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scott-pollom
Copy link
Contributor

@scott-pollom scott-pollom force-pushed the fix_for_project_isolation branch from 26b2e00 to ba5efd4 Compare February 3, 2025 19:08
// They will be observed by downstreams and violate current build scheme.
kotlinCompileProvider.configure { it.source(*generatedSources) }
} else {
kotlinCompilation.defaultSourceSet.kotlin.srcDirs(*generatedSources)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for adding generated sources to kotlinCompilation.defaultSourceSet and all corresponding workarounds is IDE support, which is not covered in KSP's tests unfortunately. Without this, users would add the output folder of KSP to the source set and suffer from the same (if not more) issue.

I got a couple of alternatives but they are apparently beyond the scope of this PR.

  1. Work with KGP / JetBrains to get an API for registering generated sources, like those provided by AGP.
  2. Implement IDE plugins for KSP.

Are there easier solutions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there easier solutions?

I can't think of a way to make it work with existing APIs.

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 this pull request may close these issues.

2 participants