-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathbuild-test.gradle
124 lines (108 loc) · 5.8 KB
/
build-test.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
// We want the standard java conventions for everything.
apply plugin: 'java'
// Set the name of the gar to something other than GNS.
archivesBaseName = 'gnsserver'
// Load our numbers from the build.properties files.
Properties properties = new Properties()
properties.load(project.file('build.properties').newDataInputStream())
def buildMajorNumber = properties.getProperty('build.major.number')
def buildMinorNumber = properties.getProperty('build.minor.number')
def buildRevisionNumber = properties.getProperty('build.revision.number')
// Change the locations of the srcs - we're gradle has sdifferent standard locations.
sourceSets {
main{
java {
srcDir 'src'
}
}
test {
java {
srcDir 'test'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile files('lib/context-client-GNS.jar', 'lib/gigapaxos-1.0.05.jar', )
compile group: 'org.aspectj', name: 'aspectjrt', version: "1.8.2"
compile group: 'org.aspectj', name: 'aspectjweaver', version: "1.7.2"
compile group: 'org.apache.cassandra.deps', name: 'avro', version: '1.4.0-cassandra-1'
compile group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.11.6'
compile group: 'org.apache.cassandra', name: 'cassandra-all', version: '1.2.6'
compile group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '1.0.2-dse2'
compile group: 'org.apache.cassandra', name: 'cassandra-thrift', version: '1.2.6'
compile group: 'commons-cli', name: 'commons-cli', version: '1.1'
compile group: 'commons-codec', name: 'commons-codec', version: '1.9'
compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
compile group: 'org.apache.commons', name:'commons-lang3', version: '3.3.1'
compile group: 'commons-logging', name: 'commons-logging', version: '1.1.3'
compile group: 'commons-pool', name: 'commons-pool', version: '1.5.3'
compile group: 'org.apache.derby', name: 'derby', version: '10.12.1.1'
compile group: 'dnsjava', name: 'dnsjava', version: '2.1.6'
compile group: 'org.freemarker', name: 'freemarker', version: '2.3.9'
compile group: 'com.google.guava', name: 'guava', version: '14.0.1'
compile group: 'me.prettyprint', name: 'hector-core', version: '1.0-5'
compile group: 'me.prettyprint', name: 'hector-test', version: '1.0-5'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5'
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.4'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.6.0'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.6.6'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.6.6'
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: '2.6.6'
compile group: 'com.sun.mail', name: 'javax.mail', version: '1.5.5'
compile group: 'jline', name: 'jline', version: '1.0'
compile group: 'joda-time', name: 'joda-time', version: '2.8.1'
compile group: 'com.jcraft', name: 'jsch', version: '0.1.51'
compile group: 'log4j', name: 'log4j', version: '1.2.16'
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '2.12.1'
compile group: 'org.springframework', name: 'spring-beans', version: '3.0.7.RELEASE'
compile group: 'org.springframework', name: 'spring-context', version: '3.0.7.RELEASE'
compile group: 'org.springframework', name: 'spring-core', version: '3.0.7.RELEASE'
compile group: 'org.springframework', name: 'spring-test', version: '3.0.7.RELEASE'
// Use android for compling, but not runtime
compileOnly group: 'com.google.android', name: 'android', version: '4.1.1.4'
//compileOnly files('lib/android.jar')
// Use these jars for unit testing
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
// This isn't strictly needed to make a jar, but it
// builds a fat jar with all jars included like we're using.
task serverfatjar(type: Jar, dependsOn: [':compileJava', ':processResources']) {
from files(sourceSets.main.output.classesDir)
from configurations.runtime.asFileTree.files.collect { zipTree(it) }
Properties properties3 = new Properties()
properties3.load(project.file('build.number').newDataInputStream())
def buildNumber = properties3.getProperty('build.number')
version = "${buildMajorNumber}.${buildMinorNumber}.${buildRevisionNumber}"
def fullVersion = "${buildMajorNumber}.${buildMinorNumber}.${buildRevisionNumber}_${buildNumber}"
System.out.println("Build version: ${fullVersion}")
manifest {
// Todo: Add more of these back from the ant build file
attributes 'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Main-Class': 'edu.umass.cs.gns.httpserver.GnsHttpServer',
//'Build-Version': System.getProperty('version.code'),
'Implementation-Vendor': 'University of Massachusetts',
'Implementation-Title': 'GNS',
'Implementation-Version': "$version"
}
}
// Along with the one below this updates the build.number whenever a jar is created.
// We might want to trigger off a different task though, like releasing an artifact.
task('increaseBuildNumber') << {
Properties properties2 = new Properties()
properties2.load(project.file('build.number').newDataInputStream())
def buildNumber = Integer.parseInt(properties2.getProperty('build.number')) + 1
System.out.println("buildNumber: ${buildNumber}")
properties2.setProperty('build.number', Integer.toString(buildNumber))
properties2.store(project.file('build.number').newWriter(), null)
}
tasks.whenTaskAdded { task ->
if (task.name == 'serverfatjar') {
task.dependsOn 'increaseBuildNumber'
}
}