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 | |
Vsevolod Tolstopyatov | fa2231c | 2019-05-29 17:39:15 +0300 | [diff] [blame^] | 22 | /* |
| 23 | * These property group is used to build kotlinx.serialization against Kotlin compiler snapshot. |
| 24 | * When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version. |
| 25 | * DO NOT change the name of these properties without adapting kotlinx.train build chain. |
| 26 | */ |
| 27 | def prop = rootProject.properties['build_snapshot_train'] |
| 28 | ext.build_snapshot_train = prop != null && prop != "" |
| 29 | if (build_snapshot_train) { |
| 30 | ext.kotlin_version = rootProject.properties['kotlin_snapshot_version'] |
| 31 | if (kotlin_version == null) { |
| 32 | throw new IllegalArgumentException("'kotlin_snapshot_version' should be defined when building with snapshot compiler") |
| 33 | } |
| 34 | repositories { |
| 35 | mavenLocal() |
| 36 | maven { url "https://oss.sonatype.org/content/repositories/snapshots" } |
| 37 | maven { url "https://bintray.com/jetbrains/kotlin-native-dependencies" } |
| 38 | } |
| 39 | } |
| 40 | |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 41 | repositories { |
Leonid Startsev | 6fbc215 | 2017-09-21 16:18:32 +0300 | [diff] [blame] | 42 | mavenLocal() |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 43 | maven { url 'https://kotlin.bintray.com/kotlin-dev' } |
| 44 | maven { url 'https://kotlin.bintray.com/kotlin-eap' } |
| 45 | maven { url 'https://kotlin.bintray.com/kotlinx' } |
| 46 | maven { url "https://dl.bintray.com/orangy/maven" } |
Leonid Startsev | bae49f9 | 2018-05-03 19:57:01 +0300 | [diff] [blame] | 47 | maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" } |
Leonid Startsev | 97b7187 | 2019-02-05 13:04:43 +0300 | [diff] [blame] | 48 | jcenter() |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 49 | gradlePluginPortal() |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | dependencies { |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 53 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| 54 | classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" |
| 55 | classpath "kotlinx.team:kotlinx.team.infra:$infra_version" |
| 56 | classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version" |
Leonid Startsev | bae49f9 | 2018-05-03 19:57:01 +0300 | [diff] [blame] | 57 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 58 | // Protobuf is udes in JVM tests |
| 59 | classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8' |
Leonid Startsev | bae49f9 | 2018-05-03 19:57:01 +0300 | [diff] [blame] | 60 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 61 | // Various benchmarking stuff |
| 62 | classpath "com.github.jengelman.gradle.plugins:shadow:4.0.2" |
| 63 | classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.8" |
| 64 | classpath "net.ltgt.gradle:gradle-apt-plugin:0.21" |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 65 | } |
| 66 | } |
| 67 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 68 | apply plugin: 'kotlinx.team.infra' |
Vsevolod Tolstopyatov | fa2231c | 2019-05-29 17:39:15 +0300 | [diff] [blame^] | 69 | // To make it visible for compilerVersion.gradle |
| 70 | ext.compilerVersion = org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 71 | |
| 72 | infra { |
| 73 | teamcity {} |
| 74 | node { |
| 75 | version = '10.15.1' |
| 76 | mocha('4.1.0') |
| 77 | install("source-map-support", "0.5.3") |
| 78 | install("mocha-teamcity-reporter", "2.2.2") |
| 79 | } |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | allprojects { |
| 83 | group 'org.jetbrains.kotlinx' |
Leonid Startsev | 476b722 | 2018-06-26 17:06:14 +0300 | [diff] [blame] | 84 | |
| 85 | if (project.hasProperty("bootstrap")) { |
| 86 | version = version + '-SNAPSHOT' |
| 87 | } |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 88 | |
Vsevolod Tolstopyatov | fa2231c | 2019-05-29 17:39:15 +0300 | [diff] [blame^] | 89 | if (build_snapshot_train) { |
| 90 | // Snapshot-specific |
| 91 | def deployVersion = properties['DeployVersion'] |
| 92 | if (deployVersion != null) version = deployVersion |
| 93 | repositories { |
| 94 | mavenLocal() |
| 95 | maven { url "https://oss.sonatype.org/content/repositories/snapshots" } |
| 96 | } |
| 97 | } |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 98 | repositories { |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 99 | mavenLocal() |
Leonid Startsev | 97b7187 | 2019-02-05 13:04:43 +0300 | [diff] [blame] | 100 | jcenter() |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 101 | maven { url "https://dl.bintray.com/kotlin/kotlinx" } |
| 102 | maven { url 'https://dl.bintray.com/kotlin/kotlin-dev' } |
| 103 | maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 104 | } |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 105 | } |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 106 | |
Leonid Startsev | 1c35d91 | 2017-10-04 12:26:43 +0300 | [diff] [blame] | 107 | subprojects { |
Leonid Startsev | c1bb4d2 | 2018-10-23 18:50:39 +0300 | [diff] [blame] | 108 | tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all { task -> |
| 109 | if (task.name.contains("Test") || task.name.contains("Jmh")) { |
| 110 | task.kotlinOptions.freeCompilerArgs += experimentalsInTestEnabled |
| 111 | } else { |
| 112 | task.kotlinOptions.freeCompilerArgs += experimentalsEnabled |
| 113 | } |
| 114 | } |
| 115 | |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 116 | // Configure publishing for some artifacts |
Leonid Startsev | 133194c | 2018-07-13 12:58:36 +0300 | [diff] [blame] | 117 | if (project.name.contains("benchmark")) return |
Leonid Startsev | 45aa7c7 | 2019-04-23 21:29:03 +0300 | [diff] [blame] | 118 | apply from: rootProject.file('gradle/publishing.gradle') |
| 119 | } |
Leonid Startsev | ed87fbd | 2017-08-04 17:33:09 +0300 | [diff] [blame] | 120 | |
Vsevolod Tolstopyatov | fa2231c | 2019-05-29 17:39:15 +0300 | [diff] [blame^] | 121 | apply from: rootProject.file('gradle/compilerVersion.gradle') |