90 lines
2.7 KiB
Groovy
90 lines
2.7 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
|
|
android {
|
|
compileSdkVersion 29
|
|
buildToolsVersion "35.0.1"
|
|
|
|
defaultConfig {
|
|
applicationId "io.github.sankalp.lunox"
|
|
minSdkVersion 14
|
|
targetSdkVersion 29
|
|
versionCode 19
|
|
versionName "0.19"
|
|
//resConfigs "en", "de"
|
|
buildConfigField "boolean", "enableColorSniffer", "false"
|
|
}
|
|
buildTypes {
|
|
debug {
|
|
def workingBranch = getGitWorkingBranch()
|
|
def normalizedWorkingBranch = workingBranch.replaceFirst("^[^A-Za-z]+", "").replaceAll("[^0-9A-Za-z]+", "")
|
|
if (normalizedWorkingBranch.isEmpty() || workingBranch == "master" ) {
|
|
applicationIdSuffix ".debug"
|
|
resValue "string", "app_name", "Last Launcher Dev"
|
|
} else {
|
|
archivesBaseName = 'Last_Launcher_' + normalizedWorkingBranch
|
|
applicationIdSuffix ".debug." + normalizedWorkingBranch
|
|
resValue "string", "app_name", "Last Launcher-" + workingBranch
|
|
}
|
|
|
|
debuggable true
|
|
jniDebuggable true
|
|
versionNameSuffix "-debug"
|
|
minifyEnabled false
|
|
shrinkResources false
|
|
|
|
}
|
|
release {
|
|
debuggable false
|
|
jniDebuggable false
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
zipAlignEnabled true
|
|
resValue "string", "app_name", "Last Launcher"
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
lintOptions {
|
|
checkReleaseBuilds false
|
|
abortOnError false
|
|
}
|
|
|
|
applicationVariants.all { variant ->
|
|
variant.outputs.all {
|
|
def date = new Date()
|
|
def formattedDate = date.format('yyyyMMddHHmmss')
|
|
outputFileName = "Last-Launcher-${variant.name}-${variant.versionName}-${formattedDate}.apk"
|
|
}
|
|
}
|
|
packagingOptions {
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
implementation project(':flowlayout:layouts')
|
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'
|
|
}
|
|
|
|
static String getGitWorkingBranch() {
|
|
try {
|
|
def gitProcess = "git rev-parse --abbrev-ref HEAD".execute()
|
|
gitProcess.waitFor()
|
|
if (gitProcess.exitValue() == 0) {
|
|
return gitProcess.text.trim()
|
|
} else {
|
|
// .git folder not present
|
|
return ""
|
|
}
|
|
} catch (IOException ignored) {
|
|
// git is not installed
|
|
return ""
|
|
}
|
|
}
|