|
| 1 | +/* |
| 2 | + * Copyright 2025 Google LLC |
| 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 | + |
| 17 | +plugins { |
| 18 | + id("com.android.test") |
| 19 | + id("org.jetbrains.kotlin.android") |
| 20 | +} |
| 21 | + |
| 22 | +android { |
| 23 | + val compileSdkVersion: Int by rootProject |
| 24 | + val targetSdkVersion: Int by rootProject |
| 25 | + |
| 26 | + namespace = "com.google.firebase.benchmark.sessions" |
| 27 | + compileSdk = compileSdkVersion |
| 28 | + |
| 29 | + defaultConfig { |
| 30 | + targetSdk = targetSdkVersion |
| 31 | + minSdk = 23 |
| 32 | + |
| 33 | + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
| 34 | + } |
| 35 | + |
| 36 | + buildTypes { |
| 37 | + create("benchmark") { |
| 38 | + isDebuggable = true |
| 39 | + signingConfig = signingConfigs["debug"] |
| 40 | + matchingFallbacks += "release" |
| 41 | + } |
| 42 | + } |
| 43 | + |
| 44 | + compileOptions { |
| 45 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 46 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 47 | + } |
| 48 | + kotlinOptions { jvmTarget = "1.8" } |
| 49 | + |
| 50 | + targetProjectPath = ":firebase-sessions:test-app" |
| 51 | + experimentalProperties["android.experimental.self-instrumenting"] = true |
| 52 | +} |
| 53 | + |
| 54 | +dependencies { |
| 55 | + implementation(libs.androidx.test.junit) |
| 56 | + implementation(libs.androidx.benchmark.macro) |
| 57 | +} |
| 58 | + |
| 59 | +androidComponents { |
| 60 | + beforeVariants(selector().all()) { variantBuilder -> |
| 61 | + variantBuilder.enable = (variantBuilder.buildType == "benchmark") |
| 62 | + } |
| 63 | +} |
0 commit comments