| /* |
| * Copyright 2017-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
| */ |
| |
| buildscript { |
| /* |
| * These property group is used to build kotlinx.atomicfu against Kotlin compiler snapshot. |
| * How does it work: |
| * When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version, |
| * Additionally, mavenLocal and Sonatype snapshots are added to repository list (the former is required for AFU and public |
| * the latter is required for compiler snapshots). |
| * 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" } |
| } |
| } |
| |
| repositories { |
| jcenter() |
| maven { url "https://plugins.gradle.org/m2/" } |
| maven { url "https://kotlin.bintray.com/kotlin-dev" } |
| maven { url "https://kotlin.bintray.com/kotlin-eap" } |
| maven { url "https://jetbrains.bintray.com/kotlin-native-dependencies" } |
| } |
| |
| dependencies { |
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version" |
| classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version" |
| } |
| } |
| |
| allprojects { |
| if (build_snapshot_train) { |
| kotlin_version = rootProject.properties['kotlin_snapshot_version'] |
| repositories { |
| mavenLocal() |
| maven { url "https://oss.sonatype.org/content/repositories/snapshots" } |
| } |
| } |
| |
| println "Using Kotlin $kotlin_version for project $it" |
| repositories { |
| jcenter() |
| maven { url "https://kotlin.bintray.com/kotlin-eap" } |
| maven { url "https://kotlin.bintray.com/kotlin-dev" } |
| maven { url "https://kotlin.bintray.com/kotlinx" } |
| } |
| |
| def deployVersion = properties['DeployVersion'] |
| if (deployVersion != null) version = deployVersion |
| |
| // 'atomicfu-native' check is a kludge so that existing YouTrack config works, todo: remove |
| if (project != rootProject && project.name != 'atomicfu-native') { |
| apply from: rootProject.file("gradle/publish-bintray.gradle") |
| } |
| } |
| |
| println("Using Kotlin compiler version: $org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION") |
| if (build_snapshot_train) { |
| afterEvaluate { |
| println "Manifest of kotlin-compiler-embeddable.jar for atomicfu" |
| configure(subprojects.findAll { it.name == "atomicfu" }) { |
| configurations.matching { it.name == "kotlinCompilerClasspath" }.all { |
| resolvedConfiguration.getFiles().findAll { it.name.contains("kotlin-compiler-embeddable") }.each { |
| def manifest = zipTree(it).matching { |
| include 'META-INF/MANIFEST.MF' |
| }.getFiles().first() |
| |
| manifest.readLines().each { |
| println it |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| // main deployment task |
| task deploy(dependsOn: getTasksByName("bintrayUpload", true) + getTasksByName("publishNpm", true)) |