apply plugin: 'com.android.application' //gets the git hash to be used as a version name def getDevName = { -> def stdout = new ByteArrayOutputStream() exec { //commandLine 'git', 'describe', '--tags' commandLine 'git', 'log', '--pretty=format:%cn', '-1' standardOutput = stdout } return stdout.toString().trim() } def getGitHash = { -> def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'log', '--pretty=format:%h', '-1' standardOutput = stdout } return stdout.toString().trim() } def getVersionCode = { -> def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'describe', '--tags' standardOutput = stdout } return stdout.toString().trim() } def computeVersionCode = { -> def strnumber = getVersionCode().replace(".", "") def VersionCode = strnumber.isInteger() ? strnumber.toInteger() : null return VersionCode } android { compileSdkVersion 29 buildToolsVersion '29.0.3' defaultConfig { applicationId "fieldscience.cs.earlham.edu.fieldday" minSdkVersion 26 targetSdkVersion 29 versionName "fieldDay_" + getGitHash() + "_" + getVersionCode() + ".apk" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' debuggable true } buildTypes { applicationVariants.all { variant -> variant.outputs.all { outputFileName = "${variant.name}-${variant.versionName}.apk" } } debug { debuggable true } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.google.android.gms:play-services-drive:17.0.0' implementation 'com.google.android.gms:play-services-auth:19.0.0' implementation 'com.google.android.gms:play-services-base:17.6.0' implementation 'com.google.android.gms:play-services-basement:17.6.0' implementation 'androidx.preference:preference:1.1.1' } productFlavors { } packagingOptions{ exclude 'META-INF/rxjava.properties' exclude 'META-INF/dji-sdk-lib_aar.kotlin_module' exclude 'dji/thirdparty/okhttp3/internal/publicsuffix/publicsuffixes.gz' doNotStrip "*/*/libdjivideo.so" doNotStrip "*/*/libSDKRelativeJNI.so" doNotStrip "*/*/libFlyForbid.so" doNotStrip "*/*/libduml_vision_bokeh.so" doNotStrip "*/*/libyuv2.so" doNotStrip "*/*/libGroudStation.so" doNotStrip "*/*/libFRCorkscrew.so" doNotStrip "*/*/libUpgradeVerify.so" doNotStrip "*/*/libFR.so" doNotStrip "*/*/libDJIFlySafeCore.so" doNotStrip "*/*/libdjifs_jni.so" doNotStrip "*/*/libsfjni.so" doNotStrip "*/*/libDJICommonJNI.so" doNotStrip "*/*/libDJICSDKCommon.so" doNotStrip "*/*/libDJIUpgradeCore.so" doNotStrip "*/*/libDJIUpgradeJNI.so" doNotStrip "*/*/libDJIWaypointV2Core.so" doNotStrip "*/*/libAMapSDK_MAP_v6_9_2.so" doNotStrip "*/*/libDJIMOP.so" doNotStrip "*/*/libDJISDKLOGJNI.so" exclude 'META-INF/rxjava.properties' exclude 'assets/location_map_gps_locked.png' exclude 'assets/location_map_gps_3d.png' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation files('libs/jsoup-1.9.2.jar') implementation 'com.android.support:appcompat-v7' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation ('com.dji:dji-sdk:4.14.1') compileOnly ('com.dji:dji-sdk-provided:4.14.1') // GroundSdk dependencies implementation 'com.parrot.drone.groundsdk:groundsdk:1.7.1' runtimeOnly 'com.parrot.drone.groundsdk:arsdkengine:1.7.1' }