I've been thinking about this a bit as part of some experiments.
My current thinking is that for it to generalize properly, you need two things:
- a high level key/value way of specifying settings
- a series of mappings which convert/transform them so that they can be supplied in whatever form any given tool requires
For example you might specify something like the minimum platform setting as
but you want to be able to then transform it depending on what you're doing.
When invoking the Swift compiler you want it to be transformed to
"-Xswiftc", "-target", "-Xswiftc", "x86_64-apple-macosx10.12".
But you might also want to generate an xcconfig (as part of
swift package generate-xcodeproj), in which case you'd want it to be transformed into
MACOSX_DEPLOYMENT_TARGET = "10.12".
You might also want to pass it to a bundler tool to inject the same value into the Info.plist file, in which case you'd probably need another transformation again.
And so on...