blob: 94a52c21de6a48e8a408076bfc7b36b6a6d82794 [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
20import static androidx.build.dependencies.DependenciesKt.*
21import androidx.build.BuildServerConfigurationKt
22
23plugins {
24 id("AndroidXPlugin")
25 id("kotlin")
26}
27
28dependencies {
29 implementation gradleApi()
30 testImplementation JUNIT
31 implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/build/libs/buildSrc.jar")))
32}
33
Jeff Gastond61ec622020-02-26 15:34:00 -050034// 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 Gastonea2dacb22020-05-08 12:01:57 -040036def ktlintDir = "../buildSrc/"
37def ktlintIncludes = "src/**/*.kt"
38def ktlintInputs = project.fileTree(ktlintDir) {
39 include ktlintIncludes
40}
Jeff Gastond61ec622020-02-26 15:34:00 -050041tasks["ktlint"].configure({ t ->
42 t.inputs.files(ktlintInputs)
Jeff Gastonea2dacb22020-05-08 12:01:57 -040043 t.workingDir = ktlintDir
Jeff Gastond61ec622020-02-26 15:34:00 -050044 t.args = t.args + ktlintIncludes
45})
46tasks["ktlintFormat"].configure({ t ->
47 t.inputs.files(ktlintInputs)
Jeff Gastonea2dacb22020-05-08 12:01:57 -040048 t.workingDir = ktlintDir
Jeff Gastond61ec622020-02-26 15:34:00 -050049 t.args = t.args + ktlintIncludes
50})