Gradle File Analysis--androidstudio Learning

Source: Internet
Author: User

Project name/app/build.gradle file analysis

//statement is an Android programApply plugin: ' Com.android.application 'Android {//compiling the SDK versionCompilesdkversion 21//version of Build toolsBuildtoolsversion "21.1.1"Defaultconfig {//app's package nameApplicationID "Com.example.siyuan.helloandroid"//Minimum Android versionMinsdkversion 14//Target Android version, these parts are similar to the original manifest fileTargetsdkversion 21Versioncode1Versionname"1.0.0"    }    //Java versioncompileoptions {sourcecompatibility javaversion.version_1_7 targetcompatibility JavaVersion.VERSION _1_7} buildtypes {release {//whether to confuseMinifyenabledfalse            //confusing the location of a file//proguardfiles This section has two paragraphs, the previous part represents the system default Android program confusion file, the file already contains the basic confusion statement, eliminates me//a lot of things, thisThe directory of the files in the <SDK directory >/tools/proguard/proguard-android.txt, the latter part is the custom obfuscation//files in our project,the catalogue is in the App/proguard-rules.txt,
If you create a new project with Studio 1.0, the default generated file name is Proguard-rules.pro, and the name is not closed
.
Department,
In this file you can declare some confusion rules that are dependent on some third parties. The result of the final confusion is that the two parts of the file work together.
Proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' proguard-rules.txt ' } } //Remove the error from the lint checklintoptions {abortonerrorfalse}}dependencies {//compiling all jar packages under the Libs directoryCompile Filetree (dir: ' Libs ', include: [' *.jar ']) Compile' com.android.support:support-v4:21.0.2 'Compile' com.etsy.android.grid:library:1.0.5 'Compile' com.alexvasilkov:foldable-layout:1.0.1 '//compiling the Shimmerandroid module under the Extras directoryCompile project (': Extras:shimmerandroid '))}

Add later, package release, and multi-channel packaging configuration instructions.

Gradle File Analysis--androidstudio Learning

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.