Gradle is a dependency management tool, based on the groovy language, which is oriented toward Java applications, which discards the cumbersome configuration of XML-based, and replaces it with a groovy-based internal domain-specific (DSL) language.
The build tool is a collection of functions such as compiling, running, signing, packing, relying, managing, etc. of your project, and the traditional building tools are Make,ant,maven,lvy and so on.
And Gradle is a new generation of automated building tools, which is a standalone project, unrelated to As,android.
There is a build.gradle file in the root directory of the project, which has a code like this:
Classpath ' com.android.tools.build:gradle:2.1.3 '
This is the code that relies on the Gradle plug-in, the following version number represents the version of Android Gradle plugin, not gradle version, as equipped with Android Gradle plugin this plugin,
We can use the Gradle build tool in as.
1.Project Build.gradle This file describes which module (s) are included in project
2.Project Build.gradle This file describes the repositories referenced by the Gradle build and the most basic dependencies
3.Module Build.gradle This file describes some of the configuration of the main module
Build.gradle (Module:app)//This build.gradle describes primarily the configuration of the main moudle
dependencies {
Dependent libraries for modules
Compile Filetree (include: [' *.jar '], dir: ' Libs ')
Local dependent libraries
Testcompile ' junit:junit:4.12 '
Compile ' com.android.support:appcompat-v7:24.1.1 '
Remote dependent Library, formatted as Group:name:version
Compile ' com.android.support:cardview-v7:24.1.1 '
Compile ' com.android.support:design:24.1.1 '
}
4.Gradle Wrapper
Gradle wrapper literally understood as Gradle's wrapper, Android Studio uses Gradle wrapper to fully embed the Gradle Android plugin.
Reference: http://www.jcodecraeer.com/a/anzhuokaifa/Android_Studio/2016/0216/3969.html
Android Studio gradle Build Script