Roman Elizarov | 26af919 | 2017-09-21 18:12:04 +0300 | [diff] [blame] | 1 | /* |
| 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 Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 17 | buildscript { |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 18 | ext.compilerVersion = '1.1.50' |
| 19 | ext.librariesVersion = '1.1.50' |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 20 | ext.eapChannel = 'https://dl.bintray.com/kotlin/kotlin-eap-1.1' |
| 21 | ext.serializationRepo = 'https://kotlin.bintray.com/kotlinx' |
Leonid Startsev | f665fbd | 2017-09-29 18:13:28 +0300 | [diff] [blame] | 22 | ext.serializationPluginVersion = '0.1.1' |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 23 | |
| 24 | repositories { |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 25 | jcenter() |
Leonid Startsev | 6fbc215 | 2017-09-21 16:18:32 +0300 | [diff] [blame] | 26 | mavenLocal() |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 27 | maven { url serializationRepo } |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | dependencies { |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 31 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$compilerVersion" |
Leonid Startsev | d79fb1f | 2017-09-15 18:02:59 +0300 | [diff] [blame] | 32 | classpath "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$serializationPluginVersion" |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 33 | |
Leonid Startsev | ed87fbd | 2017-08-04 17:33:09 +0300 | [diff] [blame] | 34 | classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.2' |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 35 | |
| 36 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 37 | } |
| 38 | } |
| 39 | |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 40 | ext { |
| 41 | libraries = [ |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 42 | 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 Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 49 | ] |
| 50 | } |
| 51 | |
| 52 | allprojects { |
| 53 | group 'org.jetbrains.kotlinx' |
Leonid Startsev | f665fbd | 2017-09-29 18:13:28 +0300 | [diff] [blame] | 54 | version '0.1.1' |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 55 | |
| 56 | repositories { |
| 57 | jcenter() |
| 58 | mavenLocal() |
| 59 | } |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 60 | } |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 61 | |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 62 | apply plugin: 'kotlin' |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 63 | |
Leonid Startsev | 1c35d91 | 2017-10-04 12:26:43 +0300 | [diff] [blame^] | 64 | subprojects { |
Leonid Startsev | d79fb1f | 2017-09-15 18:02:59 +0300 | [diff] [blame] | 65 | apply plugin: 'kotlinx-serialization' |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 66 | |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 67 | apply plugin: 'maven-publish' |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 68 | apply plugin: 'com.jfrog.bintray' |
Leonid Startsev | ed87fbd | 2017-08-04 17:33:09 +0300 | [diff] [blame] | 69 | |
Leonid Startsev | d79fb1f | 2017-09-15 18:02:59 +0300 | [diff] [blame] | 70 | def varintName = "" |
| 71 | |
| 72 | if (project.name == "jvm") { |
| 73 | varintName = "${rootProject.name}" |
| 74 | } else { |
| 75 | varintName = "${rootProject.name}-${project.name}" |
| 76 | } |
Leonid Startsev | a587393 | 2017-08-09 11:36:01 +0300 | [diff] [blame] | 77 | |
Leonid Startsev | ef12538 | 2017-09-22 16:50:39 +0300 | [diff] [blame] | 78 | 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 Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 87 | } |
Leonid Startsev | a587393 | 2017-08-09 11:36:01 +0300 | [diff] [blame] | 88 | |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 89 | tasks.withType(Jar) { |
| 90 | archivesBaseName = varintName |
| 91 | } |
Leonid Startsev | a587393 | 2017-08-09 11:36:01 +0300 | [diff] [blame] | 92 | |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 93 | publishing { |
| 94 | publications { |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 95 | mavenProject(MavenPublication) { |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 96 | from components.java |
| 97 | groupId project.group |
| 98 | artifactId varintName |
| 99 | version project.version |
| 100 | |
| 101 | artifact sourceJar { |
| 102 | classifier "sources" |
| 103 | } |
Leonid Startsev | a587393 | 2017-08-09 11:36:01 +0300 | [diff] [blame] | 104 | } |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 105 | } |
| 106 | } |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 107 | |
| 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 Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 127 | } |