------------------------------------------------------------ Tasks runnable from root project ------------------------------------------------------------
Android tasks ------------- androidDependencies - Displays the Android dependencies of the project. signingReport - Displays the signing info for the base and test modules sourceSets - Prints out all the source sets defined in thisproject.
Build tasks ----------- assemble - Assemble main outputs for all the variants. assembleAndroidTest - Assembles all the Test applications. build - Assembles and tests thisproject. buildDependents - Assembles and tests thisproject and all projects that depend on it. buildNeeded - Assembles and tests thisproject and all projects it depends on. bundle - Assemble bundles for all the variants. clean - Deletes the build directory. cleanBuildCache - Deletes the build cache directory. compileDebugAndroidTestSources compileDebugSources compileDebugUnitTestSources compileReleaseSources compileReleaseUnitTestSources
Build Setup tasks ----------------- init - Initializes a new Gradle build. wrapper - Generates Gradle wrapper files.
Cleanup tasks ------------- lintFix - Runs lint on all variants and applies any safe suggestions to the source code.
Help tasks ---------- buildEnvironment - Displays all buildscriptdependencies declared in root project'Hello'. components - Displays the components produced by root project'Hello'. [incubating] dependencies - Displays all dependencies declared in root project'Hello'. dependencyInsight - Displays the insight into a specific dependency in root project'Hello'. dependentComponents - Displays the dependent components of components in root project'Hello'. [incubating] help - Displays a help message. model - Displays the configuration model of root project'Hello'. [incubating] projects - Displays the sub-projects of root project'Hello'. properties - Displays the properties of root project'Hello'. tasks - Displays the tasks runnable from root project'Hello' (some of the displayed tasks may belong to subprojects).
Install tasks ------------- installDebug - Installs the Debug build. installDebugAndroidTest - Installs the android (on device) tests for the Debug build. uninstallAll - Uninstall all applications. uninstallDebug - Uninstalls the Debug build. uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build. uninstallRelease - Uninstalls the Release build.
Verification tasks ------------------ check - Runs all checks. connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices. connectedCheck - Runs all device checks on currently connected devices. connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices. deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers. deviceCheck - Runs all device checks using Device Providers and Test Servers. lint - Runs lint on all variants. lintDebug - Runs lint on the Debug build. lintRelease - Runs lint on the Release build. lintVitalRelease - Runs lint on just the fatal issues in the release build. test - Run unit tests for all variants. testDebugUnitTest - Run unit tests for the debug build. testReleaseUnitTest - Run unit tests for the release build.
To see all tasks and more detail, run gradlew tasks --all
dependencies(Closure configureClosure) Configures the dependenciesfor the script. repositories(Closure configureClosure) Configures the repositoriesfor the script dependencies.
Example shows a basic way of declaring dependencies.
apply plugin: 'java' //so that we can use 'implementation', 'testImplementation' for dependencies
dependencies { //for dependencies found in artifact repositories you can use //the group:name:version notation implementation 'commons-lang:commons-lang:2.6' testImplementation 'org.mockito:mockito:1.9.0-rc1'