summaryrefslogtreecommitdiff
path: root/android/sdl_android/build.gradle
blob: c600dd6dd0d36f11a5b60201e5c2f3e2f5785ac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
apply plugin: 'com.android.library'
import org.apache.tools.ant.taskdefs.condition.Os


android {
    compileSdkVersion 29
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 14
        versionName new File(projectDir.path, ('/../../VERSION')).text.trim()
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        resValue "string", "SDL_LIB_VERSION", '\"' + versionName + '\"'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            multiDexEnabled true
        }
        debug {
            testCoverageEnabled = true
            multiDexEnabled true
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    lintOptions {
        abortOnError false
    }

    testOptions {
        unitTests.returnDefaultValues = true
    }

    sourceSets {
        if(Os.isFamily(Os.FAMILY_WINDOWS)){
            //The buildWindowsSymLinks task must be run first if this is
            //being compiled on a Windows machine
            main.java.srcDirs += '../../baseAndroid/windows/src/main/java'
        }else{
            main.java.srcDirs += '../../baseAndroid/src/main/java'
        }
    }
}

task buildWindowSymLinks(type:Exec){

    workingDir '../../baseAndroid'

    commandLine 'cmd', '/c', 'make_symlinks.lnk'
}

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])
    api 'com.smartdevicelink:bson_java_port:1.2.0'
    api 'com.livio.taskmaster:taskmaster:0.3.0'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-core:2.9.0'
    androidTestImplementation 'org.mockito:mockito-core:2.9.0'
    androidTestImplementation 'org.mockito:mockito-android:2.9.0'
    api 'com.android.support:support-annotations:28.0.0'
    api "android.arch.lifecycle:extensions:1.1.1"
    annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
}

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
    }
}

apply from: 'bintray.gradle'