-
Notifications
You must be signed in to change notification settings - Fork 265
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
Question: Produce on test sources #962
Comments
How about adding the generated folder into your test source set in build script? |
@neetopia this is not what I want! The drawback of this solution is that these generated classes can be used from main sources and this is not the expected behavior! I want these classes to be used only from test sources! |
I've got a similar request on slack as well. Will try to prioritize this in near future. |
Looks like if #1021 would be accepted (and later enhanced to cover Android builds), it would provide the configuration infrastructure to specify an output source set per compilation. Then, the configuration for sourceSets {
val main by getting {
ksp {
processor(project(":test-processor"))
outputSourceSet = "debugUnitTest"
}
}
} But maybe we'll even see use cases where multiple output source sets are required. In this case, the KSP Gradle plugin could set up proper dependencies, and pass the configured output source sets to the compiler plugin and processor. The processor could then decide which output source set to use for each piece of code to generate. |
Hello folks!
Is there a way to produce classes from main sources to test sources?
A usecase for this is to create helper classes for testing base on the main sources e.g. fixture creation
Thanks!
The text was updated successfully, but these errors were encountered: