forked from diffplug/spotless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle
127 lines (114 loc) · 4.02 KB
/
settings.gradle
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
124
125
126
127
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id 'com.diffplug.spotless' version '6.18.0' apply false
// https://plugins.gradle.org/plugin/com.gradle.plugin-publish
id 'com.gradle.plugin-publish' version '1.2.0' apply false
// https://github.com/gradle-nexus/publish-plugin/releases
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' apply false
// https://github.com/spotbugs/spotbugs-gradle-plugin/releases
id 'com.github.spotbugs' version '5.0.14' apply false
// https://github.com/diffplug/spotless-changelog/blob/main/CHANGELOG.md
id 'com.diffplug.spotless-changelog' version '3.0.2' apply false
// https://github.com/diffplug/goomph/blob/main/CHANGES.md
// DO NOT UPDATE, see https://github.com/diffplug/spotless/pull/874
id 'com.diffplug.p2.asmaven' version '3.27.0' apply false
// https://github.com/radarsh/gradle-test-logger-plugin/blob/develop/CHANGELOG.md
id 'com.adarshr.test-logger' version '3.2.0' apply false
// https://github.com/davidburstrom/version-compatibility-gradle-plugin/tags
id 'io.github.davidburstrom.version-compatibility' version '0.5.0' apply false
// https://plugins.gradle.org/plugin/com.gradle.enterprise
id 'com.gradle.enterprise' version '3.13.3'
// https://github.com/equodev/equo-ide/blob/main/plugin-gradle/CHANGELOG.md
id 'dev.equo.ide' version '1.0.1' apply false
}
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}
if (System.env['CI'] != null) {
// use the remote buildcache on all CI builds
buildCache {
def cred = {
if (System.env[it] != null) {
return System.env[it]
} else {
return System.getProperty(it)
}
}
remote(HttpBuildCache) {
url = 'https://buildcache.diffplug.com/cache/'
// but we only push if it's a trusted build (not PRs)
String user = cred('buildcacheuser')
String pass = cred('buildcachepass')
if (user != null && pass != null) {
push = true
credentials {
username = user
password = pass
}
} else {
credentials { username = 'anonymous' }
}
}
}
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
publishAlways()
}
}
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
rootProject.name = 'spotless'
include 'lib' // reusable library with no dependencies
include 'testlib' // library for sharing test infrastructure between the projects below
include 'lib-extra' // reusable library with lots of dependencies
include 'plugin-gradle' // gradle-specific glue code
def getStartProperty(java.lang.String name) {
def value = startParameter.getProjectProperties().get(name)
if(null != value) {
return value
}
// user properties are not available in the startParameter
def userPropertiesFile = new java.io.File(startParameter.getGradleUserHomeDir(), 'gradle.properties')
def userProperties = new java.util.Properties()
if (userPropertiesFile.exists()) {
userProperties.load(userPropertiesFile.newReader())
}
return userProperties.get(name)
}
if (System.getenv('SPOTLESS_EXCLUDE_MAVEN') != 'true' && getStartProperty('SPOTLESS_EXCLUDE_MAVEN') != 'true') {
include 'plugin-maven' // maven-specific glue code
}
// include external (_ext) projects from development builds
if (getStartProperty('com.diffplug.spotless.include.ext') == 'true') {
file('_ext').eachDirMatch(~/^(?!(\.|gradle)).*/) { dir ->
include dir.name
project(":${dir.name}").projectDir = dir
}
}
// include external (_ext) projects from development builds, but disable the p2 parts
if (getStartProperty('com.diffplug.spotless.include.ext.nop2') == 'true') {
file('_ext').eachDirMatch(~/^(?!(\.|gradle)).*/) { dir ->
include dir.name
project(":${dir.name}").projectDir = dir
}
}
// the p2-based projects are too expensive for routine CI builds, so they have to be invoked explicitly
for (kind in [
'cdt',
'groovy',
'wtp'
]) {
if (getStartProperty("com.diffplug.spotless.include.ext.${kind}") == 'true') {
include "eclipse-${kind}"
project(":eclipse-${kind}").projectDir = file("_ext/eclipse-${kind}")
}
}