| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 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 | |
| Jeff Gaston | 193c6f1 | 2019-07-24 14:03:09 -0400 | [diff] [blame] | 17 | import androidx.build.BuildServerConfigurationKt |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 18 | import androidx.build.CompilationTarget |
| 19 | import androidx.build.LibraryGroups |
| 20 | import androidx.build.LibraryVersions |
| Aurimas Liutikas | 75e93a0 | 2019-05-28 16:31:38 -0700 | [diff] [blame] | 21 | import androidx.build.Publish |
| Aurimas Liutikas | e587806 | 2019-12-04 15:10:08 -0800 | [diff] [blame] | 22 | import androidx.build.SdkResourceGenerator |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 23 | |
| 24 | import static androidx.build.dependencies.DependenciesKt.* |
| 25 | |
| Aurimas Liutikas | 65d3d60 | 2019-04-01 23:08:13 -0700 | [diff] [blame] | 26 | plugins { |
| 27 | id("AndroidXPlugin") |
| 28 | id("kotlin") |
| 29 | id("java-gradle-plugin") |
| 30 | } |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 31 | |
| Jeff Gaston | 9cfb0a1 | 2019-11-06 17:50:14 -0500 | [diff] [blame] | 32 | apply from: "../../buildSrc/kotlin-dsl-dependency.gradle" |
| 33 | |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 34 | dependencies { |
| Jeff Gaston | 9cfb0a1 | 2019-11-06 17:50:14 -0500 | [diff] [blame] | 35 | implementation findGradleKotlinDsl() |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 36 | implementation gradleApi() |
| Dustin Lam | 2b3b04f | 2019-12-19 22:44:13 +0000 | [diff] [blame] | 37 | implementation("com.android.tools.build:gradle:3.6.0-beta05") |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 38 | implementation(KOTLIN_STDLIB) |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 39 | |
| 40 | testImplementation gradleTestKit() |
| Dustin Lam | 2628d11 | 2019-04-08 12:45:26 -0700 | [diff] [blame] | 41 | testImplementation(ANDROIDX_TEST_RUNNER) |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 42 | testImplementation(JUNIT) |
| Louis Pullen-Freilich | 08e53df | 2019-10-24 20:00:35 +0100 | [diff] [blame] | 43 | testImplementation(KOTLIN_TEST) |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 44 | } |
| 45 | |
| Aurimas Liutikas | e587806 | 2019-12-04 15:10:08 -0800 | [diff] [blame] | 46 | SdkResourceGenerator.generateForHostTest(project) |
| Dustin Lam | 2628d11 | 2019-04-08 12:45:26 -0700 | [diff] [blame] | 47 | |
| Jeff Gaston | 193c6f1 | 2019-07-24 14:03:09 -0400 | [diff] [blame] | 48 | task buildOnServer(type: Copy) { |
| 49 | from { |
| 50 | def f = project.file("src/main/resources/scripts/lockClocks.sh") |
| 51 | if (!f.exists()) { |
| 52 | throw new GradleException(f.toString() + " does not exist") |
| 53 | } |
| 54 | return f |
| 55 | } |
| 56 | destinationDir BuildServerConfigurationKt.getDistributionDirectory(rootProject) |
| 57 | } |
| 58 | |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 59 | gradlePlugin { |
| 60 | plugins { |
| 61 | benchmark { |
| 62 | id = "androidx.benchmark" |
| 63 | implementationClass = "androidx.benchmark.gradle.BenchmarkPlugin" |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| Aurimas Liutikas | 2ad3161 | 2019-04-01 04:23:03 -0700 | [diff] [blame] | 68 | androidx { |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 69 | name = "Android Benchmark Gradle Plugin" |
| Aurimas Liutikas | 75e93a0 | 2019-05-28 16:31:38 -0700 | [diff] [blame] | 70 | publish = Publish.SNAPSHOT_AND_RELEASE |
| Dustin Lam | 6db1c77 | 2019-03-13 18:24:44 -0700 | [diff] [blame] | 71 | toolingProject = true |
| 72 | mavenVersion = LibraryVersions.BENCHMARK |
| 73 | mavenGroup = LibraryGroups.BENCHMARK |
| 74 | inceptionYear = "2019" |
| 75 | description = "Android Benchmark Gradle Plugin" |
| 76 | compilationTarget = CompilationTarget.HOST |
| 77 | } |