[go: nahoru, domu]

blob: 4a019c64dd088a83d8bc67b10159e838d956f47e [file] [log] [blame]
/*
* Copyright (C) 2017 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.
*/
import androidx.build.LibraryType
import androidx.build.SdkHelperKt
plugins {
id("AndroidXPlugin")
id("kotlin")
}
androidx.configureAarAsJarForConfiguration("testImplementation")
// android.jar and xmlpull has the same classes, but android.jar has stubs instead of real
// implementation, so we remove org.xmlpull.* from android.jar used for tests
tasks.register("strippedAndroidJar", Jar).configure {
it.from(zipTree(SdkHelperKt.getSdkDependency(project).getFiles().first()))
it.exclude("org/xmlpull/**")
it.archiveFileName.set("stripped-android.jar")
}
dependencies {
implementation(libs.xpp3)
implementation(libs.xmlpull)
implementation(libs.kotlinStdlib)
implementation(libs.javapoet)
implementation(libs.kotlinPoet)
testImplementation(libs.junit)
testImplementation(libs.googleCompileTesting)
testImplementation(projectOrArtifact(":room:room-compiler-processing-testing"), {
exclude group: "androidx.room", module: "room-compiler-processing"
})
testImplementationAarAsJar(project(":navigation:navigation-common"))
testImplementationAarAsJar(project(":lifecycle:lifecycle-viewmodel-savedstate"))
testImplementation(tasks.named("strippedAndroidJar").map { it.outputs.files })
}
tasks.withType(Test).configureEach {
// https://github.com/google/compile-testing/issues/222
it.jvmArgs "--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
}
androidx {
name = "Navigation TypeSafe Arguments Generator"
type = LibraryType.OTHER_CODE_PROCESSOR
inceptionYear = "2017"
description = "Android Navigation TypeSafe Arguments Generator"
}