The root build.gradle script includes several global configuration closures. These closures are executed once when you run your build (as opposed to the tasks in the allprojects closure, which get executed for each project).

excludeNonDevBuildTasks

The excludeNonDevBuild configuration closure retrieves the Boolean value of the devBuild property, which is set either in the gradle.properties file or on the command line when Gradle is run. If the value is true, the build is run as normal and all tasks and task dependencies are executed. If the value is false, several development-related tasks are excluded from the build process. Out of the box, the tasks to exclude are test (unit tests) and jshint (JavaScript formatting and syntax checking).

setDynamoClasspath

The setDynamoClasspath configuration closure builds the Dynamo classpath using a custom ant task (atg.applauncher.taskdef.DynamoClasspathTask). The requiredPlatformModules property of the root gradle.properties file defines the Oracle Commerce Platform modules that are included the Dynamo classpath. Out of the box, this property looks like this:

requiredPlatformModules=\
    DCS.ADC;DAF.Endeca.Assembler;DAF.Endeca.Index;DPS-UI;SiteAdmin.Versioned
setDynamoHome

The setDynamoHome configuration closure sets the dynamoHome value to be used by the build scripts. The dynamoHome value is obtained from one of three locations:

If the dynamoHome value cannot be determined from any of the above locations, the build fails.

setProxy

The setProxy configuration closure retrieves the httpProxy and httpsProxy property values from the gradle.properties file and assigns them to a global proxySettings variable. This global variable can then be used in Exec tasks (tasks that run executables on the command line). For example, the bowerInstall task must retrieve packages from across the network, so it requires the proxySettings variable. The syntax for specifying an Exec task that uses the proxySettings variable is:

task('myExecTask', type: Exec) {
    environment proxySettings;
    commandLine cmd|cmd.bat, "cmdArg"
}

Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices