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 | |
| 20 | import static androidx.build.dependencies.DependenciesKt.* |
| 21 | import androidx.build.BuildServerConfigurationKt |
| 22 | |
| 23 | plugins { |
| 24 | id("AndroidXPlugin") |
| 25 | id("kotlin") |
| 26 | } |
| 27 | |
| 28 | dependencies { |
| 29 | implementation gradleApi() |
| 30 | testImplementation JUNIT |
| 31 | implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/build/libs/buildSrc.jar"))) |
| 32 | } |
| 33 | |
Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 34 | // Also do style checking of the buildSrc project from within this project too |
| 35 | // 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] | 36 | def ktlintDir = "../buildSrc/" |
| 37 | def ktlintIncludes = "src/**/*.kt" |
| 38 | def ktlintInputs = project.fileTree(ktlintDir) { |
| 39 | include ktlintIncludes |
| 40 | } |
Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 41 | tasks["ktlint"].configure({ t -> |
| 42 | t.inputs.files(ktlintInputs) |
Jeff Gaston | ea2dacb2 | 2020-05-08 12:01:57 -0400 | [diff] [blame] | 43 | t.workingDir = ktlintDir |
Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 44 | t.args = t.args + ktlintIncludes |
| 45 | }) |
| 46 | tasks["ktlintFormat"].configure({ t -> |
| 47 | t.inputs.files(ktlintInputs) |
Jeff Gaston | ea2dacb2 | 2020-05-08 12:01:57 -0400 | [diff] [blame] | 48 | t.workingDir = ktlintDir |
Jeff Gaston | d61ec62 | 2020-02-26 15:34:00 -0500 | [diff] [blame] | 49 | t.args = t.args + ktlintIncludes |
| 50 | }) |