1apply plugin: 'com.android.library' 2apply plugin: 'org.jetbrains.kotlin.android' 3 4buildscript { 5 repositories { 6 mavenCentral() 7 gradlePluginPortal() 8 google() 9 } 10} 11 12def isIDE = properties.containsKey('android.injected.invoked.from.ide') || 13 (System.getenv("XPC_SERVICE_NAME") ?: "").contains("intellij") || 14 System.getenv("IDEA_INITIAL_DIRECTORY") != null 15 16android { 17 compileOptions { 18 sourceCompatibility JavaVersion.VERSION_1_8 19 targetCompatibility JavaVersion.VERSION_1_8 20 coreLibraryDesugaringEnabled true 21 } 22 23 kotlinOptions { 24 freeCompilerArgs += "-Xmulti-platform" 25 } 26 27 compileSdkVersion 30 28 29 defaultConfig { 30 minSdkVersion 15 31 targetSdkVersion 30 32 versionCode 1 33 versionName "1.0" 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 35 36 // AndroidJUnitRunner wasn't finding tests in multidex artifacts when running on Android 4.0.3. 37 // Work around by adding all Okio classes to the keep list. That way they'll be in the main 38 // .dx file where TestRequestBuilder will find them. 39 multiDexEnabled true 40 multiDexKeepProguard file('multidex-config.pro') 41 } 42 43 if (!isIDE) { 44 sourceSets { 45 named("androidTest") { 46 it.java.srcDirs += [ 47 project.file("../okio/src/commonMain/kotlin"), 48 project.file("../okio/src/commonTest/java"), 49 project.file("../okio/src/commonTest/kotlin"), 50 project.file("../okio/src/hashFunctions/kotlin"), 51 project.file("../okio/src/jvmMain/kotlin"), 52 project.file("../okio/src/jvmTest/java"), 53 project.file("../okio/src/jvmTest/kotlin"), 54 ] 55 } 56 } 57 } 58} 59 60 61dependencies { 62 coreLibraryDesugaring deps.android.desugarJdkLibs 63 androidTestImplementation deps.androidx.testExtJunit 64 androidTestImplementation deps.androidx.testRunner 65 androidTestImplementation deps.animalSniffer.annotations 66 androidTestImplementation deps.kotlin.stdLib.common 67 androidTestImplementation deps.kotlin.test.annotations 68 androidTestImplementation deps.kotlin.test.common 69 androidTestImplementation deps.kotlin.test.jdk 70 androidTestImplementation deps.kotlin.time 71 androidTestImplementation deps.test.assertj 72 androidTestImplementation deps.test.junit 73} 74