Files
coco 723ce1af5c a
2026-07-03 15:12:48 +08:00

80 lines
2.2 KiB
Kotlin

/*
* Copyright (C) 2022 Patrick Goldinger
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Suppress needed until https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed
@file:Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.agp.test)
alias(libs.plugins.kotlin.android)
}
android {
namespace = "dev.patrickgold.florisboard.benchmark"
compileSdk = 32
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
defaultConfig {
minSdk = 24
targetSdk = 32
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
sourceSets {
maybeCreate("main").apply {
java {
srcDirs("src/main/kotlin")
}
}
}
}
buildTypes {
// This benchmark buildType is used for benchmarking, and should function like your
// release build (for example, with minification on). It"s signed with a debug key
// for easy local/CI testing.
create("benchmark") {
isDebuggable = true
signingConfig = getByName("debug").signingConfig
matchingFallbacks += listOf("release")
}
}
targetProjectPath = ":app"
experimentalProperties["android.experimental.self-instrumenting"] = true
}
dependencies {
implementation(libs.androidx.test.ext)
implementation(libs.androidx.test.espresso.core)
implementation(libs.androidx.test.uiautomator)
implementation(libs.androidx.benchmark.macro)
}
androidComponents {
beforeVariants(selector().all()) {
it.enable = it.buildType == "benchmark"
}
}