Feature request: @PlatformBinaries

software-model

(David Cowden) #1

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).