blob: e21c80e47a62ac4820663f7ca57dbd381068efb6 [file] [log] [blame]
Roman Elizarov26af9192017-09-21 18:12:04 +03001/*
Leonid Startsev0a9f0d62018-07-13 12:12:09 +03002 * Copyright 2018 JetBrains s.r.o.
Roman Elizarov26af9192017-09-21 18:12:04 +03003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Leonid Startsev08d3ca02017-07-26 15:16:23 +030017buildscript {
Leonid Startsevc563d232018-05-07 20:29:23 +030018 def deployNative = property('native.deploy') == 'true'
19
Leonid Startsevca620912017-11-09 19:55:51 +030020 if (project.hasProperty("bootstrap")) {
Leonid Startsev14b57df2018-06-13 23:18:22 +030021 ext.compilerVersion = property('kotlin.version.snapshot')
22 ext.librariesVersion = property('kotlin.version.snapshot')
Leonid Startsev476b7222018-06-26 17:06:14 +030023 ext.serializationPluginVersion = property('plugin.version.snapshot')
Leonid Startsevca620912017-11-09 19:55:51 +030024 } else {
Leonid Startsev8642a1f2018-04-03 17:38:39 +030025 ext.compilerVersion = property('kotlin.version')
26 ext.librariesVersion = property('kotlin.version')
Leonid Startsev14b57df2018-06-13 23:18:22 +030027 ext.serializationPluginVersion = property('plugin.version')
Leonid Startsevca620912017-11-09 19:55:51 +030028 }
Leonid Startsev9f9df892017-12-22 18:24:52 +030029 ext.eapChannel = 'https://dl.bintray.com/kotlin/kotlin-eap'
Leonid Startsev1e737f22017-09-14 13:19:32 +030030 ext.serializationRepo = 'https://kotlin.bintray.com/kotlinx'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030031
32 repositories {
Leonid Startsev1e737f22017-09-14 13:19:32 +030033 jcenter()
Leonid Startsev6fbc2152017-09-21 16:18:32 +030034 mavenLocal()
Vsevolod Tolstopyatove593b422018-06-28 11:23:49 +030035 maven { url "https://plugins.gradle.org/m2/" }
Leonid Startsev7dd8ad72017-11-22 19:24:02 +030036 maven { url eapChannel }
Leonid Startsev1e737f22017-09-14 13:19:32 +030037 maven { url serializationRepo }
Leonid Startsevbae49f92018-05-03 19:57:01 +030038 maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" }
Leonid Startsev08d3ca02017-07-26 15:16:23 +030039 }
40
41 dependencies {
Leonid Startsev1e737f22017-09-14 13:19:32 +030042 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$compilerVersion"
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030043 classpath "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$serializationPluginVersion"
Leonid Startsevbae49f92018-05-03 19:57:01 +030044 classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:${property('konan.version')}"
45
Leonid Startseved87fbd2017-08-04 17:33:09 +030046 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.2'
Leonid Startsevbae49f92018-05-03 19:57:01 +030047
Leonid Startsevc563d232018-05-07 20:29:23 +030048 if (deployNative) {
49 // use patched version which supports Gradle metadata, but is not compatible with Maven publications
50 classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.2-SNAPSHOT'
51 } else {
52 classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
53 }
Leonid Startsevbae49f92018-05-03 19:57:01 +030054
Vsevolod Tolstopyatove593b422018-06-28 11:23:49 +030055 classpath "com.github.jengelman.gradle.plugins:shadow:2.0.2"
56 classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.5"
57 classpath "net.ltgt.gradle:gradle-apt-plugin:0.10"
Leonid Startsev08d3ca02017-07-26 15:16:23 +030058 }
59}
60
Leonid Startsev00dd4f52017-08-23 16:09:21 +030061ext {
62 libraries = [
Leonid Startsev1e737f22017-09-14 13:19:32 +030063 kotlin_stdlib: "org.jetbrains.kotlin:kotlin-stdlib:$librariesVersion",
64 kotlin_stdlib_common: "org.jetbrains.kotlin:kotlin-stdlib-common:$librariesVersion",
65 kotlin_stdlib_js: "org.jetbrains.kotlin:kotlin-stdlib-js:$librariesVersion",
66 kotlin_test: "org.jetbrains.kotlin:kotlin-test:$librariesVersion",
Leonid Startsev8642a1f2018-04-03 17:38:39 +030067 kotlin_test_junit: "org.jetbrains.kotlin:kotlin-test-junit:$librariesVersion",
Leonid Startsev1e737f22017-09-14 13:19:32 +030068 kotlin_test_common: "org.jetbrains.kotlin:kotlin-test-common:$librariesVersion",
Leonid Startsev7dd8ad72017-11-22 19:24:02 +030069 kotlin_test_annotations_common: "org.jetbrains.kotlin:kotlin-test-annotations-common:$librariesVersion",
Leonid Startsev1e737f22017-09-14 13:19:32 +030070 kotlin_test_js: "org.jetbrains.kotlin:kotlin-test-js:$librariesVersion",
71 kotlin_reflect: "org.jetbrains.kotlin:kotlin-reflect:$librariesVersion",
Leonid Startsev00dd4f52017-08-23 16:09:21 +030072 ]
73}
74
75allprojects {
76 group 'org.jetbrains.kotlinx'
Leonid Startsev476b7222018-06-26 17:06:14 +030077 version '0.5.2'
78
79 if (project.hasProperty("bootstrap")) {
80 version = version + '-SNAPSHOT'
81 }
Leonid Startsev84062e12017-09-25 16:41:38 +030082
83 repositories {
84 jcenter()
Leonid Startsev7dd8ad72017-11-22 19:24:02 +030085 maven { url eapChannel }
Leonid Startsev84062e12017-09-25 16:41:38 +030086 mavenLocal()
87 }
Leonid Startsev00dd4f52017-08-23 16:09:21 +030088}
Leonid Startsev08d3ca02017-07-26 15:16:23 +030089
Leonid Startsev08d3ca02017-07-26 15:16:23 +030090apply plugin: 'kotlin'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030091
Leonid Startsev1c35d912017-10-04 12:26:43 +030092subprojects {
Leonid Startsev0a9f0d62018-07-13 12:12:09 +030093 if (project.name.contains("native")) return
Leonid Startsevbae49f92018-05-03 19:57:01 +030094
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030095 apply plugin: 'kotlinx-serialization'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030096
Leonid Startsev133194c2018-07-13 12:58:36 +030097 if (project.name.contains("benchmark")) return
98
Leonid Startsev00dd4f52017-08-23 16:09:21 +030099 apply plugin: 'maven-publish'
Leonid Startseved87fbd2017-08-04 17:33:09 +0300100
Leonid Startsevd79fb1f2017-09-15 18:02:59 +0300101 def varintName = ""
102
103 if (project.name == "jvm") {
104 varintName = "${rootProject.name}"
105 } else {
106 varintName = "${rootProject.name}-${project.name}"
107 }
Leonid Startseva5873932017-08-09 11:36:01 +0300108
Leonid Startsevef125382017-09-22 16:50:39 +0300109 afterEvaluate {
110 task sourceJar(type: Jar, dependsOn: classes) {
111 classifier 'sources'
112 from sourceSets.main.kotlin
Leonid Startsev88185402018-02-01 16:03:25 +0300113 if (project.name == "jvm" || project.name == "js") {
114 duplicatesStrategy = "exclude"
115 def platformSrc = sourceSets.main.kotlin
116 def commonSrc = project(':common').sourceSets.main.kotlin
117 from(platformSrc + commonSrc)
118 }
Leonid Startsevef125382017-09-22 16:50:39 +0300119 }
Leonid Startsev00dd4f52017-08-23 16:09:21 +0300120 }
Leonid Startseva5873932017-08-09 11:36:01 +0300121
Leonid Startsev00dd4f52017-08-23 16:09:21 +0300122 tasks.withType(Jar) {
123 archivesBaseName = varintName
124 }
Leonid Startseva5873932017-08-09 11:36:01 +0300125
Leonid Startsev00dd4f52017-08-23 16:09:21 +0300126 publishing {
127 publications {
Leonid Startsev1e737f22017-09-14 13:19:32 +0300128 mavenProject(MavenPublication) {
Leonid Startsev00dd4f52017-08-23 16:09:21 +0300129 from components.java
130 groupId project.group
131 artifactId varintName
132 version project.version
133
134 artifact sourceJar {
135 classifier "sources"
136 }
Leonid Startseva5873932017-08-09 11:36:01 +0300137 }
Leonid Startsev08d3ca02017-07-26 15:16:23 +0300138 }
139 }
Leonid Startsev1e737f22017-09-14 13:19:32 +0300140
Leonid Startsevbae49f92018-05-03 19:57:01 +0300141 apply plugin: 'com.jfrog.bintray'
Leonid Startsevc563d232018-05-07 20:29:23 +0300142
143 apply from: "${rootProject.rootDir}/gradle/bintray.gradle"
Leonid Startsevda728dd2018-03-07 12:41:47 +0300144}