buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.3.+' } tasks.withType(JavaCompile) { options.encoding = "UTF-8"} } apply plugin: 'com.android.application' dependencies { compile fileTree(include: '*.jar', dir: 'libs') compile project(':main') } android { compileSdkVersion xx buildToolsVersion 'xx.x.x' lintOptions { abortOnError false } defaultConfig { minSdkVersion xx targetSdkVersion xx multiDexEnabled true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_x targetCompatibility JavaVersion.VERSION_1_x } packagingOptions { exclude 'META-INF/DEPENDENCIES.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/notice.txt' exclude 'META-INF/license.txt' exclude 'META-INF/dependencies.txt' exclude 'META-INF/LGPL2.1' exclude 'META-INF/ASL2.0' } sourceSets { instrumentTest.setRoot('tests') debug.setRoot('build-types/debug') release.setRoot('build-types/release') } signingConfigs { release { storeFile file("xxx.keystore") storePassword "xxx" keyAlias "xx" keyPassword "xxx" } } dexOptions { preDexLibraries = false } afterEvaluate { tasks.matching { it.name.startsWith('dex') }.each { dx -> if (dx.additionalParameters == null) { dx.additionalParameters = ['--multi-dex'] } else { dx.additionalParameters += '--multi-dex' } } } buildTypes { release { minifyEnabled true proguardFile getDefaultProguardFile('proguard-android.txt') proguardFile 'proguard.cfg' signingConfig signingConfigs.release } debug { } } }
android studio gradle 样例e
最新推荐文章于 2024-05-17 00:24:45 发布