| // This build file illustrates how to apply ProGuard in the Android build |
| // process, with ProGuard's own plugin instead of the built-in minification |
| // support of the Android Gradle plugin. |
| buildscript { |
| repositories { |
| //flatDir dirs: '../../lib' // For the local copy of the ProGuard plugin. |
| google() // For the Android Gradle plugin. |
| jcenter() // For anything else. |
| } |
| dependencies { |
| //classpath ':proguard:' // For the local copy of the ProGuard plugin. |
| classpath 'net.sf.proguard:proguard-gradle:6.2.2' // For the copy from Jcenter. |
| classpath 'com.android.tools.build:gradle:3.3.0' |
| } |
| } |
| |
| apply plugin: 'com.android.application' |
| apply plugin: 'proguard' |
| |
| android { |
| compileSdkVersion 28 |
| |
| signingConfigs { |
| debug { |
| storeFile file('debug.keystore') |
| storePassword 'android' |
| keyAlias 'androiddebugkey' |
| keyPassword 'android' |
| } |
| } |
| |
| defaultConfig { |
| signingConfig signingConfigs.debug |
| } |
| |
| sourceSets { |
| main { |
| manifest.srcFile 'AndroidManifest.xml' |
| java.srcDirs = ['src'] |
| resources.srcDirs = ['src'] |
| aidl.srcDirs = ['src'] |
| renderscript.srcDirs = ['src'] |
| res.srcDirs = ['res'] |
| assets.srcDirs = ['assets'] |
| } |
| } |
| |
| buildTypes { |
| // We can now use ProGuard's tuned Android configuration files |
| // instead of the default ones from the Android SDK. |
| debug { |
| minifyEnabled false |
| proguardFile getTunedProGuardFile('proguard-android-debug.pro') |
| proguardFile 'proguard-project.txt' |
| } |
| release { |
| minifyEnabled false |
| proguardFile getTunedProGuardFile('proguard-android-release.pro') |
| proguardFile 'proguard-project.txt' |
| } |
| } |
| } |
| |
| repositories { |
| google() // For the Android plugin. |
| jcenter() // For anything else. |
| } |