66 lines
1.9 KiB
Plaintext
66 lines
1.9 KiB
Plaintext
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|
|
|
plugins {
|
|
id("com.android.library")
|
|
id("kotlin-android")
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation(kotlin("test"))
|
|
testImplementation(Libs.JUnit.jupiter)
|
|
testImplementation(Libs.JUnit.jupiterApi)
|
|
testImplementation(Libs.json)
|
|
testImplementation(Libs.Mockito.jupiter)
|
|
testImplementation(Libs.Mockito.kotlin)
|
|
testImplementation(Libs.jodaTime)
|
|
testImplementation(Libs.Google.truth)
|
|
testImplementation(Libs.jsonAssert)
|
|
|
|
androidTestImplementation(Libs.AndroidX.Test.espressoCore)
|
|
androidTestImplementation(Libs.AndroidX.Test.extKtx)
|
|
androidTestImplementation(Libs.AndroidX.Test.rules)
|
|
androidTestImplementation(Libs.Google.truth)
|
|
androidTestImplementation(Libs.AndroidX.Test.uiAutomator)
|
|
androidTestImplementation(Libs.Mockito.core)
|
|
androidTestImplementation(Libs.Mockito.android)
|
|
androidTestImplementation(Libs.Mockito.kotlin)
|
|
}
|
|
|
|
tasks.withType<Test> {
|
|
// use to display stdout in travis
|
|
testLogging {
|
|
// set options for log level LIFECYCLE
|
|
events = setOf(
|
|
TestLogEvent.FAILED,
|
|
TestLogEvent.STARTED,
|
|
TestLogEvent.SKIPPED,
|
|
TestLogEvent.STANDARD_OUT
|
|
)
|
|
exceptionFormat = TestExceptionFormat.FULL
|
|
useJUnitPlatform()
|
|
}
|
|
}
|
|
|
|
tasks.withType<Test>().configureEach {
|
|
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
|
forkEvery = 20
|
|
}
|
|
|
|
android {
|
|
testOptions {
|
|
unitTests {
|
|
isReturnDefaultValues = true
|
|
isIncludeAndroidResources = true
|
|
}
|
|
}
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
excludes += "META-INF/COPYRIGHT"
|
|
excludes += "META-INF/LICENSE.md"
|
|
excludes += "META-INF/LICENSE-notice.md"
|
|
}
|
|
}
|
|
}
|