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 |
| 21 | |
| 22 | plugins { |
| 23 | id("AndroidXPlugin") |
| 24 | id("kotlin") |
| 25 | } |
| 26 | |
| 27 | dependencies { |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 28 | implementation(gradleApi()) |
Aurimas Liutikas | b3483fd | 2021-06-04 16:56:37 -0700 | [diff] [blame] | 29 | testImplementation(libs.junit) |
Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 30 | implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/build/libs/buildSrc.jar"))) |
| 31 | } |
| 32 | |
Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 33 | // 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 Gaston | ea2dacb2 | 2020-05-08 12:01:57 -0400 | [diff] [blame] | 35 | def ktlintDir = "../buildSrc/" |
| 36 | def ktlintIncludes = "src/**/*.kt" |
| 37 | def ktlintInputs = project.fileTree(ktlintDir) { |
| 38 | include ktlintIncludes |
| 39 | } |
Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 40 | tasks["ktlint"].configure({ t -> |
| 41 | t.inputs.files(ktlintInputs) |
Jeff Gaston | ea2dacb2 | 2020-05-08 12:01:57 -0400 | [diff] [blame] | 42 | t.workingDir = ktlintDir |
Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 43 | t.args = t.args + ktlintIncludes |
| 44 | }) |
| 45 | tasks["ktlintFormat"].configure({ t -> |
| 46 | t.inputs.files(ktlintInputs) |
Jeff Gaston | ea2dacb2 | 2020-05-08 12:01:57 -0400 | [diff] [blame] | 47 | t.workingDir = ktlintDir |
Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 48 | t.args = t.args + ktlintIncludes |
| 49 | }) |
Alan Viverette | 4411aa1 | 2021-05-07 18:33:11 -0400 | [diff] [blame] | 50 | |
| 51 | // Broken in AGP 7.0-alpha15 due to b/180408027 |
| 52 | tasks["lint"].configure { t -> |
| 53 | t.enabled = false |
| 54 | } |