This project shows the usage of Gradle plugins to pre-process Java comments and generate multi-release jar files.
After ./gralew build
it creates hierarchy structure of pre-processed Java files in build/jcp
and the duplicated files are removed.
To build another directory with a different Java version, add another task
task compileWithJavaX()
with appropriate direction name def java_dir = 'build/jcp/javaX
and define vars = [currentJava: 'X']
Explore the approaches to add build.gradle for sub-projects
- Java Comment Preprocess (JCP): https://github.com/raydac/java-comment-preprocessor
- Multi-release Jar: https://github.com/melix/mrjar-gradle
- Multi-release JARs - Good or bad idea? https://blog.gradle.org/mrjars
- Working With Files https://docs.gradle.org/current/userguide/working_with_files.html#sec:locating_files
- Build Cache https://docs.gradle.org/current/userguide/build_cache.html