blob: 031ec44c26f7277daa762ca1a90d89823e962772 [file] [log] [blame]
Roman Elizarov26af9192017-09-21 18:12:04 +03001/*
2 * Copyright 2017 JetBrains s.r.o.
3 *
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")) {
19 ext.compilerVersion = '1.2-SNAPSHOT'
20 ext.librariesVersion = '1.2-SNAPSHOT'
21 ext.serializationPluginVersion = '0.2-SNAPSHOT'
22 } else {
23 ext.compilerVersion = '1.1.50'
24 ext.librariesVersion = '1.1.50'
25 ext.serializationPluginVersion = '0.2'
26 }
Leonid Startsevf37faa82017-10-20 16:19:49 +030027 ext.eapChannel = 'https://dl.bintray.com/kotlin/kotlin-eap-1.1'
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 Startsev1e737f22017-09-14 13:19:32 +030033 maven { url serializationRepo }
Leonid Startsev08d3ca02017-07-26 15:16:23 +030034 }
35
36 dependencies {
Leonid Startsev1e737f22017-09-14 13:19:32 +030037 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$compilerVersion"
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030038 classpath "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$serializationPluginVersion"
Leonid Startsev1e737f22017-09-14 13:19:32 +030039
Leonid Startseved87fbd2017-08-04 17:33:09 +030040 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.2'
Leonid Startsev1e737f22017-09-14 13:19:32 +030041
42 classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030043 }
44}
45
Leonid Startsev00dd4f52017-08-23 16:09:21 +030046ext {
47 libraries = [
Leonid Startsev1e737f22017-09-14 13:19:32 +030048 kotlin_stdlib: "org.jetbrains.kotlin:kotlin-stdlib:$librariesVersion",
49 kotlin_stdlib_common: "org.jetbrains.kotlin:kotlin-stdlib-common:$librariesVersion",
50 kotlin_stdlib_js: "org.jetbrains.kotlin:kotlin-stdlib-js:$librariesVersion",
51 kotlin_test: "org.jetbrains.kotlin:kotlin-test:$librariesVersion",
52 kotlin_test_common: "org.jetbrains.kotlin:kotlin-test-common:$librariesVersion",
53 kotlin_test_js: "org.jetbrains.kotlin:kotlin-test-js:$librariesVersion",
54 kotlin_reflect: "org.jetbrains.kotlin:kotlin-reflect:$librariesVersion",
Leonid Startsev00dd4f52017-08-23 16:09:21 +030055 ]
56}
57
58allprojects {
59 group 'org.jetbrains.kotlinx'
Leonid Startsevf1c89182017-10-19 20:12:22 +030060 version '0.2'
Leonid Startsev84062e12017-09-25 16:41:38 +030061
62 repositories {
63 jcenter()
64 mavenLocal()
65 }
Leonid Startsev00dd4f52017-08-23 16:09:21 +030066}
Leonid Startsev08d3ca02017-07-26 15:16:23 +030067
Leonid Startsev08d3ca02017-07-26 15:16:23 +030068apply plugin: 'kotlin'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030069
Leonid Startsev1c35d912017-10-04 12:26:43 +030070subprojects {
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030071 apply plugin: 'kotlinx-serialization'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030072
Leonid Startsev00dd4f52017-08-23 16:09:21 +030073 apply plugin: 'maven-publish'
Leonid Startsev1e737f22017-09-14 13:19:32 +030074 apply plugin: 'com.jfrog.bintray'
Leonid Startseved87fbd2017-08-04 17:33:09 +030075
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030076 def varintName = ""
77
78 if (project.name == "jvm") {
79 varintName = "${rootProject.name}"
80 } else {
81 varintName = "${rootProject.name}-${project.name}"
82 }
Leonid Startseva5873932017-08-09 11:36:01 +030083
Leonid Startsevef125382017-09-22 16:50:39 +030084 afterEvaluate {
85 task sourceJar(type: Jar, dependsOn: classes) {
86 classifier 'sources'
87 from sourceSets.main.kotlin
88 duplicatesStrategy = "exclude"
89 def platformSrc = sourceSets.main.kotlin
90 def commonSrc = project(':common').sourceSets.main.kotlin
91 from (platformSrc + commonSrc)
92 }
Leonid Startsev00dd4f52017-08-23 16:09:21 +030093 }
Leonid Startseva5873932017-08-09 11:36:01 +030094
Leonid Startsev00dd4f52017-08-23 16:09:21 +030095 tasks.withType(Jar) {
96 archivesBaseName = varintName
97 }
Leonid Startseva5873932017-08-09 11:36:01 +030098
Leonid Startsev00dd4f52017-08-23 16:09:21 +030099 publishing {
100 publications {
Leonid Startsev1e737f22017-09-14 13:19:32 +0300101 mavenProject(MavenPublication) {
Leonid Startsev00dd4f52017-08-23 16:09:21 +0300102 from components.java
103 groupId project.group
104 artifactId varintName
105 version project.version
106
107 artifact sourceJar {
108 classifier "sources"
109 }
Leonid Startseva5873932017-08-09 11:36:01 +0300110 }
Leonid Startsev08d3ca02017-07-26 15:16:23 +0300111 }
112 }
Leonid Startsev1e737f22017-09-14 13:19:32 +0300113
114 bintray {
115 user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
116 key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
117 publications = ['mavenProject']
118 pkg {
119 repo = 'kotlinx'
120 name = 'kotlinx.serialization.runtime'
121 userOrg = 'kotlin'
122 licenses = ['Apache-2.0']
123 vcsUrl = 'https://github.com/Kotlin/kotlinx.serialization'
124 websiteUrl = 'https://github.com/Kotlin/kotlinx.serialization'
125 issueTrackerUrl = 'https://github.com/Kotlin/kotlinx.serialization/issues'
126
127 githubRepo = 'Kotlin/kotlinx.serialization'
128 version {
129 name = project.version
130 }
131 }
132 }
Leonid Startsev08d3ca02017-07-26 15:16:23 +0300133}