-
-
Notifications
You must be signed in to change notification settings - Fork 954
/
Copy pathbuild.gradle
73 lines (64 loc) · 2.49 KB
/
build.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
ext {
grailsVersion = projectVersion
isCiBuild = System.getenv().get('CI') as Boolean
// Directories created during the build which are related
// to turning the workspace root into a GRAILS_HOME
distInstallDir = layout.buildDirectory.dir('dist-tmp')
homeDistDir = layout.projectDirectory.dir('dist')
homeBinDir = layout.projectDirectory.dir('bin')
homeConfDir = layout.projectDirectory.dir('conf')
homeLibDir = layout.projectDirectory.dir('lib')
testProjectsStartWith = [
'grails-test-suite',
'grails-test-examples'
]
testProjects = [ /* Will be populated by subprojects loop below */ ]
}
allprojects {
repositories {
mavenCentral()
maven { url = 'https://repo.grails.org/grails/core' }
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://repository.apache.org/content/repositories/snapshots' }
// mavenLocal() // Keep, this will be uncommented and used by CI (groovy-joint-workflow)
}
}
subprojects {
for (String testPrefix : testProjectsStartWith) {
if (name.startsWith(testPrefix)) {
rootProject.ext['testProjects'] << name
}
}
configurations.configureEach {
resolutionStrategy {
def cacheHours = isCiBuild ? 0 : 24
cacheDynamicVersionsFor(cacheHours, 'hours')
cacheChangingModulesFor(cacheHours, 'hours')
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.apache.groovy') {
details.useVersion(groovyVersion)
}
}
}
}
// This is added to prevent a remote cache misses, because the project JAR include a manifest
// file with Built-By and Created-By properties which might be different for CI vs Local.
normalization {
runtimeClasspath {
metaInf {
ignoreAttribute('Built-By')
ignoreAttribute('Created-By')
}
}
}
apply from: rootProject.layout.projectDirectory.file('gradle/dependency-licenses.gradle')
}
tasks.register('clean', Delete) {
group = 'build'
delete(layout.buildDirectory, homeBinDir, homeConfDir, homeDistDir, homeLibDir)
}
apply {
from layout.projectDirectory.file('gradle/docs-root-config.gradle')
from layout.projectDirectory.file('gradle/assemble-root-config.gradle')
from layout.projectDirectory.file('gradle/publish-root-config.gradle')
}