From d0a6bb0e3e3d371ee24880a4f90e3b84e640167d Mon Sep 17 00:00:00 2001 From: Ilya Matveev Date: Mon, 29 Jan 2018 19:04:18 +0700 Subject: [PATCH] Workaround for native build --- build.gradle | 2 ++ gradle.properties | 6 +++++- native/build.gradle | 21 ++++++++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 44b196a..7a96fa4 100644 --- a/build.gradle +++ b/build.gradle @@ -3,10 +3,12 @@ buildscript { jcenter() maven { url "http://kotlin.bintray.com/kotlinx" } maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version" + classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:+" } } diff --git a/gradle.properties b/gradle.properties index a34e71c..1cc2bcc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,8 @@ gradle_node_version = 1.2.0 node_version = 8.9.3 npm_version = 5.5.1 -kotlin.incremental.multiplatform=true \ No newline at end of file +kotlin.incremental.multiplatform=true + +# Kotlin/Native compiler v0.5 doesn't support mutiplatform projects. +# So we use a dev version which supports them. +konan.version=0.6-dev-822 \ No newline at end of file diff --git a/native/build.gradle b/native/build.gradle index 8826b52..97a9eb9 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -1 +1,20 @@ -// todo \ No newline at end of file +apply plugin: 'konan' + +konanArtifacts { + // TODO: commented out due to a failed assertion in the compiler. + //library('native') { + // srcDir 'src/main/kotlin' + // srcDir project(':common').file('src/main/kotlin') + // extraOpts '-Xmulti-platform' + //} + + program('native-test') { + srcDir 'src/main/kotlin' + srcDir 'src/test/kotlin' + srcDir project(':common').file('src/test/kotlin') + srcDir project(':common').file('src/main/kotlin') + extraOpts '-tr', '-Xmulti-platform' + } +} + +task test(dependsOn: run) \ No newline at end of file