blob: 75dad66ffa779dc69b26fb230fc2da30cdd113c2 [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
21
22plugins {
23 id("AndroidXPlugin")
24 id("kotlin")
25}
26
27dependencies {
Jim Sproch9e38b4f2021-01-06 14:21:06 -080028 implementation(gradleApi())
Aurimas Liutikasb3483fd2021-06-04 16:56:37 -070029 testImplementation(libs.junit)
Jeff Gaston8fd9fc82019-07-26 14:26:10 -040030 implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/build/libs/buildSrc.jar")))
31}
32
Jeff Gastond61ec622020-02-26 15:34:00 -050033// Also do style checking of the buildSrc project from within this project too
34// We run that from this project so that it doesn't block other projects while it runs
Jeff Gastonea2dacb22020-05-08 12:01:57 -040035def ktlintDir = "../buildSrc/"
36def ktlintIncludes = "src/**/*.kt"
37def ktlintInputs = project.fileTree(ktlintDir) {
38 include ktlintIncludes
39}
Jeff Gastond61ec622020-02-26 15:34:00 -050040tasks["ktlint"].configure({ t ->
41 t.inputs.files(ktlintInputs)
Jeff Gastonea2dacb22020-05-08 12:01:57 -040042 t.workingDir = ktlintDir
Jeff Gastond61ec622020-02-26 15:34:00 -050043 t.args = t.args + ktlintIncludes
44})
45tasks["ktlintFormat"].configure({ t ->
46 t.inputs.files(ktlintInputs)
Jeff Gastonea2dacb22020-05-08 12:01:57 -040047 t.workingDir = ktlintDir
Jeff Gastond61ec622020-02-26 15:34:00 -050048 t.args = t.args + ktlintIncludes
49})
Alan Viverette4411aa12021-05-07 18:33:11 -040050
51// Broken in AGP 7.0-alpha15 due to b/180408027
52tasks["lint"].configure { t ->
53 t.enabled = false
54}