forked from openrewrite/rewrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle.kts
120 lines (105 loc) · 3.58 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
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
}
// ---------------------------------------------------------------
// ------ Included Projects --------------------------------------
// ---------------------------------------------------------------
val allProjects = listOf(
"rewrite-benchmarks",
"rewrite-bom",
"rewrite-core",
"rewrite-gradle",
"rewrite-groovy",
"rewrite-hcl",
"rewrite-java",
"rewrite-java-tck",
"rewrite-java-test",
"rewrite-java-17", // remove this when rewrite recipe gradle plugin moves to 21
"rewrite-java-21",
"rewrite-json",
"rewrite-maven",
"rewrite-properties",
"rewrite-protobuf",
"rewrite-test",
"rewrite-xml",
"rewrite-yaml",
)
val includedProjects = file("IDE.properties").let {
if (it.exists()) {
val props = java.util.Properties()
it.reader().use { reader ->
props.load(reader)
}
allProjects.intersect(props.keys)
} else {
allProjects
}
}.toSet()
if(!file("IDE.properties").exists() || includedProjects.contains("tools")) {
includeBuild("tools")
}
include(*allProjects.toTypedArray())
allProjects.minus(includedProjects).forEach {
// sinkhole this project to a directory that intentionally doesn't exist, so that it
// can be efficiently substituted for a module dependency below
project(":$it").projectDir = file("sinkhole-$it")
}
gradle.allprojects {
configurations.all {
resolutionStrategy.dependencySubstitution {
allProjects
.minus(includedProjects)
.minus(arrayOf("rewrite-benchmarks", "rewrite-bom"))
.forEach {
substitute(project(":$it"))
.using(module("org.openrewrite:$it:latest.integration"))
}
}
}
}
if (System.getProperty("idea.active") == null &&
System.getProperty("idea.sync.active") == null) {
include(
"rewrite-java-8",
"rewrite-java-11",
"rewrite-java-17",
"rewrite-java-21"
)
}
// ---------------------------------------------------------------
// ------ Gradle Enterprise Configuration ------------------------
// ---------------------------------------------------------------
plugins {
id("com.gradle.enterprise") version "3.13.3"
id("com.gradle.common-custom-user-data-gradle-plugin") version "latest.release"
}
gradleEnterprise {
val isCiServer = System.getenv("CI")?.equals("true") ?: false
server = "https://ge.openrewrite.org/"
val gradleCacheRemoteUsername: String? = System.getenv("GRADLE_ENTERPRISE_CACHE_USERNAME")
val gradleCacheRemotePassword: String? = System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")
buildCache {
remote(HttpBuildCache::class) {
url = uri("https://ge.openrewrite.org/cache/")
isPush = isCiServer
if (!gradleCacheRemoteUsername.isNullOrBlank() && !gradleCacheRemotePassword.isNullOrBlank()) {
credentials {
username = gradleCacheRemoteUsername
password = gradleCacheRemotePassword
}
}
}
}
buildScan {
capture {
isTaskInputFiles = true
}
isUploadInBackground = !isCiServer
publishAlways()
this as com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures
publishIfAuthenticated()
}
}