blob: ca6a72619ee97942c434a2b708e2c8446b5a8c1b [file] [log] [blame]
Roman Elizarov26af9192017-09-21 18:12:04 +03001/*
Leonid Startsev8642a1f2018-04-03 17:38:39 +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 Startsevca620912017-11-09 19:55:51 +030018 if (project.hasProperty("bootstrap")) {
Leonid Startsev14b57df2018-06-13 23:18:22 +030019 ext.compilerVersion = property('kotlin.version.snapshot')
20 ext.librariesVersion = property('kotlin.version.snapshot')
21 ext.serializationPluginVersion = property('plugin.version') + '-SNAPSHOT'
Leonid Startsevca620912017-11-09 19:55:51 +030022 } else {
Leonid Startsev8642a1f2018-04-03 17:38:39 +030023 ext.compilerVersion = property('kotlin.version')
24 ext.librariesVersion = property('kotlin.version')
Leonid Startsev14b57df2018-06-13 23:18:22 +030025 ext.serializationPluginVersion = property('plugin.version')
Leonid Startsevca620912017-11-09 19:55:51 +030026 }
Leonid Startsev9f9df892017-12-22 18:24:52 +030027 ext.eapChannel = 'https://dl.bintray.com/kotlin/kotlin-eap'
Leonid Startsev1e737f22017-09-14 13:19:32 +030028 ext.serializationRepo = 'https://kotlin.bintray.com/kotlinx'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030029
30 repositories {
Leonid Startsev1e737f22017-09-14 13:19:32 +030031 jcenter()
Leonid Startsev6fbc2152017-09-21 16:18:32 +030032 mavenLocal()
Leonid Startsev7dd8ad72017-11-22 19:24:02 +030033 maven { url eapChannel }
Leonid Startsev1e737f22017-09-14 13:19:32 +030034 maven { url serializationRepo }
Leonid Startsev08d3ca02017-07-26 15:16:23 +030035 }
36
37 dependencies {
Leonid Startsev1e737f22017-09-14 13:19:32 +030038 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$compilerVersion"
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030039 classpath "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$serializationPluginVersion"
Leonid Startsev1e737f22017-09-14 13:19:32 +030040
Leonid Startseved87fbd2017-08-04 17:33:09 +030041 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.2'
Leonid Startsev1e737f22017-09-14 13:19:32 +030042
43 classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030044 }
45}
46
Leonid Startsev00dd4f52017-08-23 16:09:21 +030047ext {
48 libraries = [
Leonid Startsev1e737f22017-09-14 13:19:32 +030049 kotlin_stdlib: "org.jetbrains.kotlin:kotlin-stdlib:$librariesVersion",
50 kotlin_stdlib_common: "org.jetbrains.kotlin:kotlin-stdlib-common:$librariesVersion",
51 kotlin_stdlib_js: "org.jetbrains.kotlin:kotlin-stdlib-js:$librariesVersion",
52 kotlin_test: "org.jetbrains.kotlin:kotlin-test:$librariesVersion",
Leonid Startsev8642a1f2018-04-03 17:38:39 +030053 kotlin_test_junit: "org.jetbrains.kotlin:kotlin-test-junit:$librariesVersion",
Leonid Startsev1e737f22017-09-14 13:19:32 +030054 kotlin_test_common: "org.jetbrains.kotlin:kotlin-test-common:$librariesVersion",
Leonid Startsev7dd8ad72017-11-22 19:24:02 +030055 kotlin_test_annotations_common: "org.jetbrains.kotlin:kotlin-test-annotations-common:$librariesVersion",
Leonid Startsev1e737f22017-09-14 13:19:32 +030056 kotlin_test_js: "org.jetbrains.kotlin:kotlin-test-js:$librariesVersion",
57 kotlin_reflect: "org.jetbrains.kotlin:kotlin-reflect:$librariesVersion",
Leonid Startsev00dd4f52017-08-23 16:09:21 +030058 ]
59}
60
61allprojects {
62 group 'org.jetbrains.kotlinx'
Leonid Startsev14b57df2018-06-13 23:18:22 +030063 version '0.5.1'
Leonid Startsev84062e12017-09-25 16:41:38 +030064
65 repositories {
66 jcenter()
Leonid Startsev7dd8ad72017-11-22 19:24:02 +030067 maven { url eapChannel }
Leonid Startsev84062e12017-09-25 16:41:38 +030068 mavenLocal()
69 }
Leonid Startsev00dd4f52017-08-23 16:09:21 +030070}
Leonid Startsev08d3ca02017-07-26 15:16:23 +030071
Leonid Startsev08d3ca02017-07-26 15:16:23 +030072apply plugin: 'kotlin'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030073
Leonid Startsev1c35d912017-10-04 12:26:43 +030074subprojects {
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030075 apply plugin: 'kotlinx-serialization'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030076
Leonid Startsev00dd4f52017-08-23 16:09:21 +030077 apply plugin: 'maven-publish'
Leonid Startsev1e737f22017-09-14 13:19:32 +030078 apply plugin: 'com.jfrog.bintray'
Leonid Startseved87fbd2017-08-04 17:33:09 +030079
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030080 def varintName = ""
81
82 if (project.name == "jvm") {
83 varintName = "${rootProject.name}"
84 } else {
85 varintName = "${rootProject.name}-${project.name}"
86 }
Leonid Startseva5873932017-08-09 11:36:01 +030087
Leonid Startsevef125382017-09-22 16:50:39 +030088 afterEvaluate {
89 task sourceJar(type: Jar, dependsOn: classes) {
90 classifier 'sources'
91 from sourceSets.main.kotlin
Leonid Startsev88185402018-02-01 16:03:25 +030092 if (project.name == "jvm" || project.name == "js") {
93 duplicatesStrategy = "exclude"
94 def platformSrc = sourceSets.main.kotlin
95 def commonSrc = project(':common').sourceSets.main.kotlin
96 from(platformSrc + commonSrc)
97 }
Leonid Startsevef125382017-09-22 16:50:39 +030098 }
Leonid Startsev00dd4f52017-08-23 16:09:21 +030099 }
Leonid Startseva5873932017-08-09 11:36:01 +0300100
Leonid Startsev00dd4f52017-08-23 16:09:21 +0300101 tasks.withType(Jar) {
102 archivesBaseName = varintName
103 }
Leonid Startseva5873932017-08-09 11:36:01 +0300104
Leonid Startsev00dd4f52017-08-23 16:09:21 +0300105 publishing {
106 publications {
Leonid Startsev1e737f22017-09-14 13:19:32 +0300107 mavenProject(MavenPublication) {
Leonid Startsev00dd4f52017-08-23 16:09:21 +0300108 from components.java
109 groupId project.group
110 artifactId varintName
111 version project.version
112
113 artifact sourceJar {
114 classifier "sources"
115 }
Leonid Startseva5873932017-08-09 11:36:01 +0300116 }
Leonid Startsev08d3ca02017-07-26 15:16:23 +0300117 }
118 }
Leonid Startsev1e737f22017-09-14 13:19:32 +0300119
120 bintray {
121 user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
122 key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
123 publications = ['mavenProject']
124 pkg {
125 repo = 'kotlinx'
126 name = 'kotlinx.serialization.runtime'
127 userOrg = 'kotlin'
128 licenses = ['Apache-2.0']
129 vcsUrl = 'https://github.com/Kotlin/kotlinx.serialization'
130 websiteUrl = 'https://github.com/Kotlin/kotlinx.serialization'
131 issueTrackerUrl = 'https://github.com/Kotlin/kotlinx.serialization/issues'
132
133 githubRepo = 'Kotlin/kotlinx.serialization'
134 version {
135 name = project.version
136 }
137 }
138 }
Leonid Startsevda728dd2018-03-07 12:41:47 +0300139}