Skip to content

Instantly share code, notes, and snippets.

@agent10
Last active April 19, 2020 17:52
Show Gist options
  • Save agent10/b1999f40614b11a9305b9460410fcc2a to your computer and use it in GitHub Desktop.
Save agent10/b1999f40614b11a9305b9460410fcc2a to your computer and use it in GitHub Desktop.
kotlin {
android()
ios {
binaries.all {
freeCompilerArgs += "-Xobjc-generics"
}
}
tvos {
binaries.all {
freeCompilerArgs += "-Xobjc-generics"
}
}
sourceSets {
commonMain {
dependencies {
implementation Libs.Common_kotlinStdlibCommon
implementation Libs.Common_kotlinxCoroutinesCoreCommon
implementation Libs.Common_kotlinxSerializationRuntimeCommon
implementation Libs.Common_ktorClientCore
implementation Libs.Common_ktorClientJson
implementation Libs.Common_ktorClientLogging
implementation Libs.Common_ktorClientSerialization
implementation Libs.Common_atomicsFuCommon
implementation Libs.Common_statelyCommon
implementation Libs.Common_statelyCollections
implementation Libs.Common_napierCommon
implementation("com.russhwolf:multiplatform-settings:0.5.1")
}
}
commonTest {
dependencies {
implementation Libs.Common_kotlinTest
implementation Libs.Common_kotlinTestCommon
implementation Libs.Common_kotlinTestAnnotationCommon
}
}
iosMain {
dependsOn(commonMain)
dependencies {
implementation Libs.Common_kotlinxCoroutinesCoreNative
implementation Libs.Common_kotlinxSerializationRuntimeNative
implementation Libs.Common_ktorClientIos
implementation Libs.Common_ktorClientJsonNative
implementation Libs.Common_ktorClientLoggingNative
implementation Libs.Common_ktorClientSerializationNative
implementation Libs.Common_napierIos
}
}
tvosMain {
dependsOn(commonMain)
dependencies {
implementation Libs.Common_kotlinxCoroutinesCoreNative
implementation Libs.Common_kotlinxSerializationRuntimeNative
implementation Libs.Common_ktorClientIos
implementation Libs.Common_ktorClientJsonNative
implementation Libs.Common_ktorClientLoggingNative
implementation Libs.Common_ktorClientSerializationNative
//FIXME https://github.com/AAkira/Napier/issues/40
//api "com.github.aakira:napier-ios:1.3.0"
}
}
androidMain {
dependsOn(commonMain)
dependencies {
implementation Libs.Common_kotlinStdlib
implementation Libs.Common_kotlinxSerializationRuntime
implementation Libs.Common_kotlinxCoroutinesCoreJdk
implementation Libs.Common_ktorClientAndroid
implementation Libs.Common_ktorClientLoggingJvm
implementation Libs.Common_ktorClientSerializationJvm
implementation Libs.Common_napierAndroid
}
}
androidTest {
dependsOn(commonTest)
dependencies {
implementation Libs.Common_kotlinTest
implementation Libs.Common_kotlinTestJunit
implementation Libs.Common_kotlinxCoroutinesTest
}
}
iosTest {
dependsOn(commonTest)
dependencies {
}
}
tvosTest {
dependsOn(commonTest)
dependencies {
}
}
}
targets {
configure([]) {
tasks.getByName(compilations.main.compileKotlinTaskName).kotlinOptions {
jvmTarget = "1.8"
}
}
}
// TODO ios
cocoapods {
summary = "Kotlin Multiplatform Template common module"
homepage = "https://github.com/wiyarmir/kotlin-multiplatform-template"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment