Open inktomi opened 1 year ago
Thank you for sharing this use case. @britter and I will discuss this and get back to this.
@inktomi this doesn't look like a parameter a build user would pass. It looks like one that is automatically passed by some tooling. Why are you modelling it as a build parameter? Is it to get around the parameter validation that will fail the build in case an unknown parameter is passed?
The use case we have is that we want to know when a build is running inside a developer's IDE. In that case, we can skip gradle plugins and other logic that's not needed for developer builds. Android Studio (and other IDEs I'm sure) inject properties like android.injected.invoked.from.ide
when they're executing a build.
So, this is about a parameter that the IDE injects. It's not something that a developer would pass via the command line. Again, why are you modeling this as a build parameter? This plugin is really about parameters meant to be passed by developers to they build from the command line.
Do you want the compile-safe accessor to write some conditional local reacting to it?
When working with builds, sometimes we cannot control the names that variables have. For instance, when running a build from Android Studio a flag is passed called "android.injected.invoked.from.ide".
It would be great to be able to read that into builds in a better way than miss-using groups:
Would it be possible to simplify this in any way? Could build-parameters allow for renaming properties perhaps? For example, it would be nicer if we could define this like: