| /* |
| * Copyright 2017-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
| */ |
| |
| buildscript { |
| if (project.hasProperty("bootstrap")) { |
| ext.kotlin_version = property('kotlin.version.snapshot') |
| ext["org.jetbrains.kotlin.native.home"] = System.getenv("KONAN_LOCAL_DIST") |
| } else { |
| ext.kotlin_version = property('kotlin.version') |
| } |
| ext.experimentalsEnabled = ["-progressive", "-Xuse-experimental=kotlin.Experimental", |
| "-Xuse-experimental=kotlin.ExperimentalMultiplatform", |
| ] |
| |
| ext.experimentalsInTestEnabled = ["-progressive", "-Xuse-experimental=kotlin.Experimental", |
| "-Xuse-experimental=kotlin.ExperimentalMultiplatform", |
| "-Xuse-experimental=kotlinx.serialization.ImplicitReflectionSerializer", |
| "-Xuse-experimental=kotlinx.serialization.UnstableDefault" |
| ] |
| |
| /* |
| * These property group is used to build kotlinx.serialization against Kotlin compiler snapshot. |
| * When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version. |
| * DO NOT change the name of these properties without adapting kotlinx.train build chain. |
| */ |
| def prop = rootProject.properties['build_snapshot_train'] |
| ext.build_snapshot_train = prop != null && prop != "" |
| if (build_snapshot_train) { |
| ext.kotlin_version = rootProject.properties['kotlin_snapshot_version'] |
| if (kotlin_version == null) { |
| throw new IllegalArgumentException("'kotlin_snapshot_version' should be defined when building with snapshot compiler") |
| } |
| repositories { |
| mavenLocal() |
| maven { url "https://oss.sonatype.org/content/repositories/snapshots" } |
| maven { url "https://bintray.com/jetbrains/kotlin-native-dependencies" } |
| } |
| } |
| |
| repositories { |
| mavenLocal() |
| maven { url 'https://kotlin.bintray.com/kotlin-dev' } |
| maven { url 'https://kotlin.bintray.com/kotlin-eap' } |
| maven { url 'https://kotlin.bintray.com/kotlinx' } |
| maven { url "https://dl.bintray.com/orangy/maven" } |
| maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" } |
| jcenter() |
| gradlePluginPortal() |
| } |
| |
| dependencies { |
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" |
| classpath "kotlinx.team:kotlinx.team.infra:$infra_version" |
| classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version" |
| |
| // Protobuf is udes in JVM tests |
| classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8' |
| |
| // Various benchmarking stuff |
| classpath "com.github.jengelman.gradle.plugins:shadow:4.0.2" |
| classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.8" |
| classpath "net.ltgt.gradle:gradle-apt-plugin:0.21" |
| } |
| } |
| |
| apply plugin: 'kotlinx.team.infra' |
| // To make it visible for compilerVersion.gradle |
| ext.compilerVersion = org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION |
| |
| infra { |
| teamcity {} |
| node { |
| version = '10.15.1' |
| mocha('4.1.0') |
| install("source-map-support", "0.5.3") |
| install("mocha-teamcity-reporter", "2.2.2") |
| } |
| } |
| |
| allprojects { |
| group 'org.jetbrains.kotlinx' |
| |
| if (project.hasProperty("bootstrap")) { |
| version = version + '-SNAPSHOT' |
| } |
| |
| if (build_snapshot_train) { |
| // Snapshot-specific |
| def deployVersion = properties['DeployVersion'] |
| if (deployVersion != null) version = deployVersion |
| repositories { |
| mavenLocal() |
| maven { url "https://oss.sonatype.org/content/repositories/snapshots" } |
| } |
| } |
| repositories { |
| mavenLocal() |
| jcenter() |
| maven { url "https://dl.bintray.com/kotlin/kotlinx" } |
| maven { url 'https://dl.bintray.com/kotlin/kotlin-dev' } |
| maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } |
| } |
| } |
| |
| subprojects { |
| tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all { task -> |
| if (task.name.contains("Test") || task.name.contains("Jmh")) { |
| task.kotlinOptions.freeCompilerArgs += experimentalsInTestEnabled |
| } else { |
| task.kotlinOptions.freeCompilerArgs += experimentalsEnabled |
| } |
| } |
| |
| // Configure publishing for some artifacts |
| if (project.name.contains("benchmark")) return |
| apply from: rootProject.file('gradle/publishing.gradle') |
| } |
| |
| apply from: rootProject.file('gradle/compilerVersion.gradle') |