You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.5 KiB
66 lines
2.5 KiB
plugins {
|
|
id("com.android.library")
|
|
id("kotlin-android")
|
|
}
|
|
|
|
android {
|
|
setCompileSdkVersion(property("compileSdkVersion") as Int)
|
|
defaultConfig {
|
|
setMinSdkVersion(property("minSdkVersion") as Int)
|
|
setTargetSdkVersion(property("targetSdkVersion") as Int)
|
|
versionCode = 1
|
|
versionName = "2.7.1"
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
testInstrumentationRunnerArgument("filter", "" +
|
|
"com.otaliastudios.cameraview.tools.SdkExcludeFilter," +
|
|
"com.otaliastudios.cameraview.tools.SdkIncludeFilter")
|
|
}
|
|
buildTypes["debug"].isTestCoverageEnabled = true
|
|
buildTypes["release"].isMinifyEnabled = false
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation("junit:junit:4.13")
|
|
testImplementation("org.mockito:mockito-inline:2.28.2")
|
|
|
|
androidTestImplementation("androidx.test:runner:1.4.0")
|
|
androidTestImplementation("androidx.test:rules:1.4.0")
|
|
androidTestImplementation("androidx.test.ext:junit:1.1.3")
|
|
androidTestImplementation("org.mockito:mockito-android:2.28.2")
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
|
|
|
|
api("androidx.exifinterface:exifinterface:1.3.2")
|
|
api("androidx.lifecycle:lifecycle-common:2.3.1")
|
|
api("com.google.android.gms:play-services-tasks:17.2.1")
|
|
implementation("androidx.annotation:annotation:1.2.0")
|
|
implementation("com.otaliastudios.opengl:egloo:0.6.1")
|
|
}
|
|
|
|
// Code Coverage
|
|
val buildDir = project.buildDir.absolutePath
|
|
val coverageInputDir = "$buildDir/coverage_input" // changing? change github workflow
|
|
val coverageOutputDir = "$buildDir/coverage_output" // changing? change github workflow
|
|
|
|
// Run unit tests, with coverage enabled in the android { } configuration.
|
|
// Output will be an .exec file in build/jacoco.
|
|
tasks.register("runUnitTests") { // changing name? change github workflow
|
|
dependsOn("testDebugUnitTest")
|
|
doLast {
|
|
copy {
|
|
from("$buildDir/jacoco/testDebugUnitTest.exec")
|
|
into("$coverageInputDir/unit_tests") // changing? change github workflow
|
|
}
|
|
}
|
|
}
|
|
|
|
// Run android tests with coverage.
|
|
tasks.register("runAndroidTests") { // changing name? change github workflow
|
|
dependsOn("connectedDebugAndroidTest")
|
|
doLast {
|
|
copy {
|
|
from("$buildDir/outputs/code_coverage/debugAndroidTest/connected")
|
|
include("*coverage.ec")
|
|
into("$coverageInputDir/android_tests") // changing? change github workflow
|
|
}
|
|
}
|
|
}
|
|
|