Pilldroid/app/build.gradle

93 lines
2.9 KiB
Groovy
Raw Normal View History

2018-09-27 19:16:52 +02:00
//noinspection GradleCompatible
apply plugin: 'com.android.application'
android {
2020-09-11 21:49:51 +02:00
compileSdkVersion 29
2020-10-03 23:12:47 +02:00
def versionPropsFile = file('version.properties')
def versionBuild
/*Setting default value for versionBuild which is the last incremented value stored in the file */
if (versionPropsFile.canRead()) {
2020-12-07 11:09:03 +01:00
Properties versionProps = new Properties()
2020-10-03 23:12:47 +02:00
versionProps.load(new FileInputStream(versionPropsFile))
versionBuild = versionProps['VERSION_BUILD'].toInteger()
} else {
throw new FileNotFoundException("Could not read version.properties!")
}
/*Wrapping inside a method avoids auto incrementing on every gradle task run. Now it runs only when we build apk*/
ext.autoIncrementBuildNumber = {
if (versionPropsFile.canRead()) {
Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
versionBuild = versionProps['VERSION_BUILD'].toInteger() + 1
versionProps['VERSION_BUILD'] = versionBuild.toString()
versionProps.store(versionPropsFile.newWriter(), null)
} else {
throw new FileNotFoundException("Could not read version.properties!")
}
}
defaultConfig {
applicationId "net.foucry.pilldroid"
2020-05-11 20:49:29 +02:00
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
2020-10-03 23:12:47 +02:00
versionCode 1
versionName "1.0.0." + versionBuild
2020-05-11 20:49:29 +02:00
applicationIdSuffix = 'alpha'
}
2020-10-03 23:12:47 +02:00
buildTypes {
release {
minifyEnabled false
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
2016-11-01 23:17:06 +01:00
productFlavors {
}
2018-09-27 19:16:52 +02:00
compileOptions {
2020-04-12 19:57:10 +02:00
sourceCompatibility JavaVersion.VERSION_1_8
2018-09-27 19:16:52 +02:00
targetCompatibility JavaVersion.VERSION_1_8
}
2019-09-18 23:01:42 +02:00
/*dexOptions {
2019-09-12 18:39:03 +02:00
incremental false
2019-09-18 23:01:42 +02:00
}*/
2020-04-12 19:57:10 +02:00
buildToolsVersion = buildToolsVersion1
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
2020-05-16 19:47:21 +02:00
repositories {
jcenter()
}
2020-05-18 19:08:48 +02:00
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
2019-09-18 23:01:42 +02:00
implementation fileTree(include: ['*.jar'], dir: 'libs')
2020-04-12 19:57:10 +02:00
testImplementation 'junit:junit:4.13'
2020-05-11 20:49:29 +02:00
2020-09-11 11:28:10 +02:00
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
2020-09-30 17:55:52 +02:00
implementation 'com.google.android.material:material:1.2.1'
2020-05-16 19:47:21 +02:00
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
2020-05-11 20:49:29 +02:00
2020-05-16 19:47:21 +02:00
implementation 'com.journeyapps:zxing-android-embedded:4.1.0'
2020-09-11 11:28:10 +02:00
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "com.android.support:support-compat:28.0.0"
2020-09-30 17:55:52 +02:00
debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
2020-10-03 23:12:47 +02:00
2020-12-07 11:09:03 +01:00
implementation 'za.co.riggaroo:materialhelptutorial:'
}