forked from openrewrite/rewrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle.kts
108 lines (96 loc) · 2.97 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
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())
gradle.allprojects {
configurations.all {
resolutionStrategy.dependencySubstitution {
allProjects
.minus(includedProjects)
.minus(arrayOf("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 Develocity Configuration ------------------------
// ---------------------------------------------------------------
plugins {
id("com.gradle.develocity") version "latest.release"
id("com.gradle.common-custom-user-data-gradle-plugin") version "latest.release"
}
develocity {
val isCiServer = System.getenv("CI")?.equals("true") ?: false
server = "https://ge.openrewrite.org/"
val accessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY")
val authenticated = !accessKey.isNullOrBlank()
buildCache {
remote(develocity.buildCache) {
isEnabled = true
isPush = isCiServer && authenticated
}
}
buildScan {
capture {
fileFingerprints = true
}
publishing {
onlyIf {
authenticated
}
}
uploadInBackground = !isCiServer
}
}