mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-10 07:51:20 +01:00
135 lines
No EOL
3.7 KiB
Groovy
135 lines
No EOL
3.7 KiB
Groovy
//noinspection GradleCompatible
|
|
apply plugin: 'com.android.application'
|
|
|
|
ext.versionMajor = 0
|
|
ext.versionMinor = 60
|
|
ext.versionPatch = 20211115
|
|
ext.versionClassifier = null
|
|
ext.isSnapshot = false
|
|
ext.minimumSdkVersion = defaultMinSdkVersion
|
|
ext.git_version= ("git rev-parse --short HEAD".execute().text.trim())
|
|
|
|
android {
|
|
signingConfigs {
|
|
release {
|
|
}
|
|
prerelease {
|
|
storeFile file('/home/jacques/.config/keystore')
|
|
storePassword 'nifgk/Cr'
|
|
keyAlias 'prerelase'
|
|
keyPassword 'nifgk/Cr'
|
|
}
|
|
}
|
|
compileSdkVersion 29
|
|
|
|
defaultConfig {
|
|
applicationId "net.foucry.pilldroid"
|
|
minSdkVersion defaultMinSdkVersion
|
|
targetSdkVersion defaultTargetSdkVersion
|
|
versionCode generateVersionCode() // 190010203
|
|
versionName generateVersionName() // 1.2.3-SNAPSHOT
|
|
multiDexEnabled true
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
minifyEnabled false
|
|
debuggable true
|
|
applicationIdSuffix ".debug"
|
|
}
|
|
release {
|
|
minifyEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
debuggable false
|
|
}
|
|
prerelease {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
debuggable false
|
|
signingConfig signingConfigs.prerelease
|
|
}
|
|
}
|
|
flavorDimensions "version"
|
|
productFlavors {
|
|
dev {
|
|
resValue "string", "app_name", "PillDroid dev"
|
|
dimension ="version"
|
|
}
|
|
|
|
product {
|
|
resValue "string", "app_name", "PillDroid"
|
|
dimension ="version"
|
|
}
|
|
preproduct {
|
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
|
dimension ="version"
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
coreLibraryDesugaringEnabled true
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
dexOptions {
|
|
incremental false
|
|
javaMaxHeapSize "4g"
|
|
}
|
|
|
|
allprojects {
|
|
tasks.withType(JavaCompile) {
|
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
|
}
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
|
}
|
|
}
|
|
}
|
|
dependencies {
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
testImplementation 'junit:junit:4.13.2'
|
|
|
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
|
implementation 'com.google.android.material:material:1.4.0'
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
|
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
|
implementation 'androidx.core:core:1.6.0'
|
|
|
|
// debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
|
|
|
|
implementation 'io.sentry:sentry-android:5.4.0'
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
|
}
|
|
|
|
private Integer generateVersionCode() {
|
|
return ext.minimumSdkVersion * 10000000 + ext.versionMajor * 10000 + ext.versionMinor * 100 + ext.versionPatch
|
|
}
|
|
|
|
private String generateVersionName() {
|
|
String versionName = "${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
|
|
if (ext.versionClassifier == null && ext.isSnapshot) {
|
|
ext.versionClassifier = "SNAPSHOT"
|
|
}
|
|
|
|
if (ext.versionClassifier != null) {
|
|
versionName += "-" + ext.versionClassifier
|
|
}
|
|
|
|
if (ext.git_version != null) {
|
|
versionName += "-" + ext.git_version
|
|
}
|
|
|
|
print "Version name = " + versionName
|
|
return versionName
|
|
} |