How to set classifier for CppLibConventionPlugin and CppExeConventionPlugin


(Matt Fair) #1

After looking at both CppLibConventionPlugin.groovy and CppExeConventionPlugin.groovy in src/org/gradle/plugins/cpp, classifier for exe is set to null and “so” for lib. Neither of these classifiers are useful for multi-platform builds, is there a way to set the classifier to something better? For example, I’d like to have classifier include platform information (i.e. Ubuntu-Oneiric-x86_64, RHEL-7-x86_64, Windows-XP-x86_32, Windows-7-x86_64, OSX-10.7-x86_64, etc).


(Luke Daley) #2

At the moment you can’t, which is a limitation of the current support.

We don’t feel the classifiers are the right mechanism for this. For example, you cannot have different metadata for different artifacts that differ only by classifier. It’s easy to imagine a situation where a platform variant has different dependency requirements to another platform variant and this would completely breakdown using classifiers.


(Matt Fair) #3

Luke, thank you for the info.

From crawling the web it appears that some people have been at least partially successful using Ant and IVY to store C++ native compiled results by using IVY configurations to separate out the different artifacts for the different platforms.

http://mail-archives.apache.org/mod_mbox/ant-ivy-user/201104.mbox/<FC28BDC007C04141969BD4EAAFEC60F129B2FB8F5C@NP1EXMB012.corp.halliburton.com>

http://mail-archives.apache.org/mod_mbox/ant-ivy-user/201104.mbox/<FC28BDC007C04141969BD4EAAFEC60F129B2FB8F60@NP1EXMB012.corp.halliburton.com>

Is there a way to get this to work within Gradle?


(Luke Daley) #4

Not right now unfortunately.

See this recent dev list post for some info on where this stuff is at.