summaryrefslogtreecommitdiff
path: root/plugins/kotlin/idea/tests/testData/gradle/hmppImportAndHighlighting/multiModulesHmpp/top-mpp/build.gradle
blob: bcb324c8e01344bf6957497e86e425378e2534f8 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
apply plugin: 'kotlin-multiplatform'
apply plugin: 'maven-publish'

group 'org.jetbrains.qa.combompp'
version publishing_version

buildscript {
    repositories {
        {{kotlin_plugin_repositories}}
    }
}

repositories {
    {{kotlin_plugin_repositories}}
}

def complexLibAttribute = Attribute.of('org.jetbrains.qa.complexlib', String)

kotlin {
    jvm("jvm18") {
        withJava()
        attributes { attribute(complexLibAttribute, 'jvmWithJava') }

        compilations.all {
            kotlinOptions.jvmTarget = "1.8"
        }
    }
    js() {
        nodejs()
    }

    linuxX64('linux') {
        // Binary configuration
        binaries {
            // Creating static library with a custom name.
            staticLib('customNameForLinuxLib') {
                outputDirectory = file("customNameForLinuxLib") // outputDir is a `val` property.
                linkTask.destinationDir = file("customNameForLinuxLib")
            }
        }
    }

    macosX64('macos') {
        // Binary configuration
        binaries {
            // Creating static library with a custom name.
            staticLib('customNameForMacosLib') {
                outputDirectory = file("customNameForMacosLib") // outputDir is a `val` property.
                linkTask.destinationDir = file("customNameForMacosLib")
            }
        }
    }

    iosX64("dummyiOS") {
        binaries {
            // KT-29395 fix
            framework {
                outputDirectory = file("fooDummyiOS") // outputDir is a `val` property.
                linkTask.destinationDir = file("fooDummyiOS")
            }
        }
    }

    // inline classes are enabled below
    targets.all {
        compilations.all {
            kotlinOptions {
                freeCompilerArgs += ["-Xprogressive", "-XXLanguage:+NewInference", "-XXLanguage:+SamConversionForKotlinFunctions", "-Xuse-experimental=kotlin.ExperimentalMultiplatform"]
            }
        }
    }

    sourceSets {

        commonMain {
            dependencies { }
        }
        commonTest {
            dependencies { }
        }

        // intermediate between commonMain and jsJvm18Main
        kt27816Main {
            dependsOn commonMain
        }

        // creating a diamond
        jsJvm18iOSMain {
            kotlin.srcDir('src/jsJvm18iOSMain/cstmSrc')

            // dependsOn commonMain
            dependsOn kt27816Main // an additional source set on the way to commonMain
            dependencies {
                //api "com.example:tmp-new-mpp-0312:0.0.1"
            }
        }

        jsJvm18iOSTest {
            dependsOn commonTest
            dependencies { }
        }
        jsLinuxMain {
            dependsOn commonMain
        }

        jsLinuxTest {
            dependsOn commonTest
        }

        // setting up the targets source sets
        jvm18Main {
            kotlin.srcDir('src/jvm18Main/customSrc')

            dependencies {
                // not in `common`, please: https://youtrack.jetbrains.com/issue/KT-28537
                api project(":api-jvm")
            }

            // connecting to the diamond
            dependsOn jsJvm18iOSMain
        }
        jvm18Test {
            dependencies { }

            // connecting to the diamond
            dependsOn jsJvm18iOSTest
        }

        jsMain {
            dependencies {
                npm("left-pad", "*")
            }

            // connecting to the diamond
            dependsOn jsJvm18iOSMain
            dependsOn jsLinuxMain
        }
        jsTest {
            dependencies {
                npm("left-pad", "*")
            }

            // connecting to the diamond
            dependsOn jsJvm18iOSTest
            dependsOn jsLinuxTest
        }
        linuxMain {
            dependencies { }

            // connecting to the diamond
            dependsOn jsLinuxMain
        }
        linuxTest {
            dependencies { }

            // connecting to the diamond
            dependsOn jsLinuxTest
        }
        macosMain {
            dependencies { }
        }
        macosTest {
            dependencies { }
        }
        dummyiOSMain {
            // connecting to the diamond
            dependsOn jsJvm18iOSMain
            dependencies { }
        }
        dummyiOSTest {
            dependsOn jsJvm18iOSTest

            dependencies { }
        }
    }
}
kotlin.sourceSets.all {
    it.languageSettings.enableLanguageFeature("InlineClasses")
}