|
1 | | -/* |
2 | | - * This buildscript block is optional - it's only needed if you need one of the blocks of code inside it. |
3 | | - */ |
4 | | -buildscript { |
5 | | - /* |
6 | | - * This block is optional, and it shows one way to override properties based on an environment property that is |
7 | | - * set when calling Gradle. For example, you could run "gradle -Penv=qa mlDeploy" in order to apply the env-qa.gradle |
8 | | - * build file, which would set properties based on the QA environment. This doesn't have anything to do with ml-gradle - |
9 | | - * it just shows one technique for overriding properties. See env-prod.gradle and env-qa.gradle for more details. |
10 | | - * |
11 | | - * Also see https://github.com/stevesaliman/gradle-properties-plugin for an elegant way of supporting properties files |
12 | | - * for different environments. |
13 | | - */ |
14 | | - if (project.hasProperty("env")) { |
15 | | - def buildFile = "env-" + project.property("env") + ".gradle" |
16 | | - println "Applying environment-based build file: " + buildFile |
17 | | - apply from: buildFile |
18 | | - } |
19 | | - |
20 | | - /* |
21 | | - * This is another optional block, and it's a similar technique to the block above, but it instead is used for local |
22 | | - * development. A developer can create a non-version-controlled local.gradle file and, within that file, override any |
23 | | - * properties that are defined in gradle.properties. This also isn't specific to ml-gradle - it's just one way with |
24 | | - * Gradle to allow a developer to easily override gradle.properties for local development purposes. |
25 | | - * |
26 | | - * Also see https://github.com/stevesaliman/gradle-properties-plugin for an elegant way of supporting properties files |
27 | | - * for different environments. |
28 | | - */ |
29 | | - if (new File("local.gradle").exists()) { |
30 | | - println "Applying local.gradle file" |
31 | | - apply from: "local.gradle" |
32 | | - println "Applied local.gradle file" |
33 | | - } |
34 | | -} |
35 | | - |
36 | | - |
37 | 1 | /* |
38 | 2 | * In order to use ml-gradle, it must be applied. This occurs after the two above blocks for overriding properties so |
39 | 3 | * that those blocks can override properties before ml-gradle initializes itself. |
|
0 commit comments