Skip to content

Commit 6df0263

Browse files
turanskyqwwdfsad
authored andcommitted
Plugin repo management in 'pluginManagement' block
1 parent 95c2704 commit 6df0263

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

buildSrc/build.gradle.kts

+1-17
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,6 @@
44

55
import java.util.*
66

7-
buildscript {
8-
val cacheRedirectorEnabled = System.getenv("CACHE_REDIRECTOR")?.toBoolean() == true
9-
10-
if (cacheRedirectorEnabled) {
11-
println("Redirecting repositories for buildSrc buildscript")
12-
}
13-
14-
repositories {
15-
if (cacheRedirectorEnabled) {
16-
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
17-
} else {
18-
maven("https://plugins.gradle.org/m2")
19-
}
20-
}
21-
}
22-
237
plugins {
248
`kotlin-dsl`
259
}
@@ -42,7 +26,7 @@ kotlinDslPluginOptions {
4226
experimentalWarning.set(false)
4327
}
4428

45-
private val props = Properties().apply {
29+
val props = Properties().apply {
4630
file("../gradle.properties").inputStream().use { load(it) }
4731
}
4832

buildSrc/settings.gradle.kts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2016-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+
val cacheRedirectorEnabled = System.getenv("CACHE_REDIRECTOR")?.toBoolean() == true
8+
9+
if (cacheRedirectorEnabled) {
10+
println("Redirecting repositories for buildSrc buildscript")
11+
12+
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
13+
} else {
14+
maven("https://plugins.gradle.org/m2")
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)