Components have binaries. A single component can define multiple platforms off of which binaries are created. It would be nice to be able to define the type of binary spec that should be used for a given platform. For example, if I am building for the Android platform, I might want to be able to define an AndroidBinarySpec so that I can iterate over binaries.withType(AndroidBinarySpec) instead of writing a big method filled with if statements when iterating over all binaries. Further, the spec could be used as more than just a marker type. You could attach platform-specific information to the spec so that the binary’s compiler flags can be configured appropriately later (since we’re supposed to avoid using toolchains/targets for that purpose). I know something like this is in the works (according to the documentation) for build types and flavors. Another option might just be to allow a platform to define compiler flags (instead of the toolchain target since toolchain is supposed to not matter).
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| [New software model] Controlling which binaries apply to a component | 2 | 1015 | February 4, 2016 | |
| Is there a way to extend a source set for a specific binary variant only? | 2 | 1200 | January 12, 2015 | |
| Toolchains always try to build for the current platform and x86[_64] architectures | 1 | 1150 | March 13, 2016 | |
| General docs on ComponentSpecs, Binaries, Platform, Toolchain etc | 2 | 581 | August 20, 2015 | |
| How do I restrict Gradle native binary build based on combination of flavour, platform and build type? | 1 | 2559 | September 16, 2014 |