Specifies the gradlew wrapper's location within the repository that will be used for the build. Agents on Windows (including Microsoft-hosted agents) must use the gradlew.bat wrapper. Agents on Linux or macOS can use the gradlew shell script. Learn more about the Gradle Wrapper.
options - Options string.
Specifies the command line options that will be passed to the Gradle wrapper. See Gradle Command Line for more information.
The task(s) for Gradle to execute. A list of task names should be separated by spaces and can be taken from gradlew tasks issued from a command prompt.
workingDirectory - Working Directory
Input alias: cwd. string.
Specifies the working directory to run the Gradle build. The task uses the repository root directory if the working directory is not specified.
publishJUnitResults - Publish to TFS/Team Services boolean. Default value: true.
Publishes JUnit test results produced by the Gradle build to Azure Pipelines. The task publishes each test results file matching Test Results Files as a test run in Azure Pipelines.
testResultsFiles - Test Results Files string. Required when publishJUnitResults = true. Default value: **/build/test-results/TEST-*.xml.
The file path for test results. Wildcards can be used. For example, **/TEST-*.xml for all XML files whose name starts with TEST-.
testRunTitle - Test Run Title string. Optional. Use when publishJUnitResults = true.
Provides a name for the JUnit test case results for this build.
Specifies a code coverage tool to determine the code that is covered by the test cases for the build.
codeCoverageClassFilesDirectories - Class Files Directories
Input alias: classFilesDirectories. string. Required when codeCoverageTool = false. Default value: build/classes/main/.
The comma-separated list of directories containing class files and archive files (.jar, .war, and more). Code coverage is reported for class files in these directories. Normally, the task searches classes under build/classes/java/main (for Gradle 4+), which is the default class directory for Gradle builds.
codeCoverageClassFilter - Class Inclusion/Exclusion Filters
Input alias: classFilter. string. Optional. Use when codeCoverageTool != None.
The comma-separated list of filters to include or exclude classes from collecting code coverage. For example: +:com.*,+:org.*,-:my.app*.*.
codeCoverageFailIfEmpty - Fail When Code Coverage Results Are Missing
Input alias: failIfCoverageEmpty. boolean. Optional. Use when codeCoverageTool != None. Default value: false.
Fails the build if code coverage did not produce any results to publish.
javaHomeOption - Set JAVA_HOME by
Input alias: javaHomeSelection. string. Required. Allowed values: JDKVersion (JDK Version), Path. Default value: JDKVersion.
Sets JAVA_HOME by selecting a JDK version that the task discovers during builds or by manually entering a JDK path.
Sets the GRADLE_OPTS environment variable, which is used to send command-line arguments to start the JVM. The xmx flag specifies the maximum memory available to the JVM.
sonarQubeSpecifyDB - The SonarQube server version is lower than 5.2
Input alias: sqDbDetailsRequired. boolean. Optional. Use when sqAnalysisEnabled = true. Default value: false.
SonarQube server 5.1 and lower only. Specifies the database connection details.
sonarQubeDBUrl - Db Connection String
Input alias: sqDbUrl. string. Optional. Use when sqDbDetailsRequired = true.
SonarQube server version 5.1 and lower only. Enters the database connection setting, that is sonar.jdbc.url. For example: jdbc:jtds:sqlserver://localhost/sonar;SelectMethod=Cursor.
sonarQubeDBUsername - Db Username
Input alias: sqDbUsername. string. Optional. Use when sqDbDetailsRequired = true.
SonarQube server 5.1 and lower only. Enters the username for the database user, that is sonar.jdbc.username.
sonarQubeDBPassword - Db User Password
Input alias: sqDbPassword. string. Optional. Use when sqDbDetailsRequired = true.
SonarQube server 5.1 and lower only. Enter the password for the database user, that is sonar.jdbc.password.
sonarQubeIncludeFullReport - Include full analysis report in the build summary (SQ 5.3+)
Input alias: sqAnalysisIncludeFullReport. boolean. Optional. Use when sqAnalysisEnabled = true. Default value: true.
Delays the build until the SonarQube analysis is completed.
sonarQubeFailWhenQualityGateFails - Fail the build on quality gate failure (SQ 5.3+)
Input alias: sqAnalysisBreakBuildIfQualityGateFailed. boolean. Optional. Use when sqAnalysisEnabled = true.
SonarQube server version 5.3 or above only. Introduces delays as the build must wait for SonarQube to complete the analysis. Learn more about using SonarQube for builds.
Uses the FindBugs static analysis tool to look for bugs in the code. Results are uploaded as build artifacts. In Gradle 6.0, this plugin was removed. Use the SpotBugs plugin instead.
There is a newer version of this task available at Gradle@3.
Piezīme
There is a newer version of this task available at Gradle@2.
Configuration of the SonarQube analysis was moved to the SonarQube or SonarCloud extensions in the task Prepare Analysis Configuration.
Use this task to build using a Gradle wrapper script.
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 repository 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 gradle-wrapper.properties.
How do I fix timeouts when downloading dependencies?
To fix errors such as Read timed out when downloading dependencies, users of Gradle 4.3+ can change the timeout by adding -Dhttp.socketTimeout=60000 -Dhttp.connectionTimeout=60000 to Options. This increases the timeout from 10 seconds to 1 minute.
Pievienojieties meetup sērijai, lai kopā ar citiem izstrādātājiem un ekspertiem izveidotu mērogojamus AI risinājumus, kuru pamatā ir reālas lietošanas gadījumi.