Slackbot
06/24/2019, 9:06 AMyshrsmz
06/24/2019, 9:26 AMFail
06/24/2019, 10:08 AMkpgalligan
06/24/2019, 11:21 AMFail
06/24/2019, 11:45 AMkpgalligan
06/24/2019, 12:34 PMFail
06/24/2019, 12:37 PMbuildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.40"
classpath "org.jetbrains.kotlin:kotlin-serialization:1.3.40"
classpath 'com.squareup.sqldelight:gradle-plugin:1.1.3'
}
}
plugins {
id 'kotlin-multiplatform' version '1.3.40'
}
...
apply plugin: 'com.squareup.sqldelight'
...
sqldelight {
MyDatabase {
packageName = "ru.trendagent.database"
sourceFolders = ["sqldelight"]
}
}
android {
...
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
}
kotlin {
def coroutine_version = "1.3.0-M1"
def ktor_version = "1.2.2"
def serializer_version = "0.11.1"
android("android")
library for iPhone device
iosX64("ios") {
binaries {
framework {
freeCompilerArgs.add("-Xobjc-generics")
}
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutine_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serializer_version"
implementation "io.ktor:ktor-client-core:$ktor_version"
implementation "io.ktor:ktor-client-logging:$ktor_version"
implementation "io.ktor:ktor-client-json:$ktor_version"
implementation "io.ktor:ktor-client-serialization:$ktor_version"
}
}
...
}
}
// This task attaches native framework built from ios module to Xcode project
// (see iosApp directory). Don't run this task directly,
// Xcode runs this task itself during its build process.
// Before opening the project from iosApp directory in Xcode,
// make sure all Gradle infrastructure exists (gradle.wrapper, gradlew).
task copyFramework {
def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
def target = project.findProperty('kotlin.target') ?: 'ios'
dependsOn kotlin.targets."$target".binaries.getFramework(buildType).linkTask
doLast {
def srcFile = kotlin.targets."$target".binaries.getFramework(buildType).outputFile
def targetDir = getProperty('configuration.build.dir')
copy {
from srcFile.parent
into targetDir
include 'app.framework/**'
include 'app.framework.dSYM'
}
}
}
kpgalligan
06/24/2019, 12:44 PMFail
06/24/2019, 12:59 PMpluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == "kotlin-multiplatform") {
useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
}
}
}
}
rootProject.name = 'MultiplatformTest'
enableFeaturePreview("GRADLE_METADATA") // IMPORTANT!
include ':app'