1import static androidx.build.dependencies.DependenciesKt.* 2import androidx.build.LibraryGroups 3import androidx.build.LibraryVersions 4import androidx.build.SupportLibraryExtension 5 6plugins { 7 id("SupportKotlinLibraryPlugin") 8} 9 10sourceSets { 11 test.java.srcDirs += 'src/tests/kotlin' 12} 13 14// Temporary hack to stop AS to adding two guavas into test's classpath 15configurations.all { 16 resolutionStrategy { 17 force GUAVA 18 } 19} 20 21dependencies { 22 compile(project(":lifecycle:lifecycle-common")) 23 compile(KOTLIN_STDLIB) 24 compile(AUTO_COMMON) 25 compile(JAVAPOET) 26 testCompile(GOOGLE_COMPILE_TESTING) 27 testCompile(JSR250) 28 testCompile files(org.gradle.internal.jvm.Jvm.current().getToolsJar()) 29} 30 31// we actually need to compile :lifecycle:lifecycle-common, but compileJava is easier 32task compileTestLibrarySource(type: JavaCompile, dependsOn: compileJava) { 33 source "src/tests/test-data/lib/src" 34 classpath = project.compileJava.classpath 35 destinationDir = new File(project.buildDir, 'test-data/lib/classes') 36} 37 38task jarTestLibrarySource(type: Jar, dependsOn: compileTestLibrarySource) { 39 from compileTestLibrarySource.destinationDir 40 archiveName = "test-library.jar" 41 destinationDir = file("src/tests/test-data/lib/") 42} 43 44supportLibrary { 45 name = "Android Lifecycles Compiler" 46 publish = true 47 mavenVersion = LibraryVersions.LIFECYCLES_EXT 48 mavenGroup = LibraryGroups.LIFECYCLE 49 inceptionYear = "2017" 50 description = "Android Lifecycles annotation processor" 51 url = SupportLibraryExtension.ARCHITECTURE_URL 52} 53