// Top-level build file where you can add configuration options common to all sub-projects/modules. ext { isD8Enabled = project.findProperty('android.enableD8').toBoolean() } buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.3' } } apply plugin: 'com.android.application' repositories { google() jcenter() } android { compileSdkVersion 26 buildToolsVersion "28.0.3" defaultConfig { applicationId "org.jetbrains.kotlin.android.tests" minSdkVersion 19 targetSdkVersion 19 versionCode 1 versionName "1.0" testApplicationId "org.jetbrains.kotlin.android.tests.gradle" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/build.txt' } //TODO run under java 6, cause there is error on implicit 'stream' import in 'asWithMutable' test lintOptions { abortOnError false } compileOptions { incremental = false } dexOptions { dexInProcess false javaMaxHeapSize "1500m" maxProcessCount 4 additionalParameters "--debug" } testOptions { resultsDir = "build/test/results" } if (isD8Enabled) { compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 } } flavorDimensions "box" productFlavors { common0 { dimension "box" } common1 { dimension "box" } common2 { dimension "box" } reflect0 { dimension "box" } if (isD8Enabled) { jvm80 { dimension "box" } reflectjvm80 { dimension "box" } } } } task jarTestFolders() { println "Jar folders..." new File("${projectDir}/libs/").listFiles().each { File file -> if (file.isDirectory()) { println "Jar '${file.name}' folder..." ant.jar(basedir: "libs/${file.name}/", destfile: "libs/" + file.name + ".jar") } } } tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn jarTestFolders } dependencies { implementation fileTree(dir: 'libs', include: ['kotlin-test.jar', 'kotlin-stdlib.jar']) androidTestImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' android.applicationVariants.all { variant -> variant.productFlavors.each { def configuration = configurations.getByName(it.name + 'Implementation').name add(configuration, project.fileTree(dir: 'libs', include: [it.name + ".jar"])) if (it.name.startsWith("reflect")) { add(configuration, project.fileTree(dir: 'libs', include: ['kotlin-reflect.jar'])) } } } }