I am making a lib that modifies the AST with an annotation handler for parameter injection (src: http://github.com/PhoenixOrigin/DependencyInjector). Right now, all users are required to include
compileJava {
options.fork = true
options.forkOptions.with {
jvmArgs = [
'--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
]
}
}
in their gradle files. To bypass that, I tried to shade in the required modules with
shadowJar {
relocate 'com.sun.tools.javac','net.phoenix.javac'
}
But this throws an error here about typecasting between com.sun JavacProcessingEnvironment and the net.phoenix shaded one.
Does anyone know a better way to do it / how to use shadowJar properly to allow for typecasting between com.sun and my shaded classes?
phoenix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.