Reference to have
What is Gradle
http://www.zhihu.com/question/30432152
Gradle's powerful features, how to implement a set of code to develop different features of the APK by Gradle
http://ghui.me/blog/20150310/create-several-variants-of-an-app-in-gradle/
- Build.gradle files under App
Declares the Android Program//app folder under this module's gradle configuration file, also can be considered the entire project the main gradle configuration file Apply plugin: ' Com.android.application ' Android {compilesdkversion buildtoolsversion "22.0.1" Defaultconfig {//Application package name ApplicationID "Chuiyuan.ls J.androidjava "Minsdkversion targetsdkversion versioncode 1 Versionname" 1.0 "}// If there is a compileoptions, Java version buildtypes {//If there is debug mode//Release mode, you can have different versions of release {/ /whether to confuse minifyenabled false//confuse the location of the file Proguardfiles getdefaultproguardfile (' Proguard-andr Oid.txt '), ' Proguard-rules.pro '}}}//more content reference http://ghui.me/blog/20150310/create-several-variants-of-an-app-in-g radle/dependencies {//Compile Libs directory for all Jar compile filetree (include: [' *.jar '], dir: ' Libs ') compile ' com.android.sup port:appcompat-v7:22.2.1 '///Add JAR file://Copy directly into App.libs, the following line will appear compile files (' Libs/gson-2.2.2.jar ')//compile section Three-party source,import new module, then add the following This is added to the volley, the use is to copy the volley file to the project, so you can see the source//can also directly from the central repo copy//compile ' com.mcxiaoke.volley:library:1.0.19 '/ /If it is below, use the latest version of Volley//compile ' com.mcxiaoke.volley:library:1.0.+ ' Compile project (': Volley ')}
- Build.gradle under the project directory
Top-level build file where can add configuration options common to all sub-projects/modules.//gradle base profile for entire project Buil Dscript { repositories { ///ago is Mavencenter (), Jcenter () is a new remote repository and performs better, compatible with MAVEN warehouse jcenter () } The version of Gradle was declared dependencies { classpath ' com.android.tools.build:gradle:1.3.0 ' //Note:do not place your application dependencies here; They belong //In the individual module Build.gradle files }}allprojects { repositories { jcenter () }}
- The Settings.gradle below project
Global project configuration file, which mainly declare some need to join the Gradle module//here: The app is a module, if you join the other also have to indicate include ': App ', ': Volley '//Add third party source, sometimes used/ /project (': volly '). ProjectDir = new File (' volly ')
Android Studio Gradle Use-(1)