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