build.gradle 3.94 KB
Newer Older
1
apply plugin: 'com.android.application'
2
//gets the git hash to be used as a version name
3
def getDevName = { ->
4
    def stdout = new ByteArrayOutputStream()
5
    exec {
6
        //commandLine 'git', 'describe', '--tags'
7
        commandLine 'git', 'log', '--pretty=format:%cn', '-1'
8
        standardOutput = stdout
9
    }
10
11
    return stdout.toString().trim()
}
12
def getGitHash = { ->
13
    def stdout = new ByteArrayOutputStream()
14
    exec {
15
16
17
18
19
20
21
        commandLine 'git', 'log', '--pretty=format:%h', '-1'
        standardOutput = stdout
    }
    return stdout.toString().trim()
}
def getVersionCode = { ->
    def stdout = new ByteArrayOutputStream()
22
    exec {
23
24
25
26
27
        commandLine 'git', 'describe', '--tags'
        standardOutput = stdout
    }
    return stdout.toString().trim()
}
28
29
def computeVersionCode = { ->
    def strnumber = getVersionCode().replace(".", "")
30
31
32
33
    def VersionCode = strnumber.isInteger() ? strnumber.toInteger() : null

    return VersionCode
}
34
android {
35
    compileSdkVersion 29
36
    buildToolsVersion '29.0.3'
37
38
    defaultConfig {
        applicationId "fieldscience.cs.earlham.edu.fieldday"
39
        minSdkVersion 26
40
        targetSdkVersion 29
41
        versionName "fieldDay_" + getGitHash() + "_" + getVersionCode() + ".apk"
42

43
44
45
46
47
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
Craig Earley's avatar
Craig Earley committed
48
            debuggable true
49
        }
50
51
        buildTypes {
            applicationVariants.all { variant ->
52
53
                variant.outputs.all {
                    outputFileName = "${variant.name}-${variant.versionName}.apk"
54
55
56
                }
            }
            debug {
Craig Earley's avatar
Craig Earley committed
57
                debuggable true
58
            }
59
60
        }
    }
61
    dependencies {
62
        implementation fileTree(dir: 'libs', include: ['*.jar'])
63
        implementation 'com.google.android.gms:play-services-drive:17.0.0'
Craig Earley's avatar
Craig Earley committed
64
65
66
67
        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'
68
    }
69
70
    productFlavors {
    }
71
72
73
74
    packagingOptions{
        exclude 'META-INF/rxjava.properties'
        exclude 'META-INF/dji-sdk-lib_aar.kotlin_module'
        exclude 'dji/thirdparty/okhttp3/internal/publicsuffix/publicsuffixes.gz'
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
        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'
98
99

    }
100
101
102
103
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
104
105
}
dependencies {
106
    implementation files('libs/jsoup-1.9.2.jar')
107
    implementation 'com.android.support:appcompat-v7'
Craig Earley's avatar
Craig Earley committed
108
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
109
    implementation ('com.dji:dji-sdk:4.14.1')
110
111
112
113
    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'
114
}