blob: 17f519bbfadaf56ef2b0dbc0cb596194fd0e559b [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 Startsev1e737f22017-09-14 13:19:32 +030018 ext.compilerVersion = '1.1.50-eap-18'
19 ext.librariesVersion = '1.1.50-eap-18'
20 ext.eapChannel = 'https://dl.bintray.com/kotlin/kotlin-eap-1.1'
21 ext.serializationRepo = 'https://kotlin.bintray.com/kotlinx'
22 ext.serializationPluginVersion = '0.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 }
28 maven { url eapChannel }
Leonid Startsev08d3ca02017-07-26 15:16:23 +030029 }
30
31 dependencies {
Leonid Startsev1e737f22017-09-14 13:19:32 +030032 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$compilerVersion"
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030033 classpath "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$serializationPluginVersion"
Leonid Startsev1e737f22017-09-14 13:19:32 +030034
Leonid Startseved87fbd2017-08-04 17:33:09 +030035 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.2'
Leonid Startsev1e737f22017-09-14 13:19:32 +030036
37 classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030038 }
39}
40
Leonid Startsev00dd4f52017-08-23 16:09:21 +030041ext {
42 libraries = [
Leonid Startsev1e737f22017-09-14 13:19:32 +030043 kotlin_stdlib: "org.jetbrains.kotlin:kotlin-stdlib:$librariesVersion",
44 kotlin_stdlib_common: "org.jetbrains.kotlin:kotlin-stdlib-common:$librariesVersion",
45 kotlin_stdlib_js: "org.jetbrains.kotlin:kotlin-stdlib-js:$librariesVersion",
46 kotlin_test: "org.jetbrains.kotlin:kotlin-test:$librariesVersion",
47 kotlin_test_common: "org.jetbrains.kotlin:kotlin-test-common:$librariesVersion",
48 kotlin_test_js: "org.jetbrains.kotlin:kotlin-test-js:$librariesVersion",
49 kotlin_reflect: "org.jetbrains.kotlin:kotlin-reflect:$librariesVersion",
Leonid Startsev00dd4f52017-08-23 16:09:21 +030050 ]
51}
52
53allprojects {
54 group 'org.jetbrains.kotlinx'
Leonid Startsev1e737f22017-09-14 13:19:32 +030055 version '0.1'
Leonid Startsev00dd4f52017-08-23 16:09:21 +030056}
Leonid Startsev08d3ca02017-07-26 15:16:23 +030057
Leonid Startsev08d3ca02017-07-26 15:16:23 +030058apply plugin: 'kotlin'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030059
Leonid Startsev00dd4f52017-08-23 16:09:21 +030060configure([project(':jvm'), project(':js')]) {
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030061 apply plugin: 'kotlinx-serialization'
Leonid Startsev08d3ca02017-07-26 15:16:23 +030062
Leonid Startsev00dd4f52017-08-23 16:09:21 +030063 apply plugin: 'maven-publish'
Leonid Startsev1e737f22017-09-14 13:19:32 +030064 apply plugin: 'com.jfrog.bintray'
Leonid Startseved87fbd2017-08-04 17:33:09 +030065
Leonid Startsevd79fb1f2017-09-15 18:02:59 +030066 def varintName = ""
67
68 if (project.name == "jvm") {
69 varintName = "${rootProject.name}"
70 } else {
71 varintName = "${rootProject.name}-${project.name}"
72 }
Leonid Startseva5873932017-08-09 11:36:01 +030073
Leonid Startsev00dd4f52017-08-23 16:09:21 +030074 task sourceJar(type: Jar, dependsOn: classes) {
75 classifier 'sources'
76 from sourceSets.main.allSource
77 }
Leonid Startseva5873932017-08-09 11:36:01 +030078
Leonid Startsev00dd4f52017-08-23 16:09:21 +030079 tasks.withType(Jar) {
80 archivesBaseName = varintName
81 }
Leonid Startseva5873932017-08-09 11:36:01 +030082
Leonid Startsev00dd4f52017-08-23 16:09:21 +030083 publishing {
84 publications {
Leonid Startsev1e737f22017-09-14 13:19:32 +030085 mavenProject(MavenPublication) {
Leonid Startsev00dd4f52017-08-23 16:09:21 +030086 from components.java
87 groupId project.group
88 artifactId varintName
89 version project.version
90
91 artifact sourceJar {
92 classifier "sources"
93 }
Leonid Startseva5873932017-08-09 11:36:01 +030094 }
Leonid Startsev08d3ca02017-07-26 15:16:23 +030095 }
96 }
Leonid Startsev1e737f22017-09-14 13:19:32 +030097
98 bintray {
99 user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
100 key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
101 publications = ['mavenProject']
102 pkg {
103 repo = 'kotlinx'
104 name = 'kotlinx.serialization.runtime'
105 userOrg = 'kotlin'
106 licenses = ['Apache-2.0']
107 vcsUrl = 'https://github.com/Kotlin/kotlinx.serialization'
108 websiteUrl = 'https://github.com/Kotlin/kotlinx.serialization'
109 issueTrackerUrl = 'https://github.com/Kotlin/kotlinx.serialization/issues'
110
111 githubRepo = 'Kotlin/kotlinx.serialization'
112 version {
113 name = project.version
114 }
115 }
116 }
Leonid Startsev08d3ca02017-07-26 15:16:23 +0300117}