| Roman Elizarov | 3145290 | 2018-04-11 13:58:19 +0300 | [diff] [blame] | 1 | apply plugin: 'konan' |
| 2 | |
| 3 | repositories { |
| 4 | jcenter() |
| 5 | maven { url "https://kotlin.bintray.com/kotlinx" } |
| 6 | } |
| 7 | |
| 8 | def libraryName = project.name |
| 9 | def testProgramName = libraryName + "-test" |
| 10 | |
| 11 | konanArtifacts { |
| 12 | library(libraryName, targets: ["ios_arm64", "ios_x64", "macos_x64"]) { |
| 13 | artifactName libraryName.replace('-', '_') |
| 14 | enableMultiplatform true |
| 15 | dependencies { |
| 16 | "artifact$libraryName" "org.jetbrains.kotlinx:atomicfu-native:$atomicFU_version" |
| 17 | } |
| 18 | } |
| 19 | // TODO: THIS IS A WORKAROUND: Cannot do tests together with publishing in Kotlin/Native |
| 20 | if (!rootProject.properties["publish"]) { |
| 21 | program(testProgramName, targets: ["macos_x64"]) { |
| 22 | srcDir 'src/test/kotlin' |
| 23 | commonSourceSet 'test' |
| 24 | libraries { |
| 25 | artifact libraryName |
| 26 | } |
| 27 | extraOpts '-tr' |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | task test(dependsOn: run) |
| 33 | |
| 34 | // TODO: THIS IS A WORKAROUND: Cannot do tests together with publishing in Kotlin/Native |
| 35 | if (rootProject.properties["publish"]) { |
| 36 | publishToMavenLocal.dependsOn(build) |
| 37 | } |