update build.gradle

This commit is contained in:
dkanada 2019-07-11 14:37:33 -07:00
commit d9f3ececc5
12 changed files with 7 additions and 445 deletions

View file

@ -1,90 +1,37 @@
import javax.annotation.Nullable
apply plugin: 'com.android.application'
static def gitBranch() {
def branch = 'GitHub'
try {
def gitcheck = 'command -v git >/dev/null 2>&1'.execute()
gitcheck.waitFor()
if (gitcheck.exitValue() == 0) {
def proc = 'git rev-parse --abbrev-ref HEAD'.execute()
proc.in.eachLine { line -> branch = line }
proc.err.eachLine { line -> println line }
proc.waitFor()
}
} catch (Exception e) {
// Do nothing
println e
}
branch
}
def getProperties(String fileName) {
final Properties properties = new Properties()
def file = file(fileName)
if (file.exists()) {
file.withInputStream { stream -> properties.load(stream) }
}
return properties
}
static def getProperty(@Nullable Properties properties, String name) {
return properties.getProperty(name) ?: "$name missing"
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
renderscriptTargetApi 28
vectorDrawables.useSupportLibrary = true
applicationId 'com.kabouzeid.gramophone'
versionCode 175
versionName '1.3.1'
}
signingConfigs {
release {
Properties properties = getProperties('/Users/karim/Documents/Phonograph/privatekeys/keystore.properties')
storeFile file(getProperty(properties, 'storeFile'))
keyAlias getProperty(properties, 'keyAlias')
storePassword getProperty(properties, 'storePassword')
keyPassword getProperty(properties, 'keyPassword')
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
applicationIdSuffix '.debug'
versionNameSuffix ' DEBUG (' + gitBranch() + ')'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
lintOptions {
disable 'MissingTranslation'
disable 'InvalidPackage'
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Required for IntroActivity
dataBinding {
enabled = true
}
}
dependencies {
@ -100,7 +47,7 @@ dependencies {
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.annotation:annotation:1.0.2'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.preference:preference:1.0.0'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'