sourceSets {
api
main {
compileClasspath = compileClasspath + files(api.output.classesDir)
}
}
classes.dependsOn apiClasses
I can run “classes”, but running “test” fails. What do I need to set in the build.gradle file to tell it that the “test” task needs to include the “messages.properties” file from “main” and the “ReadWelcomeMessage” interface from “api”? I assume it has something to do with the way the test sourceSet is initialized, but I don’t what what it would look like.
Thank you for that information. I was able to successfully run “classes” before, but your information made the build file simplier. But the “compileTestJava” still fails, What do I need to change so the test code can find the ReadWelcomeMessasge interface in the API sourceSet?
Thank you again Stefan. One last problem. When I run “gradle test” I’m getting a MissingResourceException saying it “Can’t find bundle for base name message, locale es_US”. I have tried a few sourceSet properties, but I have not found the correct combination to get past this error. How do I include the “message.properties” bundle in the sourceSet?