2020-07-09 20:45:23 +00:00
|
|
|
plugins {
|
|
|
|
id "org.jetbrains.kotlin.multiplatform"
|
|
|
|
id "com.android.library"
|
|
|
|
id "maven-publish"
|
|
|
|
}
|
2020-06-03 15:49:29 +00:00
|
|
|
|
2020-06-14 19:05:48 +00:00
|
|
|
|
|
|
|
ext.artifactName = "bank-finder"
|
|
|
|
|
2020-06-03 15:49:29 +00:00
|
|
|
|
2020-07-09 20:45:23 +00:00
|
|
|
kotlin {
|
|
|
|
jvm {
|
|
|
|
compilations.main.kotlinOptions {
|
|
|
|
jvmTarget = "1.6"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
targets {
|
|
|
|
final def iOSTarget = iOSIsRealDevice ? presets.iosArm64 : presets.iosX64
|
|
|
|
|
|
|
|
fromPreset(iOSTarget, 'ios') {
|
|
|
|
binaries {
|
|
|
|
framework {
|
2020-07-11 15:08:24 +00:00
|
|
|
baseName = "BankFinder"
|
2020-10-22 23:27:47 +00:00
|
|
|
|
|
|
|
embedBitcode(embedBitcodeValue)
|
2020-07-09 20:45:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
commonMain {
|
|
|
|
dependencies {
|
2020-11-17 00:34:07 +00:00
|
|
|
api kotlin("stdlib-common")
|
2020-07-11 15:08:24 +00:00
|
|
|
|
2020-11-17 00:34:07 +00:00
|
|
|
api project(":common")
|
2020-07-09 20:45:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
commonTest {
|
|
|
|
dependencies {
|
|
|
|
implementation kotlin("test-common")
|
|
|
|
implementation kotlin("test-annotations-common")
|
|
|
|
}
|
|
|
|
}
|
2020-06-03 15:49:29 +00:00
|
|
|
|
|
|
|
|
2020-07-09 20:45:23 +00:00
|
|
|
jvmMain {
|
|
|
|
dependencies {
|
|
|
|
api "net.dankito.utils:java-utils:$javaUtilsVersion"
|
|
|
|
}
|
|
|
|
}
|
2020-06-03 15:49:29 +00:00
|
|
|
|
2020-07-09 20:45:23 +00:00
|
|
|
jvmTest {
|
|
|
|
dependencies {
|
|
|
|
implementation kotlin("test-junit")
|
2020-06-03 15:49:29 +00:00
|
|
|
|
2020-07-09 20:45:23 +00:00
|
|
|
implementation "org.junit.jupiter:junit-jupiter:$junit5Version"
|
|
|
|
runtimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5Version"
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
iosMain {
|
|
|
|
dependencies {
|
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-11 15:09:43 +00:00
|
|
|
iosTest {
|
|
|
|
dependencies {
|
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
|
|
implementation "org.jetbrains.kotlin:kotlin-test"
|
|
|
|
}
|
|
|
|
}
|
2020-07-09 20:45:23 +00:00
|
|
|
}
|
2020-07-09 11:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-09 20:45:23 +00:00
|
|
|
// Task to generate iOS framework for xcode projects.
|
2020-07-23 14:35:20 +00:00
|
|
|
task packForXcode(type: Sync) {
|
2020-07-09 20:45:23 +00:00
|
|
|
|
|
|
|
final File frameworkDir = new File(buildDir, "xcode-frameworks")
|
|
|
|
final String mode = project.findProperty("XCODE_CONFIGURATION")?.toUpperCase() ?: 'DEBUG'
|
|
|
|
|
|
|
|
final def framework = kotlin.targets.ios.binaries.getFramework("", mode)
|
|
|
|
|
|
|
|
inputs.property "mode", mode
|
|
|
|
dependsOn framework.linkTask
|
|
|
|
|
|
|
|
from { framework.outputFile.parentFile }
|
|
|
|
into frameworkDir
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
new File(frameworkDir, 'gradlew').with {
|
|
|
|
text = "#!/bin/bash\nexport 'JAVA_HOME=${System.getProperty("java.home")}'\ncd '${rootProject.rootDir}'\n./gradlew \$@\n"
|
|
|
|
setExecutable(true)
|
|
|
|
}
|
|
|
|
}
|
2020-07-09 11:34:45 +00:00
|
|
|
}
|
|
|
|
|
2020-07-23 14:35:20 +00:00
|
|
|
// Run packForXcode when building.
|
|
|
|
tasks.build.dependsOn packForXcode
|
2020-07-09 20:45:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion androidCompileSdkVersion
|
|
|
|
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdkVersion androidMinSdkVersion
|
|
|
|
targetSdkVersion androidTargetSdkVersion
|
|
|
|
|
|
|
|
versionName version
|
|
|
|
versionCode appVersionCode
|
|
|
|
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
pickFirst 'META-INF/ktor-http.kotlin_module'
|
|
|
|
pickFirst 'META-INF/kotlinx-io.kotlin_module'
|
|
|
|
pickFirst 'META-INF/atomicfu.kotlin_module'
|
|
|
|
pickFirst 'META-INF/ktor-utils.kotlin_module'
|
|
|
|
pickFirst 'META-INF/kotlinx-coroutines-io.kotlin_module'
|
|
|
|
pickFirst 'META-INF/ktor-client-core.kotlin_module'
|
|
|
|
pickFirst 'META-INF/DEPENDENCIES'
|
|
|
|
pickFirst 'META-INF/NOTICE'
|
|
|
|
pickFirst 'META-INF/LICENSE'
|
|
|
|
pickFirst 'META-INF/LICENSE.txt'
|
|
|
|
pickFirst 'META-INF/NOTICE.txt'
|
|
|
|
}
|
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
}
|
|
|
|
|
2020-07-09 11:34:45 +00:00
|
|
|
}
|
|
|
|
|
2020-07-09 20:45:23 +00:00
|
|
|
|
|
|
|
//task jarTest (type: Jar) {
|
|
|
|
// from sourceSets.jvmTest.output
|
|
|
|
// classifier = 'test'
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//configurations {
|
|
|
|
// testOutput
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//artifacts {
|
|
|
|
// testOutput jarTest
|
|
|
|
//}
|