Gradle (1)---detailed

Source: Internet
Author: User
Tags data structures jcenter
1, Gradle directory resolution

Gradle is based on Groovy language and is oriented to Java applications. An automated build tool based on DSL (domain-specific language) syntax.
Gradle This tool integrates construction, testing, publishing, and other functions such as software packaging, generating annotation documents, and more.
Before eclipse used ant to build the software, it needed to configure a lot of XML, but it was not needed in Gradle.

The current mainstream packaging methods are ant,maven,gradle. Gradle is an automated building tool developed in recent years to address the cumbersome code on ant builds.
For example, when you publish a multi-channel package on ant, you need to write your own script to replace the channel name, but you don't need it in gradle. Built-in support for multi-channel packaging. 2, the Gradle file structure

./build.gradle.
/gradle.properties.
/gradlew
/gradlew.bat.
/local.properties
./ Setting.gradle.
/xxx.iml.
/app/build.gradle
/app/app.iml.
/app/proguard-rules.pro
3./builld.gradle and/app/build.grade

Gradle the configuration file to read when the project is automatically compiled. For example, specify the project's dependency package.
There are two build.grade, one is global, the other is inside the module.
The global Build.grade is mainly set to declare the warehouse source, gradle version number description, and so on.

./build.gradle

Buildscript {
    repositories {
        //Declaration warehouse source, for example, we built an Android library and now want to upload the library to Jcenter for others to use, you can upload it to jcenter
        // Detailed upload steps See: http://www.jcodecraeer.com/a/anzhuokaifa/Android_Studio/2015/0227/2502.html
        jcenter ()
    }
    dependencies {
        //Description Gradle version number
        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
    }//

All items inherit this configuration
allprojects {
    repositories {
        mavenlocal ()
        jcenter ()
    }
}

./app/build.grade set up the module's gradle build configuration

Description of this module is an Android project, if it is a multiple module development, there may be values for Java/war Apply plugin: ' com.android.application '//configuration of all Android built parameters Android {//compile to make Buildtoolsversion "23.0.1" Defaultconfig {//package name A with SDK version compilesdkversion 23//Compilation tool version Pplicationid "Com.awesomeproject"//SDK Minimum support version minsdkversion 16//target SDK version, if the target device API version is exactly equal to this value, will not
        Open compatibility Check for this program Targetsdkversion 22//Version number Versioncode 1 Versionname "1.0"//native NDK {abifilters "armeabi-v7a", "x86"}} buildtypes {//Publish settings Rele ASE {//whether to confuse minifyenabled false//confuse using file Proguardfiles Getdefaultprog Uardfile (' Proguard-android.txt '), ' Proguard-rules.pro '}}//Dependent toolkit dependencies {compile Filetree (di R: ' Libs ', include: [' *.jar ']) compile ' com.android.support:appcompat-v7:23.0.0 ' compile ' com.facebook.react:react -native:0.11.+ '}
4, other documents

./app/proguard-rules.pro
This is the same as the above, confusing file

./gradle.properties
Grade the configuration of the operating environment, such as how much memory to use.

./gradlew and./gradlew.bat
Automatically completes the Gradle environment the script, under the Linux and the Mac direct operation Gradlew will automatically complete the GRADLE environment construction.

./local.properties
Configure the SDK or NDK environment path, which may be different on each machine, so it should not go into the version library

./setting.gradle
Management of the entire project, such as which modules are included in the project.

./XXX.IML and./app/app.iml
IML is a IntelliJ module file. IntelliJ is a Java IDE. Android Studio is an IDE developed based on the open source IntelliJ idea.
So the IDE features of Android Studio need to have a. iML to use. For example, if we delete the iML file, we may not see some catalogs in Android studio.

————————————————————————————————————————————————— – Java Architect Project Combat, high concurrency cluster distributed, large data high availability video tutorials, total 760G

Download Address:

https://item.taobao.com/item.htm?id=555888526201

01. High-level architect 42 Phases
02.Java Advanced System Training Architecture Course 148 hours
03.Java Senior Internet Architect Course
04.Java Internet Architecture Netty, Nio, Mina, etc.-Video tutorials
05.Java Advanced Architecture Design 2016 finishing-video tutorials
06. Architect Foundation, advanced film
07.Java Architect Required Linux Operation series courses
08.Java Advanced System Training Architecture Course 116 hours
+
Hadoop series tutorials, Java design patterns and data structures, Spring Cloud Micro service, Springboot Primer

—————————————————————————————————————————————————–

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.