[GRADLE-2475] System properties can only be passed to buildSrc build if there is an irrelevant settings.gradle above Created: 12/Sep/12 Updated: 22/Mar/16 Resolved: 22/Mar/16
|Reporter:||Luke Daley||Assignee:||Pepper Lebeck-Jobe|
Create a project with a buildSrc/build.gradle…
Running gradle -Dprop=foo will give you property: null.
If you create a settings file at ../settings.gradle that does not include the original project and rerun gradle -Dprop=foo you will get property: foo.
It's not clear what the expected behaviour is (i.e. can you pass system properties to buildSrc builds?), but this difference in behaviour is weird.
|Comment by Luke Daley [ 13/Sep/12 ]|
|Comment by Eric Deandrea [ 18/Mar/14 ]|
I would like to see this fixed. I'm trying to control the base url of the maven repository via a -D parameter & our buildSrc project applies the same custom plugins as the main build which knows how to set up the correct maven repositories to use for the build. Why should the buildSrc project behave any differently? Shouldn't the same custom plugin my gradle distro has be able to be applied in the buildSrc project as in the main project itself?
|Comment by Ryan Ernst [ 17/Mar/16 ]|
I tracked this down and opened a PR to fix it: https://github.com/gradle/gradle/pull/597