-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
232 lines (198 loc) · 7.65 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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
/*******************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2013-2016 by Peter Pilgrim, Milton Keynes, England
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU GPL v3.0
* which accompanies this distribution, and is available at:
* http://www.gnu.org/licenses/gpl-3.0.txt
*
* Developers:
* Peter Pilgrim -- design, development and implementation
* -- Blog: http://www.xenonique.co.uk/blog/
* -- Twitter: @peter_pilgrim
*
* Contributors:
*
*******************************************************************************/
// Packt Publishing and Peter A. Pilgrim present the
// ================================================================================
// J A V A E E 7 D E V E L O P E R H A N D B O O K
// ================================================================================
//
// This is a reworked Gradle build
//
apply plugin: 'java'
// The name of this project
project.archivesBaseName = 'javaee7-developer-handbook'
// ==========================================================================================
// Define Utility Functions to read the version number and increment it
// ==========================================================================================
String getProjectPropertiesFilename() {
return "gradle.properties"
}
// --------------------------------------------------------------------------------
// Settings for all Java EE 7 projects
// --------------------------------------------------------------------------------
allprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
// Define equivalent Maven GAV coordinates.
group = 'uk.co.xenonique.javaee7handbook'
version = '1.0-SNAPSHOT'
ext {
arquillianVersion = "1.1.11.Final"
arquillianJunitVersion = "1.1.11.Final"
arquillianPersistenceVersion = "1.0.0.Alpha6"
arquillianGlassfishEmbeddedVersion = "1.0.0.Final-SNAPSHOT"
arquillianGlassfishManagedVersion = "1.0.0.CR4"
arquillianGlassfishRemoteVersion = "1.0.0.CR4"
deltaspikeVersion = "1.5.3"
glassfishVersion = "4.1"
hamcrestVersion = "1.3"
javaeeVersion = "7.0"
jodaTimeVersion = "2.2"
junitVersion = "4.12"
openWebBeansVersion = "1.6.2"
ozarkVersion = "1.0.0-m01"
mockitoVersion = "1.10.19"
shrinkWrapVersion = "1.0.1"
slf4jVersion = "1.7.14"
weldEEEmbeddedVersion = "1.0.0.CR3"
weldSEVersion = "2.3.3.Final"
}
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://maven.java.net/content/groups/promoted'
}
maven {
url 'http://repository.jboss.org/nexus/content/groups/public'
}
}
// Java version compatibility to use when compiling Java source
sourceCompatibility = '1.8'
// Java version to generate classes
targetCompatibility = '1.8'
task wrapper(type: Wrapper) {
gradleVersion = '2.11'
}
idea {
module {
//if you love browsing Javadoc
downloadJavadoc = false
//and hate reading sources :)
downloadSources = true
}
}
task gradleInfo(description: "reports the Gradle version and information") << {
println "=" * 80
println "======================= GRADLE INFORMATION =========================="
println " gradle = ${gradle}"
println " gradle.gradleHomeDir = ${gradle.gradleHomeDir}"
println " gradle.gradleUserHomeDir = ${gradle.gradleUserHomeDir}"
println " gradle.gradleVersion = ${gradle.gradleVersion}"
println " gradle.rootProject = ${gradle.rootProject}"
println " gradle.rootProject = ${gradle.rootProject}"
println " project.path = ${project.path}"
println " project.projectDir = ${project.projectDir}"
println " project.rootdir = ${project.rootDir}"
println " buildChapter9JmsAsync = ${buildChapter9JmsAsync}"
println " buildChapter11JpaAll = ${buildChapter11JpaAll}"
println "=" * 80
println ""
}
}
// --------------------------------------------------------------------------------
// Configure settings for Digital Java EE 7 sub projects
// --------------------------------------------------------------------------------
subprojects {
dependencies {
testCompile "org.hamcrest:hamcrest-all:${hamcrestVersion}"
testCompile "junit:junit:${junitVersion}"
testCompile "org.mockito:mockito-core:${mockitoVersion}"
}
// Override Gradle defaults - a force an exploded JAR view
sourceSets {
main {
output.resourcesDir = 'build/classes/main'
output.classesDir = 'build/classes/main'
}
test {
resources {
srcDir 'src/test/resources'
}
resources {
srcDir 'src/test/resources-glassfish-embedded'
}
// resources {
// srcDir 'src/test/resources-jbossas-embedded'
// }
output.resourcesDir = 'build/classes/test'
output.classesDir = 'build/classes/test'
}
}
}
// --------------------------------------------------------------------------------
// Project Lib Dependencies for this Java EE 7 Gradle Build
// --------------------------------------------------------------------------------
// SEE ALSO: https://docs.gradle.org/current/userguide/multi_project_builds.html
project(':ch01:xentracker-angularjs') {
dependencies {
compile project(':appendix01:glassfish-embedded')
}
}
project(':ch01:xentracker-basic') {
dependencies {
compile project(':appendix01:glassfish-embedded')
}
}
project(':ch08:jaxrs-basic') {
dependencies {
compile project(':appendix01:glassfish-embedded')
}
}
// --------------------------------------------------------------------------------
// Specific tasks and configuration for the current gradle module
// --------------------------------------------------------------------------------
// Specific task to build the ZIP
task myZip(type: Zip) {
description = "Creates a ZIP distribution of the `${archivesBaseName}' project."
from '.'
def datestamp = new Date().format("yyyyMMdd")
def targetName = "EN7942-${archivesBaseName}-sources-${version}-${datestamp}.zip"
println "**** Creating achive targetName=${targetName} ****"
archiveName "${targetName}"
include '**/src/**'
include '**/*.xml'
include '**/*.gradle'
include '**/*.txt'
include '**/*.md'
include '**/.gitignore'
exclude '**/.gradle'
exclude '**/.gradle/**'
exclude '**/.idea'
exclude '**/.idea/**'
exclude '**/.eclipse'
exclude '**/.classpath'
exclude '**/build'
exclude '**/build/**'
exclude '**/target'
exclude '**/target/**'
exclude '**/classes'
exclude '**/classes/**'
exclude '**/out'
exclude '**/out/**'
into "EN7942-${archivesBaseName}"
/*
exclude {
details ->
details.file.name.equals('.gradle')
}
*/
}
// End.