blob: 921cb59d56f38552688644a6377e577e4826a9ac [file] [log] [blame]
/*
* Copyright (C) 2020 The Android Open Source Project
*
* 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.
*/
/**
* This file was created using the `create_project.py` script located in the
* `<AndroidX root>/development/project-creator` directory.
*
* Please use that script when creating a new project, rather than copying an existing project and
* modifying its settings.
*/
import androidx.build.KotlinTarget
import androidx.build.LibraryType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("AndroidXPlugin")
id("com.android.library")
id("kotlin-android")
}
android {
defaultConfig {
minSdk = 23
// The package name is passed to the app as an instrumentation runner argument.
// Set default target package at runtime. This could also be set by baseline profile
// gradle plugin, but that's not used here.
testInstrumentationRunnerArguments["androidx.benchmark.targetPackageName"] =
"androidx.benchmark.integration.macrobenchmark.target"
// We don't care about perf from these correctness tests, so suppress
// anything that may otherwise block these tests
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] =
"CODE-COVERAGE,DEBUGGABLE,EMULATOR,LOW-BATTERY,UNLOCKED"
// these extra payload values are used in test.
testInstrumentationRunnerArguments["androidx.benchmark.output.payload.simpleValue"] =
"simple_value"
}
namespace = "androidx.benchmark.macro.junit4"
}
dependencies {
api(libs.junit)
api(libs.kotlinStdlib)
api("androidx.annotation:annotation:1.8.1")
api(project(":benchmark:benchmark-macro"))
api("androidx.test.uiautomator:uiautomator:2.3.0")
implementation(project(":benchmark:benchmark-common"))
implementation("androidx.test:rules:1.5.0")
implementation("androidx.test:runner:1.5.2")
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.kotlinTest)
androidTestImplementation(libs.truth)
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
// Enable using experimental APIs from within same version group
freeCompilerArgs += [
"-opt-in=androidx.benchmark.ExperimentalBenchmarkConfigApi",
"-opt-in=androidx.benchmark.macro.ExperimentalMetricApi",
"-opt-in=androidx.benchmark.perfetto.ExperimentalPerfettoCaptureApi",
]
}
}
androidx {
name = "Benchmark - Macrobenchmark JUnit4"
type = LibraryType.PUBLISHED_LIBRARY
inceptionYear = "2020"
description = "Android Benchmark - Macrobenchmark JUnit4"
legacyDisableKotlinStrictApiMode = true
deviceTests {
targetAppProject = project(":benchmark:integration-tests:macrobenchmark-target")
targetAppVariant = "release"
}
kotlinTarget = KotlinTarget.KOTLIN_1_9
samples(project(":benchmark:benchmark-samples"))
}