forked from Vampire/setup-wsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle.kts
123 lines (111 loc) · 3.87 KB
/
settings.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
* Copyright 2020-2023 Björn Kautler
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import de.fayard.refreshVersions.core.FeatureFlag.GRADLE_UPDATES
import net.kautler.conditionalRefreshVersions
import org.gradle.api.initialization.resolve.RepositoriesMode.PREFER_SETTINGS
pluginManagement {
require(JavaVersion.current().isJava11Compatible) {
"This build requires Gradle to be run with at least Java 11"
}
includeBuild("gradle/build-logic")
includeBuild("gradle/conditional-refresh-versions")
repositories {
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id("net.kautler.conditional-refresh-versions")
id("com.gradle.enterprise") version "3.12.6"
}
conditionalRefreshVersions {
featureFlags {
disable(GRADLE_UPDATES)
}
rejectVersionIf {
candidate.stabilityLevel.isLessStableThan(current.stabilityLevel)
}
// work-around for https://github.com/jmfayard/refreshVersions/issues/662
file("build/tmp/refreshVersions").mkdirs()
// work-around for https://github.com/jmfayard/refreshVersions/issues/640
versionsPropertiesFile = file("build/tmp/refreshVersions/versions.properties")
}
gradle.rootProject {
tasks.configureEach {
if (name == "refreshVersions") {
doLast {
// work-around for https://github.com/jmfayard/refreshVersions/issues/661
// and https://github.com/jmfayard/refreshVersions/issues/663
file("gradle/libs.versions.toml").apply {
readText()
.replace("⬆ =", " ⬆ =")
.replace("]\n\n", "]\n")
.replace("""(?s)^(.*)(\n\Q[plugins]\E[^\[]*)(\n.*)$""".toRegex(), "$1$3$2")
.also { writeText(it) }
}
}
}
}
}
dependencyResolutionManagement {
repositories {
ivy("https://nodejs.org/dist/") {
name = "Node.js Distributions"
patternLayout {
artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
}
metadataSources {
artifact()
}
content {
includeModule("org.nodejs", "node")
}
}
ivy("https://github.com/yarnpkg/yarn/releases/download/") {
name = "Yarn Distributions"
patternLayout {
artifact("v[revision]/[artifact](-v[revision]).[ext]")
}
metadataSources {
artifact()
}
content {
includeModule("com.yarnpkg", "yarn")
}
}
mavenCentral()
}
// work-around for https://youtrack.jetbrains.com/issue/KT-56300
//repositoriesMode.set(FAIL_ON_PROJECT_REPOS)
repositoriesMode.set(PREFER_SETTINGS)
versionCatalogs {
val kotlinWrappers by registering {
from("org.jetbrains.kotlin-wrappers:kotlin-wrappers-catalog:0.0.1-pre.819")
}
}
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}
includeBuild("gradle/build-logic")
include("ncc-packer")
project(":ncc-packer").buildFileName = "ncc-packer.gradle.kts"
rootProject.name = "setup-wsl"
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")