| Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [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 | |
| 17 | // This project contains tests for code contained in buildSrc |
| 18 | // This project is stored outside of buildSrc/ so that waiting for these tests to complete doesn't delay the rest of the build |
| 19 | |
| Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 20 | import androidx.build.BuildServerConfigurationKt |
| David Saff | 2eb919d | 2022-03-24 16:50:42 -0400 | [diff] [blame^] | 21 | import androidx.build.SdkResourceGenerator |
| Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 22 | |
| 23 | plugins { |
| 24 | id("AndroidXPlugin") |
| 25 | id("kotlin") |
| 26 | } |
| 27 | |
| 28 | dependencies { |
| Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 29 | implementation(gradleApi()) |
| Jeff Gaston | d72edf2 | 2021-08-24 11:53:54 -0400 | [diff] [blame] | 30 | implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/private/build/libs/private.jar"))) |
| Aurimas Liutikas | 4209691 | 2021-11-04 10:08:55 -0700 | [diff] [blame] | 31 | implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/public/build/libs/public.jar"))) |
| Jeff Gaston | d0c7ebd | 2021-12-21 11:14:53 -0500 | [diff] [blame] | 32 | implementation("com.googlecode.json-simple:json-simple:1.1") |
| Alan Viverette | fdbce5c | 2022-03-14 17:00:52 +0000 | [diff] [blame] | 33 | implementation(libs.gson) |
| Alan Viverette | 6b52a14 | 2022-03-21 16:49:27 -0400 | [diff] [blame] | 34 | implementation(libs.dom4j) { |
| 35 | // Optional dependency where Ivy fails to parse the POM file. |
| 36 | exclude(group:"net.java.dev.msv", module:"xsdlib") |
| 37 | } |
| David Saff | 2eb919d | 2022-03-24 16:50:42 -0400 | [diff] [blame^] | 38 | |
| 39 | testImplementation(libs.junit) |
| 40 | testImplementation(libs.truth) |
| 41 | testImplementation(project(":internal-testutils-gradle-plugin")) |
| 42 | testImplementation(gradleTestKit()) |
| Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 43 | } |
| 44 | |
| David Saff | 2eb919d | 2022-03-24 16:50:42 -0400 | [diff] [blame^] | 45 | SdkResourceGenerator.generateForHostTest(project) |
| 46 | |
| Aurimas Liutikas | 8cf41f5 | 2022-01-06 15:09:20 -0800 | [diff] [blame] | 47 | // Also do style checking of the buildSrc project from within this project |
| Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 48 | // We run that from this project so that it doesn't block other projects while it runs |
| Aurimas Liutikas | 8cf41f5 | 2022-01-06 15:09:20 -0800 | [diff] [blame] | 49 | def ktlintDir = file("../buildSrc") |
| Jeff Gaston | 6a59789 | 2021-09-01 16:30:32 -0400 | [diff] [blame] | 50 | def subdirs = ["plugins", "private", "public"] |
| Jeff Gaston | 6a59789 | 2021-09-01 16:30:32 -0400 | [diff] [blame] | 51 | |
| Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 52 | tasks["ktlint"].configure({ t -> |
| Aurimas Liutikas | 8cf41f5 | 2022-01-06 15:09:20 -0800 | [diff] [blame] | 53 | t.overrideDirectory = ktlintDir |
| 54 | t.overrideSubdirectories = subdirs |
| Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 55 | }) |
| 56 | tasks["ktlintFormat"].configure({ t -> |
| Aurimas Liutikas | 8cf41f5 | 2022-01-06 15:09:20 -0800 | [diff] [blame] | 57 | t.overrideDirectory = ktlintDir |
| 58 | t.overrideSubdirectories = subdirs |
| Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 59 | }) |
| Alan Viverette | 4411aa1 | 2021-05-07 18:33:11 -0400 | [diff] [blame] | 60 | |
| 61 | // Broken in AGP 7.0-alpha15 due to b/180408027 |
| 62 | tasks["lint"].configure { t -> |
| 63 | t.enabled = false |
| Jeff Gaston | d72edf2 | 2021-08-24 11:53:54 -0400 | [diff] [blame] | 64 | } |