You can do that with the same approach I described here. You’d have one compile task and jar for each Java version.
st_oehme
(Stefan Oehme)
2
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Build same sourceSets with different java target compatibility | 3 | 3270 | March 24, 2021 | |
| Conditionally include/exclude Java source sets | 5 | 18313 | September 12, 2016 | |
| Compiling packages within sourceSet with different java versions and source compatibility | 1 | 914 | May 30, 2012 | |
| Compile Java 1.6 compatible classes with gradle started with java 7 | 2 | 13980 | September 17, 2012 | |
| bootClasspath question -- multiple source/target_compatibility? | 0 | 512 | February 2, 2018 |