blob: 5ed5770d3c57af03a66f5d4c28fcdacb09c41209 [file] [log] [blame]
Roman Elizarov1f74a2d2018-06-29 19:19:45 +03001/*
2 * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3 */
4
Roman Elizarov31452902018-04-11 13:58:19 +03005apply plugin: 'konan'
6
Roman Elizarov31452902018-04-11 13:58:19 +03007def libraryName = project.name
8def testProgramName = libraryName + "-test"
9
10konanArtifacts {
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
31task test(dependsOn: run)
32
33// TODO: THIS IS A WORKAROUND: Cannot do tests together with publishing in Kotlin/Native
34if (rootProject.properties["publish"]) {
35 publishToMavenLocal.dependsOn(build)
36}