Roman Elizarov | 26af919 | 2017-09-21 18:12:04 +0300 | [diff] [blame] | 1 | /* |
Leonid Startsev | 8642a1f | 2018-04-03 17:38:39 +0300 | [diff] [blame] | 2 | * Copyright 2018 JetBrains s.r.o. |
Roman Elizarov | 26af919 | 2017-09-21 18:12:04 +0300 | [diff] [blame] | 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 | ca62091 | 2017-11-09 19:55:51 +0300 | [diff] [blame] | 18 | if (project.hasProperty("bootstrap")) { |
Leonid Startsev | 14b57df | 2018-06-13 23:18:22 +0300 | [diff] [blame^] | 19 | ext.compilerVersion = property('kotlin.version.snapshot') |
| 20 | ext.librariesVersion = property('kotlin.version.snapshot') |
| 21 | ext.serializationPluginVersion = property('plugin.version') + '-SNAPSHOT' |
Leonid Startsev | ca62091 | 2017-11-09 19:55:51 +0300 | [diff] [blame] | 22 | } else { |
Leonid Startsev | 8642a1f | 2018-04-03 17:38:39 +0300 | [diff] [blame] | 23 | ext.compilerVersion = property('kotlin.version') |
| 24 | ext.librariesVersion = property('kotlin.version') |
Leonid Startsev | 14b57df | 2018-06-13 23:18:22 +0300 | [diff] [blame^] | 25 | ext.serializationPluginVersion = property('plugin.version') |
Leonid Startsev | ca62091 | 2017-11-09 19:55:51 +0300 | [diff] [blame] | 26 | } |
Leonid Startsev | 9f9df89 | 2017-12-22 18:24:52 +0300 | [diff] [blame] | 27 | ext.eapChannel = 'https://dl.bintray.com/kotlin/kotlin-eap' |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 28 | ext.serializationRepo = 'https://kotlin.bintray.com/kotlinx' |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 29 | |
| 30 | repositories { |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 31 | jcenter() |
Leonid Startsev | 6fbc215 | 2017-09-21 16:18:32 +0300 | [diff] [blame] | 32 | mavenLocal() |
Leonid Startsev | 7dd8ad7 | 2017-11-22 19:24:02 +0300 | [diff] [blame] | 33 | maven { url eapChannel } |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 34 | maven { url serializationRepo } |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | dependencies { |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 38 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$compilerVersion" |
Leonid Startsev | d79fb1f | 2017-09-15 18:02:59 +0300 | [diff] [blame] | 39 | classpath "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$serializationPluginVersion" |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 40 | |
Leonid Startsev | ed87fbd | 2017-08-04 17:33:09 +0300 | [diff] [blame] | 41 | classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.2' |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 42 | |
| 43 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 44 | } |
| 45 | } |
| 46 | |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 47 | ext { |
| 48 | libraries = [ |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 49 | 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 Startsev | 8642a1f | 2018-04-03 17:38:39 +0300 | [diff] [blame] | 53 | kotlin_test_junit: "org.jetbrains.kotlin:kotlin-test-junit:$librariesVersion", |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 54 | kotlin_test_common: "org.jetbrains.kotlin:kotlin-test-common:$librariesVersion", |
Leonid Startsev | 7dd8ad7 | 2017-11-22 19:24:02 +0300 | [diff] [blame] | 55 | kotlin_test_annotations_common: "org.jetbrains.kotlin:kotlin-test-annotations-common:$librariesVersion", |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 56 | kotlin_test_js: "org.jetbrains.kotlin:kotlin-test-js:$librariesVersion", |
| 57 | kotlin_reflect: "org.jetbrains.kotlin:kotlin-reflect:$librariesVersion", |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 58 | ] |
| 59 | } |
| 60 | |
| 61 | allprojects { |
| 62 | group 'org.jetbrains.kotlinx' |
Leonid Startsev | 14b57df | 2018-06-13 23:18:22 +0300 | [diff] [blame^] | 63 | version '0.5.1' |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 64 | |
| 65 | repositories { |
| 66 | jcenter() |
Leonid Startsev | 7dd8ad7 | 2017-11-22 19:24:02 +0300 | [diff] [blame] | 67 | maven { url eapChannel } |
Leonid Startsev | 84062e1 | 2017-09-25 16:41:38 +0300 | [diff] [blame] | 68 | mavenLocal() |
| 69 | } |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 70 | } |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 71 | |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 72 | apply plugin: 'kotlin' |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 73 | |
Leonid Startsev | 1c35d91 | 2017-10-04 12:26:43 +0300 | [diff] [blame] | 74 | subprojects { |
Leonid Startsev | d79fb1f | 2017-09-15 18:02:59 +0300 | [diff] [blame] | 75 | apply plugin: 'kotlinx-serialization' |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 76 | |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 77 | apply plugin: 'maven-publish' |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 78 | apply plugin: 'com.jfrog.bintray' |
Leonid Startsev | ed87fbd | 2017-08-04 17:33:09 +0300 | [diff] [blame] | 79 | |
Leonid Startsev | d79fb1f | 2017-09-15 18:02:59 +0300 | [diff] [blame] | 80 | def varintName = "" |
| 81 | |
| 82 | if (project.name == "jvm") { |
| 83 | varintName = "${rootProject.name}" |
| 84 | } else { |
| 85 | varintName = "${rootProject.name}-${project.name}" |
| 86 | } |
Leonid Startsev | a587393 | 2017-08-09 11:36:01 +0300 | [diff] [blame] | 87 | |
Leonid Startsev | ef12538 | 2017-09-22 16:50:39 +0300 | [diff] [blame] | 88 | afterEvaluate { |
| 89 | task sourceJar(type: Jar, dependsOn: classes) { |
| 90 | classifier 'sources' |
| 91 | from sourceSets.main.kotlin |
Leonid Startsev | 8818540 | 2018-02-01 16:03:25 +0300 | [diff] [blame] | 92 | 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 Startsev | ef12538 | 2017-09-22 16:50:39 +0300 | [diff] [blame] | 98 | } |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 99 | } |
Leonid Startsev | a587393 | 2017-08-09 11:36:01 +0300 | [diff] [blame] | 100 | |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 101 | tasks.withType(Jar) { |
| 102 | archivesBaseName = varintName |
| 103 | } |
Leonid Startsev | a587393 | 2017-08-09 11:36:01 +0300 | [diff] [blame] | 104 | |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 105 | publishing { |
| 106 | publications { |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 107 | mavenProject(MavenPublication) { |
Leonid Startsev | 00dd4f5 | 2017-08-23 16:09:21 +0300 | [diff] [blame] | 108 | from components.java |
| 109 | groupId project.group |
| 110 | artifactId varintName |
| 111 | version project.version |
| 112 | |
| 113 | artifact sourceJar { |
| 114 | classifier "sources" |
| 115 | } |
Leonid Startsev | a587393 | 2017-08-09 11:36:01 +0300 | [diff] [blame] | 116 | } |
Leonid Startsev | 08d3ca0 | 2017-07-26 15:16:23 +0300 | [diff] [blame] | 117 | } |
| 118 | } |
Leonid Startsev | 1e737f2 | 2017-09-14 13:19:32 +0300 | [diff] [blame] | 119 | |
| 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 Startsev | da728dd | 2018-03-07 12:41:47 +0300 | [diff] [blame] | 139 | } |