blob: 443b0ef257460043e4234525c723a82be408bea8 [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")
}
apply from: "../buildSrc/kotlin-dsl-dependency.gradle"
def buildSrcJar(jarName) {
return project.files(
new File(
BuildServerConfigurationKt.getRootOutDirectory(project),
"buildSrc/$jarName/build/libs/${jarName}.jar"
)
)
}
dependencies {
implementation(gradleApi())
implementation(buildSrcJar("private"))
implementation(buildSrcJar("public"))
implementation(buildSrcJar("jetpad-integration"))
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)
testImplementation(libs.kotlinGradlePluginz)
testImplementation(libs.toml)
testImplementation(findGradleKotlinDsl())
}
SdkResourceGenerator.generateForHostTest(project)
tasks.withType(Test).configureEach {
// https://github.com/gradle/gradle/issues/22317
it.jvmArgs = ["--add-opens=java.base/java.lang=ALL-UNNAMED"]
}
// 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
}