blob: 5055c50a694b5603feec8c2413a00bb71a7e7569 [file] [log] [blame]
Roman Elizarov26af9192017-09-21 18:12:04 +03001/*
Vsevolod Tolstopyatov74b48022019-04-02 18:56:29 +03002 * Copyright 2017-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
Roman Elizarov26af9192017-09-21 18:12:04 +03003 */
4
Leonid Startsev08d3ca02017-07-26 15:16:23 +03005buildscript {
Leonid Startsevca620912017-11-09 19:55:51 +03006 if (project.hasProperty("bootstrap")) {
Leonid Startsev45aa7c72019-04-23 21:29:03 +03007 ext.kotlin_version = property('kotlin.version.snapshot')
Leonid Startsev12a00032018-11-08 19:05:36 +03008 ext["org.jetbrains.kotlin.native.home"] = System.getenv("KONAN_LOCAL_DIST")
Leonid Startsevca620912017-11-09 19:55:51 +03009 } else {
Leonid Startsev45aa7c72019-04-23 21:29:03 +030010 ext.kotlin_version = property('kotlin.version')
Leonid Startsevca620912017-11-09 19:55:51 +030011 }
Leonid Startsevb0fd1202018-12-12 19:42:48 +030012 ext.experimentalsEnabled = ["-progressive", "-Xuse-experimental=kotlin.Experimental",
Leonid Startsevc1bb4d22018-10-23 18:50:39 +030013 "-Xuse-experimental=kotlin.ExperimentalMultiplatform",
Vsevolod Tolstopyatov74b48022019-04-02 18:56:29 +030014 ]
Leonid Startsevc1bb4d22018-10-23 18:50:39 +030015
Leonid Startsevb0fd1202018-12-12 19:42:48 +030016 ext.experimentalsInTestEnabled = ["-progressive", "-Xuse-experimental=kotlin.Experimental",
Vsevolod Tolstopyatov74b48022019-04-02 18:56:29 +030017 "-Xuse-experimental=kotlin.ExperimentalMultiplatform",
18 "-Xuse-experimental=kotlinx.serialization.ImplicitReflectionSerializer",
19 "-Xuse-experimental=kotlinx.serialization.UnstableDefault"
20 ]
Leonid Startsev08d3ca02017-07-26 15:16:23 +030021
22 repositories {
Leonid Startsev6fbc2152017-09-21 16:18:32 +030023 mavenLocal()
Leonid Startsev45aa7c72019-04-23 21:29:03 +030024 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 Startsevbae49f92018-05-03 19:57:01 +030028 maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" }
Leonid Startsev97b71872019-02-05 13:04:43 +030029 jcenter()
Leonid Startsev45aa7c72019-04-23 21:29:03 +030030 gradlePluginPortal()
Leonid Startsev08d3ca02017-07-26 15:16:23 +030031 }
32
33 dependencies {
Leonid Startsev45aa7c72019-04-23 21:29:03 +030034 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 Startsevbae49f92018-05-03 19:57:01 +030038
Leonid Startsev45aa7c72019-04-23 21:29:03 +030039 // Protobuf is udes in JVM tests
40 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
Leonid Startsevbae49f92018-05-03 19:57:01 +030041
Leonid Startsev45aa7c72019-04-23 21:29:03 +030042 // 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 Startsev08d3ca02017-07-26 15:16:23 +030046 }
47}
48
Leonid Startsev45aa7c72019-04-23 21:29:03 +030049apply plugin: 'kotlinx.team.infra'
50
51infra {
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 Startsev00dd4f52017-08-23 16:09:21 +030059}
60
61allprojects {
62 group 'org.jetbrains.kotlinx'
Leonid Startsev476b7222018-06-26 17:06:14 +030063
64 if (project.hasProperty("bootstrap")) {
65 version = version + '-SNAPSHOT'
66 }
Leonid Startsev84062e12017-09-25 16:41:38 +030067
68 repositories {
Leonid Startsev84062e12017-09-25 16:41:38 +030069 mavenLocal()
Leonid Startsev97b71872019-02-05 13:04:43 +030070 jcenter()
Leonid Startsev45aa7c72019-04-23 21:29:03 +030071 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 Startsev84062e12017-09-25 16:41:38 +030074 }
Leonid Startsev00dd4f52017-08-23 16:09:21 +030075}
Leonid Startsev08d3ca02017-07-26 15:16:23 +030076
Leonid Startsev1c35d912017-10-04 12:26:43 +030077subprojects {
Leonid Startsevc1bb4d22018-10-23 18:50:39 +030078 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 Startsev45aa7c72019-04-23 21:29:03 +030086 // Configure publishing for some artifacts
Leonid Startsev133194c2018-07-13 12:58:36 +030087 if (project.name.contains("benchmark")) return
88
Leonid Startsev45aa7c72019-04-23 21:29:03 +030089 apply from: rootProject.file('gradle/publishing.gradle')
90}
Leonid Startseved87fbd2017-08-04 17:33:09 +030091
Leonid Startsev45aa7c72019-04-23 21:29:03 +030092afterEvaluate {
93 println("Using Kotlin compiler version: $org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION")
Leonid Startsevda728dd2018-03-07 12:41:47 +030094}