summaryrefslogtreecommitdiff
path: root/runtime/native/build.gradle
blob: 9bb654367270d23ac372acf235dfcb25a55e2f21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Copyright 2017-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */


apply plugin: 'kotlin-platform-native'
apply plugin: 'kotlinx-serialization-native'

def deployMode = property('native.deploy') == 'true'

sourceSets {
    main {
        kotlin.srcDirs = ['src/main/kotlin', '../common/src/main/kotlin', '../../json/common/src']

        component {

            baseName = "kotlinx-serialization-runtime-native"

            // todo: fixme, k/n!
            publishJavadoc = false
            publishSources = false

            outputKinds = [KLIBRARY]
            if (!deployMode)
                target 'host'
            else
                targets = [ 'ios_arm64', 'ios_arm32', 'ios_x64', 'macos_x64', 'linux_x64', 'mingw_x64' ]

            extraOpts experimentalsEnabled
        }
    }

    test {
        kotlin.srcDirs = ['src/test/kotlin', '../common/src/testWithNative']

        component {
            // experimantalsInTest is missing intentionally since
            // @ImplicitReflectionSerializer does not work on Native at all
            extraOpts experimentalsEnabled + ["-Xuse-experimental=kotlinx.serialization.UnstableDefault"]
        }
    }
}


dependencies {
//    expectedBy project(':common')
//    expectedBy project(':jsonparser')
}

apply plugin: 'maven-publish'

def localMavenRepo = "file://${new File(System.properties['user.home'] as String)}/.m2-kotlin-native"
publishing {
    repositories {
        maven {
            url = localMavenRepo
        }
    }
}

apply plugin: 'com.jfrog.bintray'

apply from: "${rootProject.rootDir}/gradle/bintray.gradle"

bintrayUpload.doFirst {
    publications = project.publishing.publications
}