blob: ff35c32d4e098e79c870770fa83103143f9ca31e [file] [log] [blame]
/*
* Copyright 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This project contains tests for code contained in buildSrc
// This project is stored outside of buildSrc/ so that waiting for these tests to complete doesn't delay the rest of the build
import androidx.build.BuildServerConfigurationKt
import androidx.build.SdkResourceGenerator
plugins {
id("AndroidXPlugin")
id("kotlin")
}
dependencies {
implementation(gradleApi())
implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/private/build/libs/private.jar")))
implementation(project.files(new File(BuildServerConfigurationKt.getRootOutDirectory(project), "buildSrc/public/build/libs/public.jar")))
implementation("com.googlecode.json-simple:json-simple:1.1")
implementation(libs.gson)
implementation(libs.dom4j) {
// Optional dependency where Ivy fails to parse the POM file.
exclude(group:"net.java.dev.msv", module:"xsdlib")
}
// Required for dom4j to parse comments correctly.
implementation(libs.xerces)
testImplementation(libs.junit)
testImplementation(libs.truth)
testImplementation(project(":internal-testutils-gradle-plugin"))
testImplementation(gradleTestKit())
testImplementation(libs.checkmark)
}
SdkResourceGenerator.generateForHostTest(project)
// Also do style checking of the buildSrc project from within this project
// We run that from this project so that it doesn't block other projects while it runs
def ktlintDir = file("../buildSrc")
def subdirs = ["plugins", "private", "public"]
tasks["ktlint"].configure({ t ->
t.overrideDirectory = ktlintDir
t.overrideSubdirectories = subdirs
})
tasks["ktlintFormat"].configure({ t ->
t.overrideDirectory = ktlintDir
t.overrideSubdirectories = subdirs
})
// Broken in AGP 7.0-alpha15 due to b/180408027
tasks["lint"].configure { t ->
t.enabled = false
}