File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,12 +3,6 @@ import org.jetbrains.kotlin.gradle.dsl.*
33import org.gradle.kotlin.dsl.*
44
55buildscript {
6- if (shouldUseLocalMaven(rootProject)) {
7- repositories {
8- mavenLocal()
9- }
10- }
11-
126 repositories {
137 mavenCentral()
148 maven(url = " https://plugins.gradle.org/m2/" )
Original file line number Diff line number Diff line change @@ -7,16 +7,25 @@ plugins {
77val cacheRedirectorEnabled = System .getenv(" CACHE_REDIRECTOR" )?.toBoolean() == true
88val buildSnapshotTrain = properties[" build_snapshot_train" ]?.toString()?.toBoolean() == true
99val kotlinDevUrl = project.providers.gradleProperty(" kotlin_repo_url" ).orNull
10+ val kotlinVersion = project.providers.gradleProperty(" kotlin_version" ).orNull
1011
1112repositories {
12- mavenCentral()
1313 if (cacheRedirectorEnabled) {
1414 maven(" https://cache-redirector.jetbrains.com/plugins.gradle.org/m2" )
15+ maven(" https://cache-redirector.jetbrains.com/maven-central" )
1516 } else {
1617 maven(" https://plugins.gradle.org/m2" )
18+ mavenCentral()
1719 }
18- if (! kotlinDevUrl.isNullOrEmpty()) {
19- maven(kotlinDevUrl)
20+ if (! kotlinDevUrl.isNullOrEmpty() && ! kotlinVersion.isNullOrEmpty()) {
21+ exclusiveContent {
22+ forRepository {
23+ maven(kotlinDevUrl)
24+ }
25+ filter {
26+ includeVersionByRegex(" org.jetbrains.kotlin" , " .*" , kotlinVersion)
27+ }
28+ }
2029 }
2130 if (buildSnapshotTrain) {
2231 mavenLocal()
@@ -35,7 +44,7 @@ fun version(target: String): String {
3544 }
3645 val version = " ${target} _version"
3746 // Read from CLI first, used in aggregate builds
38- return properties[version]?.let { " $it " } ? : gradleProperties.getProperty(version)
47+ return properties[version]?.let { " $it " } ? : gradleProperties.getProperty(version)
3948}
4049
4150kotlin {
Original file line number Diff line number Diff line change @@ -78,7 +78,24 @@ fun getKotlinDevRepositoryUrl(project: Project): String? {
7878 */
7979fun addDevRepositoryIfEnabled (rh : RepositoryHandler , project : Project ) {
8080 val devRepoUrl = getKotlinDevRepositoryUrl(project) ? : return
81- rh.maven(devRepoUrl)
81+ val version = getKotlinDevVersion(project) ? : return
82+ rh.exclusiveContent {
83+ forRepository {
84+ rh.maven(devRepoUrl)
85+ }
86+ filter {
87+ includeVersionByRegex(" org.jetbrains.kotlin" , " .*" , version)
88+ }
89+ }
90+ }
91+
92+ fun getKotlinDevVersion (project : Project ): String? {
93+ val version = project.providers.gradleProperty(" kotlin_version" ).orNull
94+ if (version != null ) {
95+ LOGGER .info(""" Configured Kotlin Compiler version: '$version ' for project ${project.name} """ )
96+ return version
97+ }
98+ return null
8299}
83100
84101/* *
Original file line number Diff line number Diff line change @@ -7,7 +7,18 @@ pluginManagement {
77
88 repositories {
99 maven(url = " https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev/" )
10- gradlePluginPortal()
10+ val cacheRedirectorEnabled = System .getenv(" CACHE_REDIRECTOR" )?.toBoolean() == true
11+ if (cacheRedirectorEnabled) {
12+ maven(" https://cache-redirector.jetbrains.com/plugins.gradle.org/m2" )
13+ } else {
14+ gradlePluginPortal()
15+ }
16+ val prop = System .getProperty(" build_snapshot_train" )
17+ var build_snapshot_train: String by extra
18+ build_snapshot_train = if (prop != null && prop != " " ) " true" else " false"
19+ if (build_snapshot_train.toBoolean()) {
20+ mavenLocal()
21+ }
1122 }
1223}
1324
@@ -19,9 +30,6 @@ fun module(path: String) {
1930 include(name)
2031 project(" :$name " ).projectDir = file(path)
2132}
22- val prop = System .getProperty(" build_snapshot_train" )
23- var build_snapshot_train: String by extra
24- build_snapshot_train = if (prop != null && prop != " " ) " true" else " false"
2533// ---------------------------
2634
2735include(" benchmarks" )
You can’t perform that action at this time.
0 commit comments