blob: 921cb59d56f38552688644a6377e577e4826a9ac [file] [log] [blame]
Chris Craikfbfc7212021-01-27 11:54:18 -08001/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Tiem Songee0da742024-01-03 14:08:46 -080017/**
18 * This file was created using the `create_project.py` script located in the
19 * `<AndroidX root>/development/project-creator` directory.
20 *
21 * Please use that script when creating a new project, rather than copying an existing project and
22 * modifying its settings.
23 */
Omar Ismail8c545f72024-08-21 17:45:15 +010024
25import androidx.build.KotlinTarget
Omar Ismail86e66062024-05-03 16:10:50 +010026import androidx.build.LibraryType
Rahul Ravikumar6da9b7f272021-10-20 13:52:42 -070027import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Chris Craikfbfc7212021-01-27 11:54:18 -080028
29plugins {
30 id("AndroidXPlugin")
31 id("com.android.library")
32 id("kotlin-android")
33}
34
35android {
36 defaultConfig {
Aurimas Liutikas77952822024-12-04 18:00:17 -080037 minSdk = 23
Chris Craik98343e42024-09-10 16:45:29 -070038
39 // The package name is passed to the app as an instrumentation runner argument.
40 // Set default target package at runtime. This could also be set by baseline profile
41 // gradle plugin, but that's not used here.
42 testInstrumentationRunnerArguments["androidx.benchmark.targetPackageName"] =
43 "androidx.benchmark.integration.macrobenchmark.target"
44
45 // We don't care about perf from these correctness tests, so suppress
46 // anything that may otherwise block these tests
47 testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] =
48 "CODE-COVERAGE,DEBUGGABLE,EMULATOR,LOW-BATTERY,UNLOCKED"
Yigit Boyar1edea952024-09-18 11:20:04 -070049 // these extra payload values are used in test.
50 testInstrumentationRunnerArguments["androidx.benchmark.output.payload.simpleValue"] =
Yigit Boyarf2641742024-09-27 08:51:37 -070051 "simple_value"
Chris Craikfbfc7212021-01-27 11:54:18 -080052 }
Aurimas Liutikas77952822024-12-04 18:00:17 -080053 namespace = "androidx.benchmark.macro.junit4"
Chris Craikfbfc7212021-01-27 11:54:18 -080054}
55
56dependencies {
Aurimas Liutikas2c1a81e2021-05-24 16:43:05 -070057 api(libs.junit)
58 api(libs.kotlinStdlib)
Aurimas Liutikas96f0b302024-07-25 15:49:23 -070059 api("androidx.annotation:annotation:1.8.1")
Chris Craikfbfc7212021-01-27 11:54:18 -080060 api(project(":benchmark:benchmark-macro"))
Aurimas Liutikas2fcab6732024-10-07 17:14:16 -070061 api("androidx.test.uiautomator:uiautomator:2.3.0")
Chris Craikfbfc7212021-01-27 11:54:18 -080062 implementation(project(":benchmark:benchmark-common"))
Chris Craik4a801eb2023-03-27 12:28:16 -070063 implementation("androidx.test:rules:1.5.0")
Rahul Ravikumar8c943b82023-09-12 14:42:57 -070064 implementation("androidx.test:runner:1.5.2")
Chris Craikfbfc7212021-01-27 11:54:18 -080065
Aurimas Liutikas2c1a81e2021-05-24 16:43:05 -070066 androidTestImplementation(libs.testExtJunit)
Chris Craik98343e42024-09-10 16:45:29 -070067 androidTestImplementation(libs.testRules)
Aurimas Liutikas2c1a81e2021-05-24 16:43:05 -070068 androidTestImplementation(libs.testRunner)
Chris Craik98343e42024-09-10 16:45:29 -070069 androidTestImplementation(libs.kotlinTest)
70 androidTestImplementation(libs.truth)
Chris Craikfbfc7212021-01-27 11:54:18 -080071}
72
Chris Craik5d5db952024-04-11 15:04:05 -070073tasks.withType(KotlinCompile).configureEach {
74 kotlinOptions {
75 // Enable using experimental APIs from within same version group
76 freeCompilerArgs += [
Jakub Gielzak09fae382024-06-14 19:12:34 +010077 "-opt-in=androidx.benchmark.ExperimentalBenchmarkConfigApi",
Chris Craik5d5db952024-04-11 15:04:05 -070078 "-opt-in=androidx.benchmark.macro.ExperimentalMetricApi",
Jakub Gielzak09fae382024-06-14 19:12:34 +010079 "-opt-in=androidx.benchmark.perfetto.ExperimentalPerfettoCaptureApi",
Chris Craik5d5db952024-04-11 15:04:05 -070080 ]
81 }
82}
83
Chris Craikfbfc7212021-01-27 11:54:18 -080084androidx {
Alan Viverettec9e1fd72023-05-08 17:36:59 -040085 name = "Benchmark - Macrobenchmark JUnit4"
Omar Ismail86e66062024-05-03 16:10:50 +010086 type = LibraryType.PUBLISHED_LIBRARY
Chris Craikfbfc7212021-01-27 11:54:18 -080087 inceptionYear = "2020"
88 description = "Android Benchmark - Macrobenchmark JUnit4"
Aurimas Liutikas5c5419a2024-05-29 15:26:58 -070089 legacyDisableKotlinStrictApiMode = true
Chris Craik98343e42024-09-10 16:45:29 -070090 deviceTests {
91 targetAppProject = project(":benchmark:integration-tests:macrobenchmark-target")
92 targetAppVariant = "release"
93 }
Omar Ismail8c545f72024-08-21 17:45:15 +010094 kotlinTarget = KotlinTarget.KOTLIN_1_9
Chris Craikf051b4f2024-12-04 12:40:22 -080095 samples(project(":benchmark:benchmark-samples"))
Chris Craikfbfc7212021-01-27 11:54:18 -080096}