1 /* <lambda>null2 * Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. 3 */ 4 5 pluginManagement { 6 repositories { 7 /** 8 * Overrides for Teamcity 'K2 User Projects' + 'Aggregate build / Kotlinx libraries compilation' configuration: 9 * kotlin_repo_url - local repository with snapshot Kotlin compiler 10 * kotlin_version - kotlin version to use 11 * kotlin_language_version - LV to use 12 */ 13 val kotlinRepoUrl: String? = providers.gradleProperty("kotlin_repo_url").orNull 14 if (kotlinRepoUrl?.isNotEmpty() == true) { 15 maven(kotlinRepoUrl) 16 } 17 /* 18 * This property group is used to build kotlinx.serialization against Kotlin compiler snapshot. 19 * When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version. 20 * DO NOT change the name of these properties without adapting kotlinx.train build chain. 21 */ 22 val buildSnapshotTrain: String? = providers.gradleProperty("build_snapshot_train").orNull 23 if (buildSnapshotTrain.equals("true", true)) { 24 maven("https://oss.sonatype.org/content/repositories/snapshots") 25 } 26 27 // kotlin-dev with space redirector 28 maven("https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev") 29 30 maven("https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev") 31 // For Dokka that depends on kotlinx-html 32 maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") 33 34 gradlePluginPortal() 35 mavenCentral() 36 mavenLocal() 37 } 38 } 39 <lambda>null40plugins { 41 id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" 42 } 43 44 rootProject.name = "kotlinx-serialization" 45 46 include(":kotlinx-serialization-core") 47 project(":kotlinx-serialization-core").projectDir = file("./core") 48 49 include(":kotlinx-serialization-bom") 50 project(":kotlinx-serialization-bom").projectDir = file("./bom") 51 52 include(":kotlinx-serialization-json") 53 project(":kotlinx-serialization-json").projectDir = file("./formats/json") 54 55 include(":kotlinx-serialization-json-okio") 56 project(":kotlinx-serialization-json-okio").projectDir = file("./formats/json-okio") 57 58 include(":kotlinx-serialization-json-io") 59 project(":kotlinx-serialization-json-io").projectDir = file("./formats/json-io") 60 61 include(":kotlinx-serialization-json-tests") 62 project(":kotlinx-serialization-json-tests").projectDir = file("./formats/json-tests") 63 64 include(":kotlinx-serialization-protobuf") 65 project(":kotlinx-serialization-protobuf").projectDir = file("./formats/protobuf") 66 67 include(":kotlinx-serialization-cbor") 68 project(":kotlinx-serialization-cbor").projectDir = file("./formats/cbor") 69 70 include(":kotlinx-serialization-hocon") 71 project(":kotlinx-serialization-hocon").projectDir = file("./formats/hocon") 72 73 include(":kotlinx-serialization-properties") 74 project(":kotlinx-serialization-properties").projectDir = file("./formats/properties") 75 76 include(":benchmark") 77 project(":benchmark").projectDir = file("./benchmark") 78 79 include(":guide") 80 project(":guide").projectDir = file("./guide") 81 82 <lambda>null83dependencyResolutionManagement { 84 versionCatalogs { 85 create("libs") { 86 overriddenKotlinVersion()?.also { overriddenVersion -> 87 logger.info("Overriding Kotlin version: $overriddenVersion") 88 version("kotlin", overriddenVersion) 89 } 90 } 91 } 92 } 93 overriddenKotlinVersionnull94fun overriddenKotlinVersion(): String? { 95 val kotlinRepoUrl: String? = providers.gradleProperty("kotlin_repo_url").orNull 96 val repoVersion: String? = providers.gradleProperty("kotlin_version").orNull 97 98 val bootstrap: String? = providers.gradleProperty("bootstrap").orNull 99 val bootstrapVersion: String? = providers.gradleProperty("kotlin.version.snapshot").orNull 100 101 val buildSnapshotTrain: String? = providers.gradleProperty("build_snapshot_train").orNull 102 val trainVersion: String? = providers.gradleProperty("kotlin_snapshot_version").orNull 103 104 if (kotlinRepoUrl?.isNotEmpty() == true) { 105 return repoVersion ?: throw IllegalArgumentException("\"kotlin_version\" Gradle property should be defined") 106 } else if (bootstrap != null) { 107 return bootstrapVersion ?: throw IllegalArgumentException("\"kotlin.version.snapshot\" Gradle property should be defined") 108 } 109 if (buildSnapshotTrain?.isNotEmpty() == true) { 110 return trainVersion ?: throw IllegalArgumentException("\"kotlin_snapshot_version\" should be defined when building with snapshot compiler") 111 } 112 return null 113 } 114