VSTS | TFS 2018 | TFS 2017 | TFS 2015
Build using a Gradle wrapper script
The location in the repository of the gradlew wrapper used for the build. For agents on Windows (including hosted agents), you must use the
See The Gradle Wrapper.
Specify any command line options you want to pass to the Gradle wrapper.
See Gradle Command Line.
The task(s) for Gradle to execute. A list of tasks can be taken from
|JUnit Test Results|
|Publish to VSTS/TFS||Select this option to publish JUnit Test results produced by the Gradle build to VSTS/TFS.|
|Test Results Files||Test results files path. Wildcards can be used. For example,
|Test Run Title||Assign a title for the JUnit test case results for this build.|
|Code Coverage Tool||Choose a code coverage tool to determine the code that is covered by the test cases for the build.|
|Working Directory||Directory on the build agent where the Gradle wrapper will be invoked from. Defaults to the repository root.|
|Set JAVA_HOME by JDK Version||Choose which JDK level to run Gradle with. Will attempt to find JDK version and assign JAVA_HOME before running Gradle.|
|Set JAVA_HOME by Path||Directory on build agent where JDK is located.|
|JDK Architecture||Optionally supply the architecture (x86, x64) of JDK.||Code Analysis|
|Run SonarQube Analysis||Select if you want to run a SonarQube analysis. See The Gradle build task now supports SonarQube analysis.|
|Run PMD Analysis||Select if you want to perform a PMD static analysis. A build result page for each project is shown on the Artifacts tab of the completed build. See Gradle build task now also supports PMD analysis.|
|Run Checkstyle Analysis||Select if you want to perform a Checkstyle static analysis The build summary reports the number of issues found by Checkstyle. Detailed issue logs are available under the build Artifact tab of the build summary. If the Checkstyle analysis is customized, the task only attempts to find the reports and produce a summary.|
- task: Gradle@2 inputs: # gradleWrapperFile: gradlew options: # tasks: build workingDirectory: # publishJUnitResults: true # testResultsFiles: **/build/test-results/TEST-*.xml testRunTitle: # codeCoverageToolOption: None # None (default), Cobertura, JaCoCo # codeCoverageClassFilesDirectories: build/classes/main/ codeCoverageClassFilter: # codeCoverageFailIfEmpty: false # javaHomeOption: JDKVersion # JDKVersion (default), Path # jdkVersionOption: default # default (default), 1.9, 1.8, 1.7, 1.6 jdkDirectory: # jdkArchitectureOption: x64 # x86, x64 (default) # gradleOptions: -Xmx1024m # sonarQubeRunAnalysis: false # sqGradlePluginVersionChoice: specify # specify (default), build # sonarQubeGradlePluginVersion: 2.6.1 # checkStyleRunAnalysis: false # findBugsRunAnalysis: false # pmdRunAnalysis: false
How do I generate a wrapper from my Gradle project?
The Gradle wrapper allows the build agent to download and configure the exact Gradle environment that is checked into the repoistory without having any software configuration on the build agent itself other than the JVM.
Create the Gradle wrapper by issuing the following command from the root project directory where your build.gradle resides:
jamal@fabrikam> gradle wrapper
Upload your Gradle wrapper to your remote repository.
There is a binary artifact that is generated by the gradle wrapper ( located at
gradle/wrapper/gradle-wrapper.jar). This binary file is small and doesn't require updating. If you need to change the Gradle configuration run on the build agent, you update the
The repository should look something like this:
|-- gradle/ `-- wrapper/ `-- gradle-wrapper.jar `-- gradle-wrapper.properties |-- src/ |-- .gitignore |-- build.gradle |-- gradlew |-- gradlew.bat
How do I build an Android project?
Do I need an agent?
You need at least one agent to run your build or release. Get an agent.