blob: 7c7bb0e19f088bb30b357419b30c92967991bad8 [file] [log] [blame]
Dustin Lam6db1c772019-03-13 18:24:44 -07001/*
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 Gaston193c6f12019-07-24 14:03:09 -040017import androidx.build.BuildServerConfigurationKt
Dustin Lam6db1c772019-03-13 18:24:44 -070018import androidx.build.CompilationTarget
19import androidx.build.LibraryGroups
20import androidx.build.LibraryVersions
Aurimas Liutikas75e93a02019-05-28 16:31:38 -070021import androidx.build.Publish
Aurimas Liutikase5878062019-12-04 15:10:08 -080022import androidx.build.SdkResourceGenerator
Dustin Lam6db1c772019-03-13 18:24:44 -070023
24import static androidx.build.dependencies.DependenciesKt.*
25
Aurimas Liutikas65d3d602019-04-01 23:08:13 -070026plugins {
27 id("AndroidXPlugin")
28 id("kotlin")
29 id("java-gradle-plugin")
30}
Dustin Lam6db1c772019-03-13 18:24:44 -070031
Jeff Gaston9cfb0a12019-11-06 17:50:14 -050032apply from: "../../buildSrc/kotlin-dsl-dependency.gradle"
33
Dustin Lam6db1c772019-03-13 18:24:44 -070034dependencies {
Jeff Gaston9cfb0a12019-11-06 17:50:14 -050035 implementation findGradleKotlinDsl()
Dustin Lam6db1c772019-03-13 18:24:44 -070036 implementation gradleApi()
Dustin Lam2d66aea2020-04-08 14:57:25 -070037 implementation("com.android.tools.build:gradle:4.0.0-beta04")
Dustin Lam6db1c772019-03-13 18:24:44 -070038 implementation(KOTLIN_STDLIB)
Dustin Lam6db1c772019-03-13 18:24:44 -070039
40 testImplementation gradleTestKit()
Sergey Vasilinetsfe3324b2020-01-06 15:57:39 +000041 testImplementation(project(":internal-testutils-gradle-plugin"))
Dustin Lam2628d112019-04-08 12:45:26 -070042 testImplementation(ANDROIDX_TEST_RUNNER)
Dustin Lam6db1c772019-03-13 18:24:44 -070043 testImplementation(JUNIT)
Louis Pullen-Freilich08e53df2019-10-24 20:00:35 +010044 testImplementation(KOTLIN_TEST)
Dustin Lam6db1c772019-03-13 18:24:44 -070045}
46
Aurimas Liutikase5878062019-12-04 15:10:08 -080047SdkResourceGenerator.generateForHostTest(project)
Dustin Lam2628d112019-04-08 12:45:26 -070048
Jeff Gaston193c6f12019-07-24 14:03:09 -040049task buildOnServer(type: Copy) {
50 from {
51 def f = project.file("src/main/resources/scripts/lockClocks.sh")
52 if (!f.exists()) {
53 throw new GradleException(f.toString() + " does not exist")
54 }
55 return f
56 }
57 destinationDir BuildServerConfigurationKt.getDistributionDirectory(rootProject)
58}
59
Dustin Lam6db1c772019-03-13 18:24:44 -070060gradlePlugin {
61 plugins {
62 benchmark {
63 id = "androidx.benchmark"
64 implementationClass = "androidx.benchmark.gradle.BenchmarkPlugin"
65 }
66 }
67}
68
Aurimas Liutikas2ad31612019-04-01 04:23:03 -070069androidx {
Dustin Lam6db1c772019-03-13 18:24:44 -070070 name = "Android Benchmark Gradle Plugin"
Aurimas Liutikas75e93a02019-05-28 16:31:38 -070071 publish = Publish.SNAPSHOT_AND_RELEASE
Dustin Lam6db1c772019-03-13 18:24:44 -070072 toolingProject = true
Dustin Lam6db1c772019-03-13 18:24:44 -070073 mavenGroup = LibraryGroups.BENCHMARK
74 inceptionYear = "2019"
75 description = "Android Benchmark Gradle Plugin"
76 compilationTarget = CompilationTarget.HOST
77}