-
Notifications
You must be signed in to change notification settings - Fork 459
/
Copy pathsettings.gradle
82 lines (73 loc) · 2.36 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
pluginManagement {
plugins {
id 'com.diffplug.spotless' version '5.0.0'
}
}
plugins {
id 'com.diffplug.spotless' apply false
}
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' }
}
}
}
}
include 'ide' // easy dev setup
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
if (org.gradle.api.JavaVersion.current() == org.gradle.api.JavaVersion.VERSION_1_8) {
// only build Java 8
if (System.getenv('SPOTLESS_EXCLUDE_MAVEN') != 'true' && System.getenv('JITPACK') != 'true') {
include 'plugin-maven' // maven-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)
}
// 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 only the ones that don't need p2
if (getStartProperty('com.diffplug.spotless.include.ext.nop2') == 'true') {
include 'eclipse-base'
project(':eclipse-base').projectDir = file('_ext/eclipse-base')
include 'eclipse-jdt'
project(':eclipse-jdt').projectDir = file('_ext/eclipse-jdt')
}