build-parameters icon indicating copy to clipboard operation
build-parameters copied to clipboard

Allow for customization of project property source

Open mcwhitak opened this issue 2 years ago • 6 comments

Currently a Gradle project property can be used as a source for a buildParameter but the property name is identical to the buildParameter path <group>.<property>.

This causes problems when overriding properties from the environment (via ORG_GRADLE_PROJECT_<propName>) as *nix systems cannot use . in environment variable names. Much like the fromEnvironment method accepts a source variable name, it would be great if we could override a "source property name" as well.

It could be via an propertyAlias function that would fall back on the alias property name if the original property was unset.

The primary use case for overriding properties via environment variables is in unified CICD systems where abstracting on top of Gradle lifecycle tasks may still require individual projects to override their own pipeline/environment variables.

mcwhitak avatar Aug 15 '22 20:08 mcwhitak