Roman Elizarov | 26af919 | 2017-09-21 18:12:04 +0300 | [diff] [blame] | 1 | /* |
Vsevolod Tolstopyatov | 74b4802 | 2019-04-02 18:56:29 +0300 | [diff] [blame] | 2 | * Copyright 2017-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
Roman Elizarov | 26af919 | 2017-09-21 18:12:04 +0300 | [diff] [blame] | 3 | */ |
| 4 | |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 5 | buildscript { |
Leonid Startsev | ca62091 | 2017-11-09 19:55:51 +0300 | [diff] [blame] | 6 | if (project.hasProperty("bootstrap")) { |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 7 | ext.kotlin_version = property('kotlin.version.snapshot') |
Leonid Startsev | 12a0003 | 2018-11-08 19:05:36 +0300 | [diff] [blame] | 8 | ext["org.jetbrains.kotlin.native.home"] = System.getenv("KONAN_LOCAL_DIST") |
Leonid Startsev | ca62091 | 2017-11-09 19:55:51 +0300 | [diff] [blame] | 9 | } else { |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 10 | ext.kotlin_version = property('kotlin.version') |
Leonid Startsev | ca62091 | 2017-11-09 19:55:51 +0300 | [diff] [blame] | 11 | } |
Leonid Startsev | b0fd120 | 2018-12-12 19:42:48 +0300 | [diff] [blame] | 12 | ext.experimentalsEnabled = ["-progressive", "-Xuse-experimental=kotlin.Experimental", |
Leonid Startsev | c1bb4d2 | 2018-10-23 18:50:39 +0300 | [diff] [blame] | 13 | "-Xuse-experimental=kotlin.ExperimentalMultiplatform", |
Vsevolod Tolstopyatov | 74b4802 | 2019-04-02 18:56:29 +0300 | [diff] [blame] | 14 | ] |
Leonid Startsev | c1bb4d2 | 2018-10-23 18:50:39 +0300 | [diff] [blame] | 15 | |
Leonid Startsev | b0fd120 | 2018-12-12 19:42:48 +0300 | [diff] [blame] | 16 | ext.experimentalsInTestEnabled = ["-progressive", "-Xuse-experimental=kotlin.Experimental", |
Vsevolod Tolstopyatov | 74b4802 | 2019-04-02 18:56:29 +0300 | [diff] [blame] | 17 | "-Xuse-experimental=kotlin.ExperimentalMultiplatform", |
| 18 | "-Xuse-experimental=kotlinx.serialization.ImplicitReflectionSerializer", |
| 19 | "-Xuse-experimental=kotlinx.serialization.UnstableDefault" |
| 20 | ] |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 21 | |
| 22 | repositories { |
Leonid Startsev | 6fbc215 | 2017-09-21 16:18:32 +0300 | [diff] [blame] | 23 | mavenLocal() |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 24 | maven { url 'https://kotlin.bintray.com/kotlin-dev' } |
| 25 | maven { url 'https://kotlin.bintray.com/kotlin-eap' } |
| 26 | maven { url 'https://kotlin.bintray.com/kotlinx' } |
| 27 | maven { url "https://dl.bintray.com/orangy/maven" } |
Leonid Startsev | bae49f9 | 2018-05-03 19:57:01 +0300 | [diff] [blame] | 28 | maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" } |
Leonid Startsev | 97b7187 | 2019-02-05 13:04:43 +0300 | [diff] [blame] | 29 | jcenter() |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 30 | gradlePluginPortal() |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | dependencies { |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 34 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| 35 | classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" |
| 36 | classpath "kotlinx.team:kotlinx.team.infra:$infra_version" |
| 37 | classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version" |
Leonid Startsev | bae49f9 | 2018-05-03 19:57:01 +0300 | [diff] [blame] | 38 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 39 | // Protobuf is udes in JVM tests |
| 40 | classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8' |
Leonid Startsev | bae49f9 | 2018-05-03 19:57:01 +0300 | [diff] [blame] | 41 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 42 | // Various benchmarking stuff |
| 43 | classpath "com.github.jengelman.gradle.plugins:shadow:4.0.2" |
| 44 | classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.8" |
| 45 | classpath "net.ltgt.gradle:gradle-apt-plugin:0.21" |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 46 | } |
| 47 | } |
| 48 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 49 | apply plugin: 'kotlinx.team.infra' |
| 50 | |
| 51 | infra { |
| 52 | teamcity {} |
| 53 | node { |
| 54 | version = '10.15.1' |
| 55 | mocha('4.1.0') |
| 56 | install("source-map-support", "0.5.3") |
| 57 | install("mocha-teamcity-reporter", "2.2.2") |
| 58 | } |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | allprojects { |
| 62 | group 'org.jetbrains.kotlinx' |
Leonid Startsev | 476b722 | 2018-06-26 17:06:14 +0300 | [diff] [blame] | 63 | |
| 64 | if (project.hasProperty("bootstrap")) { |
| 65 | version = version + '-SNAPSHOT' |
| 66 | } |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 67 | |
| 68 | repositories { |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 69 | mavenLocal() |
Leonid Startsev | 97b7187 | 2019-02-05 13:04:43 +0300 | [diff] [blame] | 70 | jcenter() |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 71 | maven { url "https://dl.bintray.com/kotlin/kotlinx" } |
| 72 | maven { url 'https://dl.bintray.com/kotlin/kotlin-dev' } |
| 73 | maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 74 | } |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 75 | } |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 76 | |
Leonid Startsev | 1c35d91 | 2017-10-04 12:26:43 +0300 | [diff] [blame] | 77 | subprojects { |
Leonid Startsev | c1bb4d2 | 2018-10-23 18:50:39 +0300 | [diff] [blame] | 78 | tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all { task -> |
| 79 | if (task.name.contains("Test") || task.name.contains("Jmh")) { |
| 80 | task.kotlinOptions.freeCompilerArgs += experimentalsInTestEnabled |
| 81 | } else { |
| 82 | task.kotlinOptions.freeCompilerArgs += experimentalsEnabled |
| 83 | } |
| 84 | } |
| 85 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 86 | // Configure publishing for some artifacts |
Leonid Startsev | 133194c | 2018-07-13 12:58:36 +0300 | [diff] [blame] | 87 | if (project.name.contains("benchmark")) return |
| 88 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 89 | apply from: rootProject.file('gradle/publishing.gradle') |
| 90 | } |
Leonid Startsev | ed87fbd | 2017-08-04 17:33:09 +0300 | [diff] [blame] | 91 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame^] | 92 | afterEvaluate { |
| 93 | println("Using Kotlin compiler version: $org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION") |
Leonid Startsev | da728dd | 2018-03-07 12:41:47 +0300 | [diff] [blame] | 94 | } |