forked from openrewrite/rewrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle.kts
113 lines (98 loc) · 3.29 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
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() && (System.getProperty("idea.active") != null || System.getProperty("idea.sync.active") != null)) {
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 "latest.release"
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/"
buildCache {
remote(gradleEnterprise.buildCache) {
isEnabled = true
val accessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY")
isPush = isCiServer && !accessKey.isNullOrBlank()
}
}
buildScan {
capture {
isTaskInputFiles = true
}
isUploadInBackground = !isCiServer
publishAlways()
this as com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures
publishIfAuthenticated()
}
}