summaryrefslogtreecommitdiff
path: root/library/build.gradle.kts
blob: aa21ace14acead0392c46fe8ba129d471fc44d98 (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
84
85
86
87
88
plugins {
    id("com.android.library")
    kotlin("android")
    kotlin("android.extensions")
}

android {
    compileSdkVersion(28)
    defaultConfig {
        minSdkVersion(26)
        targetSdkVersion(28)

        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        // Specifies the application ID for the test APK.
        testApplicationId = "akono.test"

        ndk {
            // Tells Gradle to build outputs for the following ABIs and package
            // them into your APK.
            abiFilters("armeabi-v7a");
        }

        externalNativeBuild {
            cmake.arguments("-DANDROID_STL=c++_shared")
        }
    }
    useLibrary("android.test.runner")
    useLibrary("android.test.base")
    useLibrary("android.test.mock")

    externalNativeBuild {
        cmake {
            //path = File("src/main/cpp/CMakeLists.txt")
            setPath(file("src/main/cpp/CMakeLists.txt"))
        }
    }

    sourceSets {
        // Work around a bug in the android plugin.
        // Without this extra source set, test cases written in Kotlin are
        // compiled but not executed.
        named("androidTest") {
            java.srcDir("src/androidTest/kotlin")
        }
        // Workaround for AndroidStudio
        named("main") {
            java.srcDir("src/main/kotlin")
            jniLibs.srcDirs("../deps/compiled")

        }
    }
}

val kotlin_version: String by rootProject.extra

repositories {
    jcenter()
}

dependencies {
    //implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.20")
    //implementation(kotlin("stdlib"))

    // Use the Kotlin test library.
    testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version")

    // Use the Kotlin JUnit integration.
    testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")

    androidTestImplementation("androidx.test:core:1.1.0")
    androidTestImplementation("androidx.test:runner:1.1.1")
    androidTestImplementation("androidx.test:rules:1.1.1")

    // Assertions
    androidTestImplementation("androidx.test.ext:junit:1.1.0")
    androidTestImplementation("androidx.test.ext:truth:1.1.0")
    androidTestImplementation("com.google.truth:truth:0.44")

    // Use the Kotlin test library.
    androidTestImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version")

    // Use the Kotlin JUnit integration.
    androidTestImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
    implementation(kotlin("stdlib-jdk7", kotlin_version))
}