This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
executable file
·216 lines (181 loc) · 7.34 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
import java.text.SimpleDateFormat
// --- release plugin
// see: http://tellurianring.com/wiki/gradle/release
apply from: "https://launchpad.net/gradle-release/trunk/latest/+download/apply.groovy"
group = 'com.github.enr'
buildscript {
repositories { mavenRepo url: 'http://evgenyg.artifactoryonline.com/evgenyg/repo/' }
dependencies { classpath "com.github.goldin.plugins:gradle:0.1.3" }
}
ext {
groovyVersion = '2.0.5'
jettyVersion = '8.1.4.v20120524'
javaModules = [
':modules:core', ':modules:uat'
]
testNgModules = [
':modules:core'
]
cukeModules = [
':modules:uat'
]
archiveables = [':modules:core']
localRepo = "${rootProject.projectDir}/lib"
uploadables = [ "xite-${version}.zip".toString(),
"xite-${version}.zip.sha1".toString()]
javaVersion = System.getProperty('java.version')
java7 = javaVersion.startsWith('1.7')
}
def printBuild(message) {
if (hasProperty('buildoutput')) {
logger.lifecycle(" ${message}")
}
}
/*
// Prevent plugin from asking for a version number interactively
ext.'gradle.release.useAutomaticVersion' = "true"
release {
failOnCommitNeeded=true
failOnPublishNeeded=true
failOnUnversionedFiles=true
failOnUpdateNeeded=true
includeProjectNameInTag=true
requireBranch = null
}
*/
allprojects { project ->
group = 'com.github.enr'
buildDir = 'target'
repositories {
mavenLocal()
mavenCentral()
flatDir(dirs: file("${rootProject.projectDir}/lib"))
maven {
url 'https://oss.sonatype.org/content/repositories/releases/'
}
maven {
url 'http://groovypp.artifactoryonline.com/groovypp/libs-releases-local'
}
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = 'GitHub/Clap'
addArtifactPattern 'http://cloud.github.com/downloads/enr/clap/[module]-[revision].[ext]'
addIvyPattern 'http://cloud.github.com/downloads/enr/clap/[module]-[revision].pom'
}
}
}
subprojects {
if (project.path in javaModules) {
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'about'
configurations {
compile.transitive = true
testCompile.transitive = true
}
dependencies {
groovy "org.codehaus.groovy:groovy-all:$groovyVersion"
compile "org.codehaus.groovy:groovy-all:$groovyVersion",
'com.google.inject:guice:3.0',
'com.beust:jcommander:1.30',
'com.github.enr:clap-core:0.3.1-SNAPSHOT',
'com.github.enr:markdownj-extras:0.4',
'com.madgag:markdownj-core:0.4.1',
'com.google.guava:guava:13.0',
'commons-cli:commons-cli:1.2', // needed from markdownj-extras
'commons-io:commons-io:1.4', // needed from markdownj-extras
'org.apache.ant:ant-nodeps:1.8.1',
'org.apache.ant:ant-commons-net:1.8.1',
'org.slf4j:slf4j-api:1.6.0',
'org.slf4j:slf4j-log4j12:1.6.0',
'log4j:log4j:1.2.16'
compile group: 'org.eclipse.jetty', name: 'jetty-server', version: "${jettyVersion}", transitive: false
compile group: 'org.eclipse.jetty', name: 'jetty-util', version: "${jettyVersion}", transitive: false
compile group: 'org.eclipse.jetty', name: 'jetty-io', version: "${jettyVersion}", transitive: false
compile group: 'org.eclipse.jetty', name: 'jetty-http', version: "${jettyVersion}", transitive: false
compile group: 'org.eclipse.jetty', name: 'jetty-continuation', version: "${jettyVersion}", transitive: false
compile group: 'org.eclipse.jetty.orbit', name: 'javax.servlet', version: "3.0.0.v201112011016", ext: 'jar', transitive: false
testCompile 'org.testng:testng:6.8',
'org.easytesting:fest-assert-core:2.0M8'
}
archivesBaseName = "xite-${project.name}"
sourceCompatibility = 1.6
targetCompatibility = 1.6
tasks.withType(Jar).each{ jarTask ->
jarTask.manifest {
Date buildTime = new Date()
attributes(
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
'Build-Date': new SimpleDateFormat('dd-MMM-yyyy').format(buildTime),
'Build-Time': new SimpleDateFormat('hh:mm aa').format(buildTime),
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
}
eclipse {
project {
name = "xite-${project.name}"
}
classpath {
defaultOutputDir = new File("${project.buildDir}/eclipse/classes");
downloadJavadoc = true
}
}
}
if (project.path in testNgModules) {
test {
useTestNG()
testLogging.showStandardStreams = false
beforeTest { descriptor ->
printBuild("--- Running test: " + descriptor)
}
onOutput { descriptor, event ->
printBuild(event.message)
}
}
}
if (project.path in cukeModules) {
apply from: "${rootProject.getProjectDir().getAbsolutePath()}/gradle/tasks/cuke-check.gradle"
test.dependsOn ':modules:core:installApp'
}
if (project.path in archiveables) {
apply from: "${rootProject.getProjectDir().getAbsolutePath()}/gradle/tasks/propsfile.gradle"
propsfile {
filename = 'xite-app.properties'
props = [ 'clap.meta.name':'xite' ,
'clap.meta.version':project.version ,
'clap.meta.displayname':'Xite' ]
}
if (java7) {
apply from:'http://gradle.smokejumperit.com/github-dev.gradle'
// gradle uploadArchives -Dgithub.password=***
// gradle ghUpload -Dgithub.password=*** [ or system env 'GITHUB_PASS' ]
ghUpload {
username = 'enr'
repo = 'xite'
}
ghUpload.doFirst { task ->
configurations.archives.allArtifacts.each { artifact ->
def artifactFileName = artifact.file.getName()
def uploadable = (artifactFileName in uploadables)
if (! uploadable) {
println "removing '${artifactFileName}' from uploadable archives"
configurations.archives.artifacts.remove(artifact)
}
}
}
}
afterEvaluate {
tasks.withType(Zip) { task ->
task.doLast {
printBuild "after ev: ${it} ${it.archivePath}"
ant.checksum(file: it.archivePath, algorithm: 'SHA1', fileext: '.sha1')
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.3'
}