-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.gradle
More file actions
157 lines (134 loc) · 4.11 KB
/
build.gradle
File metadata and controls
157 lines (134 loc) · 4.11 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.locks.ReentrantLock
apply from: "gradle/dependencies.gradle"
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.0"
}
}
allprojects {
apply plugin: 'com.jfrog.artifactory-upload'
artifactoryPublish {
skip true
}
group = "com.capgemini.spring"
version = '0.9.1-SNAPSHOT'
apply plugin: 'eclipse'
apply plugin: 'idea'
repositories {
jcenter()
}
}
ext {
isSnapshot = version.endsWith("SNAPSHOT")
publishedModules = [
"spring-capgemini-core", "spring-capgemini-trace"
].collect { project(it) }
localRepoUrl = "${buildDir.toURI()}/localrepo"
}
subprojects {
apply plugin: "base"
apply plugin: 'java'
tasks.withType(Upload).matching { it.name != "install" }.all {
rootProject.subprojects {
mustRunAfter tasks.matching { it instanceof VerificationTask }
}
}
tasks.withType(Test) {
allprojects {
mustRunAfter tasks.withType(Checkstyle)
}
}
tasks.withType(GroovyCompile) {
allprojects {
mustRunAfter tasks.withType(CodeNarc)
}
}
apply plugin: 'maven'
apply from: "${rootDir}/gradle/pom.gradle"
}
// Have to evaluate the children before setting up the publishing stuff so the dependencies are defined.
evaluationDependsOnChildren()
subprojects {
if (project in publishedModules) {
apply plugin: "com.jfrog.artifactory-upload"
artifactoryPublish { task ->
skip false
rootProject.artifactory {
contextUrl = 'http://oss.jfrog.org'
publish {
repository {
repoKey = isSnapshot ? 'oss-snapshot-local' : 'oss-release-local'
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(task)) {
username = bintrayUser
password = bintrayApiKey
}
}
}
}
}
}
assert description: "Project $project.path is published, must have a description"
modifyPom {
project {
name project.name
description project.description
url "https://github.com/Capgemini/spring-boot-capgemini"
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
scm {
connection "scm:https://[email protected]/capgemini/spring-boot-capgemini"
developerConnection "scm:[email protected]:capgemini/spring-boot-capgemini.git"
url "https://github.com/capgemini/spring-boot-capgemini"
}
developers {
developer {
id "capgemini"
name "Team Capgemini"
}
}
}
}
} else {
}
tasks.withType(Test) {
testLogging {
exceptionFormat "full"
events "failed"
}
jvmArgs "-Xss320k"
minHeapSize "312m"
maxHeapSize "312m"
}
}
// Maven POM generation is not thread safe, so serialize all the Upload tasks we can use `--parallel`.
def lock = new ReentrantLock()
def available = lock.newCondition()
def busy = new AtomicBoolean()
allprojects {
tasks.withType(Upload) { uploadTask ->
doFirst {
lock.lock()
while (busy.get()) {
available.await()
}
busy.set(true)
}
}
}
gradle.taskGraph.afterTask {
if (it instanceof Upload && lock.heldByCurrentThread) {
busy.set(false)
available.signal()
lock.unlock()
}
}