I am in the process of standing up my first OSS Java lib (GitHub/Maven) that an open source hardware community will be making fair/moderate use of.
I am writing this library with Java 8 and managing its build with Gradle 2.4. Later this year Java 9 will be unleashed and I'd like to actively maintain separate versions of the library (one for each JVM version) for several reasons:
- Supporting Java 9 features and language may lead to performance and API improvements
- But forcing the library to require Java 9 places undue hardship on large applications that aren't ready to upgrade to it
- So by supporting (that is, continuing to make periodic releases for) both in parallel makes everyone happy
I'm torn between making these Gradle subprojects underneath the same repo, or placing them in their own top-level projects. So:
- A single
myawesomelibtop-level project with
java9/subprojects underneath it; or
- Two separate
myawesomelib-java9top-level projects; or
- Something else?
My inclination is to go with 2 separate top-level projects for CI purposes (so that commits to one don't trigger builds to the other), but I've never had to deal with this problem before.
So all this to ask: what are some common techniques to managing multiple JVM version support in OSS libraries, and are their any facilities in Gradle that can help implement these techniques?