I am planing to move to Gradle and need to know before if it is possible to build multiple artifacts from a project against a version range of a specific dependency. I’m totally new to Gradle and I googled about this but couldn’t find anything that would help me out here.
Our use case is the following (simplified): We have a core application with a plug-in capability. The plug-in is compatible against multiple core versions but needs to be built against every single one. Up to now, we’ve managed this matrix building with an external script.
An example for what I’d like to achieve:
- The artifact repository stores artifacts for ‘company:core’ for the versions 1.0, 1.5, 2.0, 2.0.1, 3.0, 4.0
- In Gradle:
jar {
baseName = 'myplugin'
version = '1.0.0'
}
dependencies {
compile 'company:core:[2.0,3.0]'
compile 'some:other:1.2.3
}
- now, I’d like to compile, run tests, publish artifacts, etc. against the whole version range of ‘company:core’: 2.0, 2.0.1, 3.0. Ideally, the artifacts published will have set the classifier to the version used. Expected artifacts:
- myplugin-1.0.0-2.0.jar
- myplugin-1.0.0-2.0.1.jar
- myplugin-1.0.0-3.0.jar
Is this in any way possible? If yes, how?
Thanks a lot in advance!