blob: 5959deed1f925b8df87717fe322088c524d4a077 [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 Startsev84062e12017-09-25 16:41:38 +030018 ext.compilerVersion = '1.1.50'
19 ext.librariesVersion = '1.1.50'
Leonid Startsev1e737f22017-09-14 13:19:32 +030020 ext.eapChannel = 'https://dl.bintray.com/kotlin/kotlin-eap-1.1'
21 ext.serializationRepo = 'https://kotlin.bintray.com/kotlinx'
Leonid Startsevf665fbd2017-09-29 18:13:28 +030022 ext.serializationPluginVersion = '0.1.1'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030023
24 repositories {
Leonid Startsev1e737f22017-09-14 13:19:32 +030025 jcenter()
Leonid Startsev6fbc2152017-09-21 16:18:32 +030026 mavenLocal()
Leonid Startsev1e737f22017-09-14 13:19:32 +030027 maven { url serializationRepo }
Leonid Startsev08d3ca02017-07-26 15:16:23 +030028 }
29
30 dependencies {
Leonid Startsev1e737f22017-09-14 13:19:32 +030031 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$compilerVersion"
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030032 classpath "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$serializationPluginVersion"
Leonid Startsev1e737f22017-09-14 13:19:32 +030033
Leonid Startseved87fbd2017-08-04 17:33:09 +030034 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.2'
Leonid Startsev1e737f22017-09-14 13:19:32 +030035
36 classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030037 }
38}
39
Leonid Startsev00dd4f52017-08-23 16:09:21 +030040ext {
41 libraries = [
Leonid Startsev1e737f22017-09-14 13:19:32 +030042 kotlin_stdlib: "org.jetbrains.kotlin:kotlin-stdlib:$librariesVersion",
43 kotlin_stdlib_common: "org.jetbrains.kotlin:kotlin-stdlib-common:$librariesVersion",
44 kotlin_stdlib_js: "org.jetbrains.kotlin:kotlin-stdlib-js:$librariesVersion",
45 kotlin_test: "org.jetbrains.kotlin:kotlin-test:$librariesVersion",
46 kotlin_test_common: "org.jetbrains.kotlin:kotlin-test-common:$librariesVersion",
47 kotlin_test_js: "org.jetbrains.kotlin:kotlin-test-js:$librariesVersion",
48 kotlin_reflect: "org.jetbrains.kotlin:kotlin-reflect:$librariesVersion",
Leonid Startsev00dd4f52017-08-23 16:09:21 +030049 ]
50}
51
52allprojects {
53 group 'org.jetbrains.kotlinx'
Leonid Startsevf665fbd2017-09-29 18:13:28 +030054 version '0.1.1'
Leonid Startsev84062e12017-09-25 16:41:38 +030055
56 repositories {
57 jcenter()
58 mavenLocal()
59 }
Leonid Startsev00dd4f52017-08-23 16:09:21 +030060}
Leonid Startsev08d3ca02017-07-26 15:16:23 +030061
Leonid Startsev08d3ca02017-07-26 15:16:23 +030062apply plugin: 'kotlin'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030063
Leonid Startsev1c35d912017-10-04 12:26:43 +030064subprojects {
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030065 apply plugin: 'kotlinx-serialization'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030066
Leonid Startsev00dd4f52017-08-23 16:09:21 +030067 apply plugin: 'maven-publish'
Leonid Startsev1e737f22017-09-14 13:19:32 +030068 apply plugin: 'com.jfrog.bintray'
Leonid Startseved87fbd2017-08-04 17:33:09 +030069
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030070 def varintName = ""
71
72 if (project.name == "jvm") {
73 varintName = "${rootProject.name}"
74 } else {
75 varintName = "${rootProject.name}-${project.name}"
76 }
Leonid Startseva5873932017-08-09 11:36:01 +030077
Leonid Startsevef125382017-09-22 16:50:39 +030078 afterEvaluate {
79 task sourceJar(type: Jar, dependsOn: classes) {
80 classifier 'sources'
81 from sourceSets.main.kotlin
82 duplicatesStrategy = "exclude"
83 def platformSrc = sourceSets.main.kotlin
84 def commonSrc = project(':common').sourceSets.main.kotlin
85 from (platformSrc + commonSrc)
86 }
Leonid Startsev00dd4f52017-08-23 16:09:21 +030087 }
Leonid Startseva5873932017-08-09 11:36:01 +030088
Leonid Startsev00dd4f52017-08-23 16:09:21 +030089 tasks.withType(Jar) {
90 archivesBaseName = varintName
91 }
Leonid Startseva5873932017-08-09 11:36:01 +030092
Leonid Startsev00dd4f52017-08-23 16:09:21 +030093 publishing {
94 publications {
Leonid Startsev1e737f22017-09-14 13:19:32 +030095 mavenProject(MavenPublication) {
Leonid Startsev00dd4f52017-08-23 16:09:21 +030096 from components.java
97 groupId project.group
98 artifactId varintName
99 version project.version
100
101 artifact sourceJar {
102 classifier "sources"
103 }
Leonid Startseva5873932017-08-09 11:36:01 +0300104 }
Leonid Startsev08d3ca02017-07-26 15:16:23 +0300105 }
106 }
Leonid Startsev1e737f22017-09-14 13:19:32 +0300107
108 bintray {
109 user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
110 key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
111 publications = ['mavenProject']
112 pkg {
113 repo = 'kotlinx'
114 name = 'kotlinx.serialization.runtime'
115 userOrg = 'kotlin'
116 licenses = ['Apache-2.0']
117 vcsUrl = 'https://github.com/Kotlin/kotlinx.serialization'
118 websiteUrl = 'https://github.com/Kotlin/kotlinx.serialization'
119 issueTrackerUrl = 'https://github.com/Kotlin/kotlinx.serialization/issues'
120
121 githubRepo = 'Kotlin/kotlinx.serialization'
122 version {
123 name = project.version
124 }
125 }
126 }
Leonid Startsev08d3ca02017-07-26 15:16:23 +0300127}