apply plugin: 'com.android.application' buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.4.2' } } allprojects { repositories { google() jcenter() } } def getVersionCode = { -> try { def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'rev-list', 'HEAD', '--count' standardOutput = stdout } return Integer.parseInt(stdout.toString().trim()) } catch (ignored) { return -1; } } def getVersionName = { -> try { def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'describe', '--tags', '--dirty' standardOutput = stdout } return stdout.toString().trim() } catch (ignored) { return null; } } android { compileSdkVersion 28 defaultConfig { applicationId "de.dennisguse.opentracks" //Useful for debugging. //versionCode getVersionCode() //versionName getVersionName() minSdkVersion 21 targetSdkVersion 28 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { debug { applicationIdSuffix ".debug" versionNameSuffix "-debug" } release { minifyEnabled true } } applicationVariants.all { variant -> variant.resValue "string", "applicationId", variant.applicationId } //TODO: Should be removed (when LINT does not throw any errors). lintOptions { abortOnError false } } dependencies { implementation 'androidx.appcompat:appcompat:1.0.2' androidTestImplementation 'androidx.test:core:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test:rules:1.2.0' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'org.mockito:mockito-android:3.0.0' testImplementation 'androidx.test:core:1.2.0' testImplementation 'org.mockito:mockito-core:3.0.0' }