I have a simple java project that I use gradle for. Currently, I have specified all my library dependencies as one project dependencies tag. Is there a way for me to enable gradle to selectively choose only certain dependencies from the tag based on the compile task that is being run?
I have one compile task that builds the project for ARM, x64, x86, etc. And when running each task I would like the corresponding library dependency to be linked. Also, I would like to specify an All Task, that runs each task successively and builds the target for each platform.
Hmm, sorry, it sounds like Gradle has put development of the new Java software model support on hold. I did not know this until I read @st_oehme’s post here.
That’s not the case, Gradle is absolutely ready for you @Chris_Dore only mentioned that we put the new Java software model on hold. But building Java projects with the “java” plugin is completely unaffected by this.
To answer your question: Just create a specific configuration for each of your target platforms:
configurations {
arm {
extendsFrom(configurations.compile)
}
}
dependencies {
arm fileTree(dir: 'lib', include: ['*/ARM-.jar'])
}
compileForArm.classpath = configurations.arm