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