125 lines
2.8 KiB
Groovy
125 lines
2.8 KiB
Groovy
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
buildscript {
|
|
repositories {
|
|
google()
|
|
jcenter()
|
|
}
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:4.1.2'
|
|
}
|
|
}
|
|
apply plugin: 'com.android.application'
|
|
|
|
repositories {
|
|
google()
|
|
jcenter()
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion 26
|
|
buildToolsVersion "29.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' }
|
|
|
|
|
|
dexOptions {
|
|
dexInProcess false
|
|
javaMaxHeapSize "1500m"
|
|
maxProcessCount 4
|
|
additionalParameters "--debug"
|
|
}
|
|
|
|
testOptions {
|
|
resultsDir = "build/test/results"
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
}
|
|
|
|
flavorDimensions "box"
|
|
|
|
productFlavors {
|
|
common0 {
|
|
dimension "box"
|
|
}
|
|
|
|
common1 {
|
|
dimension "box"
|
|
}
|
|
|
|
common2 {
|
|
dimension "box"
|
|
}
|
|
|
|
reflect0 {
|
|
dimension "box"
|
|
}
|
|
|
|
common_ir0 {
|
|
dimension "box"
|
|
}
|
|
|
|
common_ir1 {
|
|
dimension "box"
|
|
}
|
|
|
|
common_ir2 {
|
|
dimension "box"
|
|
}
|
|
|
|
reflect_ir0 {
|
|
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']))
|
|
}
|
|
}
|
|
}
|
|
}
|