How to access Gradle module resource output directory in JPS plugin?
For Gradle project module there are several output paths per module, pointed by sourceSets, e.g. main sourceSet has default "build/classes/main" and "build/resources/main". On UI side those can be accessed with
OrderEnumerator.orderEntries(module)...classes().getRoots();
However on JPS plugin side at builder extending ModuleLevelBuilder that has BuilderCategory.CLASS_POST_PROCESSOR there is missing "build/resources/main" path, when accessed with
JpsJavaExtensionService.dependencies(module)...classes().getRoots();
In Gradle plugin tasks may access resource ouput directory after accessing convention with
sourceSet.getOutput().getResourcesDir()
I understand that class post processor may be called before resource post porcessor in JPS and at ModuleLevelBuilder there may be no way to figure out those resource paths yet. How to access main sourceSet resources output directory at JPS plugin side, without excessive combinations?
Please sign in to leave a comment.
You can try the JpsGradleExtensionService:
It works in may case - thanks for help.