blob: 0d8348546ecb8f9b284bede5af69bf33f7c81e1b [file] [log] [blame]
Jeff Gaston8fd9fc82019-07-26 14:26:10 -04001/*
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 Gaston8fd9fc82019-07-26 14:26:10 -040020import androidx.build.BuildServerConfigurationKt
David Saff2eb919d2022-03-24 16:50:42 -040021import androidx.build.SdkResourceGenerator
Jeff Gaston8fd9fc82019-07-26 14:26:10 -040022
23plugins {
24 id("AndroidXPlugin")
25 id("kotlin")
26}
27
28dependencies {
Jim Sproch9e38b4f2021-01-06 14:21:06 -080029 implementation(gradleApi())
Jeff Gastond72edf22021-08-24 11:53:54 -040030 implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/private/build/libs/private.jar")))
Aurimas Liutikas42096912021-11-04 10:08:55 -070031 implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/public/build/libs/public.jar")))
Jeff Gastond0c7ebd2021-12-21 11:14:53 -050032 implementation("com.googlecode.json-simple:json-simple:1.1")
Alan Viverettefdbce5c2022-03-14 17:00:52 +000033 implementation(libs.gson)
Alan Viverette6b52a142022-03-21 16:49:27 -040034 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 Saff2eb919d2022-03-24 16:50:42 -040038
39 testImplementation(libs.junit)
40 testImplementation(libs.truth)
41 testImplementation(project(":internal-testutils-gradle-plugin"))
42 testImplementation(gradleTestKit())
Jeff Gaston8fd9fc82019-07-26 14:26:10 -040043}
44
David Saff2eb919d2022-03-24 16:50:42 -040045SdkResourceGenerator.generateForHostTest(project)
46
Aurimas Liutikas8cf41f52022-01-06 15:09:20 -080047// Also do style checking of the buildSrc project from within this project
Jeff Gastond61ec622020-02-26 15:34:00 -050048// We run that from this project so that it doesn't block other projects while it runs
Aurimas Liutikas8cf41f52022-01-06 15:09:20 -080049def ktlintDir = file("../buildSrc")
Jeff Gaston6a597892021-09-01 16:30:32 -040050def subdirs = ["plugins", "private", "public"]
Jeff Gaston6a597892021-09-01 16:30:32 -040051
Jeff Gastond61ec622020-02-26 15:34:00 -050052tasks["ktlint"].configure({ t ->
Aurimas Liutikas8cf41f52022-01-06 15:09:20 -080053 t.overrideDirectory = ktlintDir
54 t.overrideSubdirectories = subdirs
Jeff Gastond61ec622020-02-26 15:34:00 -050055})
56tasks["ktlintFormat"].configure({ t ->
Aurimas Liutikas8cf41f52022-01-06 15:09:20 -080057 t.overrideDirectory = ktlintDir
58 t.overrideSubdirectories = subdirs
Jeff Gastond61ec622020-02-26 15:34:00 -050059})
Alan Viverette4411aa12021-05-07 18:33:11 -040060
61// Broken in AGP 7.0-alpha15 due to b/180408027
62tasks["lint"].configure { t ->
63 t.enabled = false
Jeff Gastond72edf22021-08-24 11:53:54 -040064}