76 lines
2.1 KiB
Groovy
76 lines
2.1 KiB
Groovy
// This build file illustrates how to apply ProGuard in the Android build
|
|
// process with AGP < 7, by swapping the built-in version of ProGuard for a newer version.
|
|
|
|
// This process relies on setting `android.enableR8=false` in `gradle.properties`,
|
|
// which is deprecated. For AGP7, please see the `android-plugin` example.
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenLocal() // For local testing
|
|
google() // For the Android plugin.
|
|
mavenCentral() // For anything else.
|
|
}
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:4.1.3'
|
|
}
|
|
configurations.all {
|
|
resolutionStrategy {
|
|
// Override the default version of ProGuard with the most recent one.
|
|
dependencySubstitution {
|
|
substitute module('net.sf.proguard:proguard-gradle') with module('com.guardsquare:proguard-gradle:7.3.0')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
compileSdkVersion 28
|
|
|
|
signingConfigs {
|
|
debug {
|
|
storeFile file('debug.keystore')
|
|
storePassword 'android'
|
|
keyAlias 'androiddebugkey'
|
|
keyPassword 'android'
|
|
}
|
|
}
|
|
|
|
defaultConfig {
|
|
minSdkVersion 11
|
|
targetSdkVersion 28
|
|
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 {
|
|
debug {
|
|
minifyEnabled false
|
|
shrinkResources false
|
|
}
|
|
release {
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
|
|
proguardFile 'proguard-project.txt'
|
|
}
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
google() // For the Android plugin.
|
|
mavenCentral() // For anything else.
|
|
}
|