apply plugin: 'com.android.application' def cmd = 'git rev-list HEAD --first-parent --count' def gitVersion = cmd.execute().text.trim().toInteger() def cmd2 = 'git describe --tags' def version = cmd2.execute().text.trim() android { compileSdkVersion 31 defaultConfig { applicationId "me.yoqi.calculator" minSdkVersion 16 targetSdkVersion 31 versionCode gitVersion versionName version testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' }