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

Add generated resource dir to proper sources and outputs #215

Merged
merged 1 commit into from Dec 29, 2020

Conversation

ting-yuan
Copy link
Collaborator

So that it can be picked up by compilation and jar tasks.

So that it can be picked up by compilation and jar tasks.
Copy link
Contributor

@ZacSweers ZacSweers left a comment

Choose a reason for hiding this comment

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

I think the sourcing works fine, it's the task dependency that is missing. I work around this by just making KotlinCompile depend on the processResources task

@ting-yuan
Copy link
Collaborator Author

Resources generated by KSP are added directly to the outputs of kotlinCompile and not subject to processResources.

On the other hand, it seems that non-generated resources are picked from build/processedResources, which is hard-coded. I thought they should be handled by kotlin-gradle-plugin automatically and it's weird to me that providing an explicit dependency affects the result.

BTW, your workaround might sometimes pick the resources generated from previous round? The dependencies look like this:
compileKotlin depends on kspKotlin
compileKotlin depends on processResources
but there's no guarantee whether processResources depends on kspKotlin or not.

@ZacSweers
Copy link
Contributor

true, I should update it for the new separate task.

They might be hardcoded but that doesn't guarantee a task dependency. The fact that setting the task dependency only (and not any inputs) supports this, probably just an issue with the kotlin plugin

@ting-yuan
Copy link
Collaborator Author

Ah, I didn't notice that it has been there before KSP moved to a separated task :-)

Anyway, generated resources should be picked up automatically now. Or are there still any potential issues that I missed?

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.

None yet

3 participants