Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 1 | /* |
| 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 Song | ee0da74 | 2024-01-03 14:08:46 -0800 | [diff] [blame] | 17 | /** |
| 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 Ismail | 8c545f7 | 2024-08-21 17:45:15 +0100 | [diff] [blame] | 24 | |
| 25 | import androidx.build.KotlinTarget |
Omar Ismail | 86e6606 | 2024-05-03 16:10:50 +0100 | [diff] [blame] | 26 | import androidx.build.LibraryType |
Rahul Ravikumar | 6da9b7f27 | 2021-10-20 13:52:42 -0700 | [diff] [blame] | 27 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 28 | |
| 29 | plugins { |
| 30 | id("AndroidXPlugin") |
| 31 | id("com.android.library") |
| 32 | id("kotlin-android") |
| 33 | } |
| 34 | |
| 35 | android { |
| 36 | defaultConfig { |
Aurimas Liutikas | 7795282 | 2024-12-04 18:00:17 -0800 | [diff] [blame] | 37 | minSdk = 23 |
Chris Craik | 98343e4 | 2024-09-10 16:45:29 -0700 | [diff] [blame] | 38 | |
| 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 Boyar | 1edea95 | 2024-09-18 11:20:04 -0700 | [diff] [blame] | 49 | // these extra payload values are used in test. |
| 50 | testInstrumentationRunnerArguments["androidx.benchmark.output.payload.simpleValue"] = |
Yigit Boyar | f264174 | 2024-09-27 08:51:37 -0700 | [diff] [blame] | 51 | "simple_value" |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 52 | } |
Aurimas Liutikas | 7795282 | 2024-12-04 18:00:17 -0800 | [diff] [blame] | 53 | namespace = "androidx.benchmark.macro.junit4" |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | dependencies { |
Aurimas Liutikas | 2c1a81e | 2021-05-24 16:43:05 -0700 | [diff] [blame] | 57 | api(libs.junit) |
| 58 | api(libs.kotlinStdlib) |
Aurimas Liutikas | 96f0b30 | 2024-07-25 15:49:23 -0700 | [diff] [blame] | 59 | api("androidx.annotation:annotation:1.8.1") |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 60 | api(project(":benchmark:benchmark-macro")) |
Aurimas Liutikas | 2fcab673 | 2024-10-07 17:14:16 -0700 | [diff] [blame] | 61 | api("androidx.test.uiautomator:uiautomator:2.3.0") |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 62 | implementation(project(":benchmark:benchmark-common")) |
Chris Craik | 4a801eb | 2023-03-27 12:28:16 -0700 | [diff] [blame] | 63 | implementation("androidx.test:rules:1.5.0") |
Rahul Ravikumar | 8c943b8 | 2023-09-12 14:42:57 -0700 | [diff] [blame] | 64 | implementation("androidx.test:runner:1.5.2") |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 65 | |
Aurimas Liutikas | 2c1a81e | 2021-05-24 16:43:05 -0700 | [diff] [blame] | 66 | androidTestImplementation(libs.testExtJunit) |
Chris Craik | 98343e4 | 2024-09-10 16:45:29 -0700 | [diff] [blame] | 67 | androidTestImplementation(libs.testRules) |
Aurimas Liutikas | 2c1a81e | 2021-05-24 16:43:05 -0700 | [diff] [blame] | 68 | androidTestImplementation(libs.testRunner) |
Chris Craik | 98343e4 | 2024-09-10 16:45:29 -0700 | [diff] [blame] | 69 | androidTestImplementation(libs.kotlinTest) |
| 70 | androidTestImplementation(libs.truth) |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 71 | } |
| 72 | |
Chris Craik | 5d5db95 | 2024-04-11 15:04:05 -0700 | [diff] [blame] | 73 | tasks.withType(KotlinCompile).configureEach { |
| 74 | kotlinOptions { |
| 75 | // Enable using experimental APIs from within same version group |
| 76 | freeCompilerArgs += [ |
Jakub Gielzak | 09fae38 | 2024-06-14 19:12:34 +0100 | [diff] [blame] | 77 | "-opt-in=androidx.benchmark.ExperimentalBenchmarkConfigApi", |
Chris Craik | 5d5db95 | 2024-04-11 15:04:05 -0700 | [diff] [blame] | 78 | "-opt-in=androidx.benchmark.macro.ExperimentalMetricApi", |
Jakub Gielzak | 09fae38 | 2024-06-14 19:12:34 +0100 | [diff] [blame] | 79 | "-opt-in=androidx.benchmark.perfetto.ExperimentalPerfettoCaptureApi", |
Chris Craik | 5d5db95 | 2024-04-11 15:04:05 -0700 | [diff] [blame] | 80 | ] |
| 81 | } |
| 82 | } |
| 83 | |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 84 | androidx { |
Alan Viverette | c9e1fd7 | 2023-05-08 17:36:59 -0400 | [diff] [blame] | 85 | name = "Benchmark - Macrobenchmark JUnit4" |
Omar Ismail | 86e6606 | 2024-05-03 16:10:50 +0100 | [diff] [blame] | 86 | type = LibraryType.PUBLISHED_LIBRARY |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 87 | inceptionYear = "2020" |
| 88 | description = "Android Benchmark - Macrobenchmark JUnit4" |
Aurimas Liutikas | 5c5419a | 2024-05-29 15:26:58 -0700 | [diff] [blame] | 89 | legacyDisableKotlinStrictApiMode = true |
Chris Craik | 98343e4 | 2024-09-10 16:45:29 -0700 | [diff] [blame] | 90 | deviceTests { |
| 91 | targetAppProject = project(":benchmark:integration-tests:macrobenchmark-target") |
| 92 | targetAppVariant = "release" |
| 93 | } |
Omar Ismail | 8c545f7 | 2024-08-21 17:45:15 +0100 | [diff] [blame] | 94 | kotlinTarget = KotlinTarget.KOTLIN_1_9 |
Chris Craik | f051b4f | 2024-12-04 12:40:22 -0800 | [diff] [blame] | 95 | samples(project(":benchmark:benchmark-samples")) |
Chris Craik | fbfc721 | 2021-01-27 11:54:18 -0800 | [diff] [blame] | 96 | } |