| import static androidx.build.dependencies.DependenciesKt.* |
| import androidx.build.CompilationTarget |
| import androidx.build.LibraryGroups |
| import androidx.build.LibraryVersions |
| import androidx.build.AndroidXExtension |
| import androidx.build.Publish |
| |
| plugins { |
| id("AndroidXPlugin") |
| id("kotlin") |
| } |
| |
| sourceSets { |
| test.java.srcDirs += 'src/tests/kotlin' |
| } |
| |
| // Temporary hack to stop AS to adding two guavas into test's classpath |
| configurations.all { |
| resolutionStrategy { |
| force GUAVA |
| } |
| } |
| |
| dependencies { |
| implementation(project(":lifecycle:lifecycle-common")) |
| implementation(KOTLIN_STDLIB) |
| implementation(AUTO_COMMON) |
| implementation(JAVAPOET) |
| testImplementation(GOOGLE_COMPILE_TESTING) |
| testImplementation(JSR250) |
| testImplementation files(org.gradle.internal.jvm.Jvm.current().getToolsJar()) |
| } |
| |
| // we actually need to compile :lifecycle:lifecycle-common, but compileJava is easier |
| task compileTestLibrarySource(type: JavaCompile, dependsOn: compileJava) { |
| source "src/tests/test-data/lib/src" |
| classpath = project.compileJava.classpath |
| destinationDir = new File(project.buildDir, 'test-data/lib/classes') |
| } |
| |
| task jarTestLibrarySource(type: Jar, dependsOn: compileTestLibrarySource) { |
| from compileTestLibrarySource.destinationDir |
| archiveName = "test-library.jar" |
| destinationDir = file("src/tests/test-data/lib/") |
| } |
| |
| androidx { |
| name = "Android Lifecycles Compiler" |
| toolingProject = true |
| publish = Publish.SNAPSHOT_AND_RELEASE |
| mavenVersion = LibraryVersions.LIFECYCLE |
| mavenGroup = LibraryGroups.LIFECYCLE |
| inceptionYear = "2017" |
| description = "Android Lifecycles annotation processor" |
| url = AndroidXExtension.ARCHITECTURE_URL |
| compilationTarget = CompilationTarget.HOST |
| } |