This repository has been archived by the owner on Feb 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
190 lines (161 loc) · 6.28 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
/*
* Copyright 2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* The Apache Incubator S4 Project Build File
*
*/
description = 'Apache S4'
defaultTasks 'assemble'
project.ext["archivesBaseName"] = 's4'
project.ext["distRootFolder"] = "$archivesBaseName-${-> version}"
allprojects {
// Append the suffix 'SNAPSHOT' when the build is not for release.
version = new Version(major: 0, minor: 5, bugfix: 0, isRelease: false)
group = 'org.apache.s4'
/* Search these repos to find artifacts. Gradle will download and cache. */
repositories {
mavenLocal()
mavenCentral()
mavenRepo name: "gson", url: "http://google-gson.googlecode.com/svn/mavenrepo"
/* Add lib dir as a repo. Some jar files that are not available
in a public repo are distributed in the lib dir. */
flatDir name: 'libDir', dirs: "$rootDir/lib"
}
}
/* All project libraries must be defined here. */
project.ext["libraries"] = [
json: 'org.json:json:20090211',
guava: 'com.google.guava:guava:10.0.1',
gson: 'com.google.code.gson:gson:1.6',
guice: 'com.google.inject:guice:3.0',
guice_assist: 'com.google.inject.extensions:guice-assistedinject:3.0',
guice_grapher: 'com.google.inject:guice-grapher:3.0',
flexjson: 'net.sf.flexjson:flexjson:2.1',
bcel: 'org.apache.bcel:bcel:5.2',
jakarta_regexp: 'jakarta-regexp:jakarta-regexp:1.4',
kryo: 'com.googlecode:kryo:1.04',
netty: 'org.jboss.netty:netty:3.2.5.Final',
reflectasm: 'com.esotericsoftware:reflectasm:0.8',
minlog: 'com.esotericsoftware:minlog:1.2',
mockito_core: 'org.mockito:mockito-core:1.9.0',
asm: 'asm:asm:3.2',
commons_io: 'commons-io:commons-io:2.0.1',
commons_config: 'commons-configuration:commons-configuration:1.6',
commons_codec: 'commons-codec:commons-codec:1.4',
commons_httpclient: 'commons-httpclient:commons-httpclient:3.1',
commons_coll: 'net.sourceforge.collections:collections-generic:4.01', // Use this lib until the commons collection with Generics is released.
slf4j: 'org.slf4j:slf4j-api:1.6.1',
logback_core: 'ch.qos.logback:logback-core:0.9.29',
logback_classic: 'ch.qos.logback:logback-classic:0.9.29',
ejml: 'com.googlecode.efficient-java-matrix-library:ejml:0.17',
zk: 'org.apache.zookeeper:zookeeper:3.3.1',
jcip: 'net.jcip:jcip-annotations:1.0',
junit: 'junit:junit:4.10',
zkclient: 'com.github.sgroschupf:zkclient:0.1',
diezel: 'net.ericaro:diezel-maven-plugin:1.0.0-beta-4',
jcommander: 'com.beust:jcommander:1.25',
commons_io: 'commons-io:commons-io:2.1',
gradle_base_services: 'gradle-base-services:gradle-base-services:1.0',
gradle_core: 'gradle-core:gradle-core:1.0',
gradle_tooling_api: 'gradle-tooling-api:gradle-tooling-api:1.0',
gradle_wrapper: 'gradle-wrapper:gradle-wrapper:1.0'
]
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
// apply plugin: 'checkstyle'
/* Set Java version. */
sourceCompatibility = 1.6
targetCompatibility = 1.6
project.ext["checkstyleConfigFileName"] = "$rootDir/config/checkstyle/s4-checkstyle.xml"
configurations.all {
exclude group: 'com.sun.jdmk', module: 'jmxtools'
exclude group: 'com.sun.jmx', module: 'jmxri'
exclude group: 'javax.jms', module: 'jms'
}
dependencies {
/* Google. */
compile( libraries.guava )
compile( libraries.guice )
compile (libraries.guice_assist)
/* Logging. */
compile( libraries.slf4j )
compile( libraries.logback_core )
compile( libraries.logback_classic )
/* Commons. */
compile( libraries.commons_io )
compile( libraries.commons_config )
compile( libraries.commons_coll )
/* Misc. */
compile( libraries.jcip )
compile( libraries.zk )
/* Testing. */
testCompile( libraries.junit )
}
manifest.mainAttributes(
provider: 'gradle',
'Implementation-Url': 'http://incubator.apache.org/projects/s4.html',
'Implementation-Version': version,
'Implementation-Vendor': 'Apache S4',
'Implementation-Vendor-Id': 'io.s4'
)
}
evaluationDependsOnChildren()
project.ext["platformProjects"] = [project(':s4-base'), project(':s4-core'), project(':s4-comm'), project(':s4-tools')]
configurations {
platformLibs
}
dependencies {
platformLibs platformProjects
}
project.ext["binDistImage"] = copySpec {
platformProjects.collect {proj ->
into ("platform/lib") {
from proj.sourceSets.main.resources
from proj.configurations.runtime.getFiles()
from proj.configurations.archives.allArtifacts.files
}
}
}
task binImage(type: Copy) {
description = "Create binary image"
destinationDir = file("$buildDir/s4-image")
with binDistImage
}
task clean << {
delete buildDir
}
// This task lists all the jars. We can use this pattern to create file descriptors.
task listJars << {
description = 'List all the jars in the S4 framework.'
configurations.platformLibs.each { File file -> println file.name }
}
/* Generates the gradlew scripts.
http://www.gradle.org/1.0-milestone-3/docs/userguide/gradle_wrapper.html */
task wrapper(type: Wrapper) {
gradleVersion = '1.0'
jarFile='lib/gradle-wrapper-1.0.jar'
}
class Version {
int major
int minor
int bugfix
boolean isRelease
String toString() {
"$major.$minor.$bugfix${isRelease ? '' : '-SNAPSHOT'}"
}
}