//noinspection GradleCompatible apply plugin: 'com.android.application' ext.versionMajor = 1 ext.versionMinor = 2 ext.versionPatch = 3 ext.versionClassifier = null ext.isSnapshot = true ext.minimumSdkVersion = 28 ext.git_version= ("git rev-parse --short HEAD".execute().text.trim()) android { compileSdkVersion 29 defaultConfig { applicationId "net.foucry.pilldroid" minSdkVersion defaultMinSdkVersion targetSdkVersion defaultTargetSdkVersion versionCode generateVersionCode() // 190010203 versionName generateVersionName() // 1.2.3-SNAPSHOT } buildTypes { release { minifyEnabled false //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } /*dexOptions { incremental false }*/ buildToolsVersion = buildToolsVersion1 allprojects { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } } } repositories { jcenter() } 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.1.0' implementation 'com.google.android.material:material:1.3.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.journeyapps:zxing-android-embedded:4.1.0' implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.core:core:1.3.2' debugImplementation 'com.amitshekhar.android:debug-db:1.0.6' } 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 }