blob: c794a455b5a8438e78951fb5566a3f23119b6b30 [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 Lam2b3b04f2019-12-19 22:44:13 +000037 implementation("com.android.tools.build:gradle:3.6.0-beta05")
Dustin Lam6db1c772019-03-13 18:24:44 -070038 implementation(KOTLIN_STDLIB)
Dustin Lam6db1c772019-03-13 18:24:44 -070039
40 testImplementation gradleTestKit()
Dustin Lam2628d112019-04-08 12:45:26 -070041 testImplementation(ANDROIDX_TEST_RUNNER)
Dustin Lam6db1c772019-03-13 18:24:44 -070042 testImplementation(JUNIT)
Louis Pullen-Freilich08e53df2019-10-24 20:00:35 +010043 testImplementation(KOTLIN_TEST)
Dustin Lam6db1c772019-03-13 18:24:44 -070044}
45
Aurimas Liutikase5878062019-12-04 15:10:08 -080046SdkResourceGenerator.generateForHostTest(project)
Dustin Lam2628d112019-04-08 12:45:26 -070047
Jeff Gaston193c6f12019-07-24 14:03:09 -040048task 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 Lam6db1c772019-03-13 18:24:44 -070059gradlePlugin {
60 plugins {
61 benchmark {
62 id = "androidx.benchmark"
63 implementationClass = "androidx.benchmark.gradle.BenchmarkPlugin"
64 }
65 }
66}
67
Aurimas Liutikas2ad31612019-04-01 04:23:03 -070068androidx {
Dustin Lam6db1c772019-03-13 18:24:44 -070069 name = "Android Benchmark Gradle Plugin"
Aurimas Liutikas75e93a02019-05-28 16:31:38 -070070 publish = Publish.SNAPSHOT_AND_RELEASE
Dustin Lam6db1c772019-03-13 18:24:44 -070071 toolingProject = true
72 mavenVersion = LibraryVersions.BENCHMARK
73 mavenGroup = LibraryGroups.BENCHMARK
74 inceptionYear = "2019"
75 description = "Android Benchmark Gradle Plugin"
76 compilationTarget = CompilationTarget.HOST
77}