Packaging configuration
Apply plugin: ' Com.android.application 'Apply plugin:' Android-apt 'def aaversion= ' 3.2 'Android {compilesdkversion23buildtoolsversion"22.0.1"Defaultconfig {ApplicationID"Com.fifedu.preschool"minsdkversion14targetsdkversion23Versioncode1Versionname"1.0"//Dex exceeds the limit of 65535//multidexenabled True//androidmanifest.xml inside Umeng_channel's VALUE is ${umeng_channel_value}Manifestplaceholders = [Umeng_channel_value: "Channel_name"]} sourcesets {main {manifest.srcfile' Src/main/androidmanifest.xml 'Java.srcdirs= [' Src/main/java '] Resources.srcdirs= [' Src/main/resources '] Aidl.srcdirs= [' Src/main/aidl '] Renderscript.srcdirs= [' Src/main '] Res.srcdirs= [' Src/main/res '] Assets.srcdirs= [' Src/main/assets '] Jnilibs.srcdir' Src/main/jnilibs ' } //Move The tests to Tests/java, tests/res, etc ...Instrumenttest.setroot (' Tests ') //Move The build types to build-types/<type>//For instance, Build-types/debug/java, Build-types/debug/androidmanifest.xml, ...//This moves them out of them default location under src/<type>/... which would//conflict with src/being used by the main source set. //Adding New build types or product flavors should be accompanied//By a similar customization.Debug.setroot (' Build-types/debug ') Release.setroot (' Build-types/release ') } //Perform a lint check, have any errors or warning prompts, will terminate the build, we can turn it off. lintoptions {abortonerrorfalse } //Signaturesigningconfigs {debug {storefile file ("/users/weidingqiang/.android/debug.keystore")} release {//in this case, you have to put the DEMO.JK file in the project directory.StoreFile file ("/users/weidingqiang/.android/key.jks") Storepassword"123456"Keyalias"Hello"Keypassword"123456"}} buildtypes {debug {//Show LogBuildconfigfield "Boolean", "Log_debug", "true"Versionnamesuffix"-debug"minifyenabledfalsezipalignenabledfalseshrinkresourcesfalsesigningconfig Signingconfigs.debug} release {//do not display logBuildconfigfield "Boolean", "Log_debug", "false"//confusingMinifyenabledtrue //zipalign OptimizationZipalignenabledtruemultidexenabledtrue //removing useless resource filesShrinkresourcestrue //The previous section represents a confusing file for the system default Android program, which already contains the basic confusion statementProguardfiles getdefaultproguardfile (' proguard-android.txt '), ' proguard.cfg '//Signaturesigningconfig Signingconfigs.release}}//when turned on, an error must be specified after an input jar, or it would be empty.//I don't know why .//Channel flavors, configure different styles of apps//productflavors {//GooglePlay {}////Xiaomi {}////Umeng {}////_360 {}////Baidu {}////Wandoujia {}// } //Batch ConfigurationProductflavors.all {Flavorflavor.manifestplaceholders=[Umeng_channel_value:name]} compileoptions {sourcecompatibility javaversion.version_1_7 target Compatibility Javaversion.version_1_7} applicationvariants.all {Variant-Variant.outputs.each {Output-def OutputFile=Output.outputfileif(OutputFile! =NULL&& outputFile.name.endsWith ('. apk ')) {def fileName= OutputFile.name.replace (". apk", "-${defaultconfig.versionname}.apk") Output.outputfile=NewFile (Outputfile.parent, FileName)}} }//Buildtypes {//Release {//minifyenabled True//proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' Proguard-rules.pro '// }// }}dependencies {Compile filetree (dir:' Libs ', include: [' *.jar ']) Testcompile' junit:junit:4.12 'Compile' com.android.support:support-v4:23.1.1 'Compile' com.android.support:appcompat-v7:23.1.1 'Apt"Org.androidannotations:androidannotations: $AAVersion"Compile"Org.androidannotations:androidannotations-api: $AAVersion"Compile' com.mcxiaoke.volley:library:1.0.19 'Compile' com.github.bumptech.glide:volley-integration:1.0.+ '//compile ' com.github.bumptech.glide:glide:3.6.1 'Compile ' com.zhy:autolayout:1.3.6 'Compile' de.greenrobot:eventbus:2.4.0 '//Compile files (' Libs/log4j-1.2.17.jar ')//Compile files (' Libs/android-logging-log4j-1.0.3.jar ')//Compile files (' Libs/amap_2dmap_v2.8.0_20151231.jar ')//Compile files (' Libs/amap_location_v2.3.0_20160112.jar ')//Compile files (' Libs/amap_search_v2.8.0_20160105.jar ')}apt {arguments {androidmanifestfile variant.outputs[0].processresources.manifestfile Resourcepackagename"Com.fifedu.preschool" }}
Android Build.grade