Skip to content

Commit c6bf659

Browse files
committed
Project structure for MPP project
1 parent 766d64d commit c6bf659

File tree

6 files changed

+161
-5
lines changed

6 files changed

+161
-5
lines changed

benchmarks-mpp/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
plugins {
2-
id 'org.jetbrains.kotlin.multiplatform' version '1.3.40'
2+
id 'org.jetbrains.kotlin.multiplatform'
33
id 'kotlinx.benchmark' version '0.2.0-dev-2'
44
}
55

6+
evaluationDependsOn(":kotlinx-collections-immutable")
7+
68
repositories {
79
mavenCentral()
810
maven { url 'https://dl.bintray.com/orangy/maven' }

benchmarks-runner/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'org.jetbrains.kotlin.jvm' version '1.3.40'
2+
id 'org.jetbrains.kotlin.jvm'
33
}
44

55
repositories {

build.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

build.gradle.kts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
5+
}
6+
dependencies {
7+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50")
8+
}
9+
}
10+
11+
plugins {
12+
id("kotlinx.team.infra") version "0.1.0-dev-49"
13+
}
14+
15+
infra {
16+
teamcity {
17+
bintrayUser = "bintrayUser"
18+
bintrayToken = "bintrayToken"
19+
}
20+
publishing {
21+
// include(":kotlinx-collections-immutable")
22+
23+
bintray {
24+
25+
organization = "kotlin"
26+
repository = "kotlinx"
27+
library = "kotlinx-collections-immutable"
28+
username = findProperty("bintrayUser") as String?
29+
password = findProperty("bintrayApiKey") as String?
30+
}
31+
}
32+
}
33+
34+
val JDK_6 by ext(System.getenv("JDK_6") ?: findProperty("JDK_6") as String? ?: error("Specify path to JDK 6 in JDK_6 environment variable or Gradle property"))
35+
36+
allprojects {
37+
group = "org.jetbrains.kotlinx"
38+
repositories {
39+
mavenCentral()
40+
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
41+
}
42+
}

core/build.gradle.kts

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
plugins {
2+
id("kotlin-multiplatform")
3+
`maven-publish`
4+
}
5+
6+
base {
7+
archivesBaseName = "kotlinx-collections-immutable" // doesn't work
8+
}
9+
10+
publishing {
11+
repositories {
12+
maven(url = "${rootProject.buildDir}/maven") {
13+
this.name = "buildLocal"
14+
}
15+
}
16+
}
17+
18+
val JDK_6: String by project
19+
20+
kotlin {
21+
infra {
22+
target("macosX64")
23+
target("linuxX64")
24+
target("mingwX64")
25+
}
26+
27+
jvm {
28+
compilations.all {
29+
kotlinOptions {
30+
jvmTarget = "1.6"
31+
jdkHome = JDK_6
32+
}
33+
}
34+
}
35+
36+
js {
37+
nodejs {
38+
// testTask { }
39+
}
40+
compilations.all {
41+
kotlinOptions {
42+
sourceMap = true
43+
moduleKind = "umd"
44+
metaInfo = true
45+
}
46+
}
47+
}
48+
49+
sourceSets.all {
50+
kotlin.setSrcDirs(listOf("$name/src"))
51+
resources.setSrcDirs(listOf("$name/resources"))
52+
languageSettings.apply {
53+
// progressiveMode = true
54+
useExperimentalAnnotation("kotlin.Experimental")
55+
}
56+
}
57+
58+
sourceSets {
59+
commonMain {
60+
dependencies {
61+
api("org.jetbrains.kotlin:kotlin-stdlib-common")
62+
}
63+
}
64+
65+
commonTest {
66+
dependencies {
67+
api("org.jetbrains.kotlin:kotlin-test-common")
68+
api("org.jetbrains.kotlin:kotlin-test-annotations-common")
69+
}
70+
}
71+
72+
val jvmMain by getting {
73+
dependencies {
74+
api("org.jetbrains.kotlin:kotlin-stdlib")
75+
76+
}
77+
}
78+
val jvmTest by getting {
79+
dependencies {
80+
api("org.jetbrains.kotlin:kotlin-test-junit")
81+
}
82+
}
83+
84+
val jsMain by getting {
85+
dependencies {
86+
api("org.jetbrains.kotlin:kotlin-stdlib-js")
87+
}
88+
}
89+
90+
val jsTest by getting {
91+
dependencies {
92+
api("org.jetbrains.kotlin:kotlin-test-js")
93+
}
94+
}
95+
96+
val nativeMain by getting {
97+
dependencies {
98+
99+
}
100+
}
101+
102+
}
103+
}
104+
105+
tasks {
106+
named("jvmTest", Test::class) {
107+
maxHeapSize = "1024m"
108+
executable = "$JDK_6/bin/java"
109+
}
110+
}

settings.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ pluginManagement {
77
}
88
}
99

10+
enableFeaturePreview('GRADLE_METADATA')
11+
1012
rootProject.name = 'Kotlin Immutable Collections'
1113

12-
include ':kotlinx-collections-immutable'
13-
include ':kotlinx-collections-immutable:tests'
14+
include ':core'
15+
project(":core").name='kotlinx-collections-immutable'
16+
1417
include ':benchmarks-mpp'
1518
include ':benchmarks-runner'

0 commit comments

Comments
 (0)