Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ build.number
/nbbuild.xml
/jars/
.idea/*
*.iml
*.iml
.gradle
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ notifications:
email:
on_success: always
on_failure: always
install: true
script:
- ./travis_checks.sh
244 changes: 244 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@

// We want the standard java conventions for everything.
apply plugin: 'java'
// This is needed if want to publish artifacts
apply plugin: 'maven-publish'

// TODO: translate more tests, javadoc, revision, major, minor

// For info on the gradle java plugin see https://docs.gradle.org/current/userguide/tutorial_java_projects.html

sourceCompatibility = 1.8

// Load our numbers from the build.properties files.
Properties properties = new Properties()
properties.load(project.file('build.properties').newDataInputStream())
def gigapaxosBuildMajorNumber = properties.getProperty('build.major.number')
def gigapaxosBuildMinorNumber = properties.getProperty('build.minor.number')
def gigapaxosBuildRevisionNumber = properties.getProperty('build.revision.number')
def gigapaxosBuildVersion = "${gigapaxosBuildMajorNumber}.${gigapaxosBuildMinorNumber}.${gigapaxosBuildRevisionNumber}"
def nioBuildMajorNumber = properties.getProperty('nio.build.major.number')
def nioBuildMinorNumber = properties.getProperty('nio.build.minor.number')
def nioBuildRevisionNumber = properties.getProperty('nio.build.revision.number')
def nioBuildVersion = "${nioBuildMajorNumber}.${nioBuildMinorNumber}.${nioBuildRevisionNumber}"


// Change the locations of the srcs - gradle jar plugin has different standard locations
sourceSets {
main {
java {
srcDir 'src'
}
}
test {
java {
srcDir 'src'
}
}
}

// Define where we get our libs from
repositories {
mavenLocal() // Local things end up in ~/.m2/repository
mavenCentral()
}

dependencies {

compile group: 'com.mchange', name: 'c3p0', version: '0.9.5'
compile group: 'org.apache.derby', name: 'derby', version: '10.11.1.1'
compile group: 'redis.clients', name: 'jedis', version: '2.8.1'
compile group: 'net.minidev', name: 'json-smart', version: '1.2'
compile group: 'org.mapdb', name: 'mapdb', version: '2.0-beta13'
compile group: 'com.mchange', name: 'mchange-commons-java', version: '0.2.9'
compile group: 'org.msgpack', name: 'msgpack-core', version: '0.8.8'
compile group: 'io.netty', name: 'netty-all', version: '4.1.4.Final'
// Using a newer version of zookeeper because of problems with the log4j dependency
compile group: 'org.apache.zookeeper', name: 'zookeeper', version: '3.4.9'

// Use these jars for unit testing
compile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
compile group: 'junit', name: 'junit', version: '4.12'
}

// Updates the build.number. Used below whenever a jar is created.
task incrementBuildNumber {
ant.buildnumber(file: 'build.number')
}

// Redefine the default jar task to produce our 3 jars
task jar(type: Jar, overwrite: true,
// Note that we enforce an explicit ordering for these below with
// "createJars.mustRunAfter incrementBuildNumber"
dependsOn: ['incrementBuildNumber', 'createJars']) {
}

// Note that copying the jars to the 'jars' folder will probably go away once we're fully integrated
task createJars(type: Jar,
dependsOn: ['copyGigapaxosFatJar', 'copyNioFatJar', 'copyGigapaxosNioSrcJar']) {
}

createJars.mustRunAfter incrementBuildNumber

// Builds a fat jar for the gigapaxos with all jars included.
task gigapaxosFatJar(type: Jar, dependsOn: [':compileJava', ':processResources']) {
baseName = 'gigapaxos'
version = gigapaxosBuildVersion
// All the source classes
from files(sourceSets.main.output.classesDir)
// All the libs
from configurations.runtime.asFileTree.files.collect {
zipTree(it)
}
// Handle the build number info
Properties props = new Properties()
props.load(project.file('build.number').newDataInputStream())
def buildNumber = props.getProperty('build.number')
def fullVersion = "${gigapaxosBuildVersion}_${buildNumber}"

manifest {
attributes 'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Build-Version': "${fullVersion}",
'Class-Path': '.',
'Implementation-Vendor': 'University of Massachusetts',
'Implementation-Title': 'GigaPaxos',
'Implementation-Version': "$gigapaxosBuildVersion"
}
}

task copyGigapaxosFatJar(type: Copy) {
from gigapaxosFatJar
into 'jars'
}

// Builds a fat jar for the nio with all jars included.
task nioFatJar(type: Jar, dependsOn: [':compileJava', ':processResources']) {
baseName = 'nio'
version = nioBuildVersion
// All the nio source classes
from files(sourceSets.main.output.classesDir) {
include 'edu/umass/cs/nio/**'
include 'edu/umass/cs/utils*'
include 'org/json/*'
// Copied from build.xml, but maybe not needed now.
// Interesting special cases here added because of one use of ReconfigurableClient in NIOInstrumenter
//include 'edu/umass/cs/reconfiguration/**'
//include 'edu/umass/cs/gigapaxos/**'
//include 'edu/umass/cs/protocoltask/**'
}
// All the libs
from configurations.runtime.asFileTree.files.collect {
zipTree(it)
}
// Handle the build number info
Properties props = new Properties()
props.load(project.file('build.number').newDataInputStream())
def buildNumber = props.getProperty('build.number')
def fullVersion = "${nioBuildVersion}_${buildNumber}"

manifest {
attributes 'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Build-Version': "${fullVersion}",
'Implementation-Vendor': 'University of Massachusetts',
'Implementation-Title': 'NIO',
'Implementation-Version': "$nioBuildVersion"
}
}

task copyNioFatJar(type: Copy) {
from nioFatJar
into 'jars'
}

// Builds a fat jar for the nio with all jars included.
task gigapaxosNioSrcJar(type: Jar, dependsOn: [':compileJava', ':processResources']) {
baseName = 'gigapaxos-nio-src'
version = gigapaxosBuildVersion
// all the source jars
from files(sourceSets.main.java.srcDirs)
}

task copyGigapaxosNioSrcJar(type: Copy) {
from gigapaxosNioSrcJar
into 'jars'
}

// Add to the clean task to remove the jars and dist directory
clean.doLast {
file('jars').deleteDir()
file('dist').deleteDir()
}

artifacts {
archives gigapaxosFatJar, nioFatJar, gigapaxosNioSrcJar
}

publishing {
publications {
gigapaxos(MavenPublication) {
groupId 'edu.umass.cs'
artifactId 'gigapaxos'
version "$gigapaxosBuildVersion"

artifact gigapaxosFatJar
}
nio(MavenPublication) {
groupId 'edu.umass.cs'
artifactId 'nio'
version "$nioBuildVersion"

artifact nioFatJar
}
gigapaxosNioSrc(MavenPublication) {
groupId 'edu.umass.cs'
artifactId 'gigapaxos-nio-src'
version "$gigapaxosBuildVersion"

artifact gigapaxosNioSrcJar
}
}
}

test {
jvmArgs '-ea'
jvmArgs '-Djava.util.logging.config.file=logging.properties'
jvmArgs '-Djavax.net.ssl.trustStorePassword=qwerty'
jvmArgs '-Djavax.net.ssl.trustStore=conf/keyStore/node100.jks'
jvmArgs '-Djavax.net.ssl.keyStorePassword=qwerty'
jvmArgs '-Djavax.net.ssl.keyStore=conf/keyStore/node100.jks'
// Always run the tests - otherwise default is only runs when something changes
outputs.upToDateWhen { false }
filter {
includeTestsMatching 'edu.umass.cs.reconfiguration.testing.TESTReconfigurationClient'
}
// The rest of this below isn't necessary, it just changes the output
testLogging {
// Set options for log level LIFECYCLE
events "passed", "skipped", "failed", "standardOut"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true

// Set options for log level DEBUG and INFO
debug {
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
beforeTest { descriptor ->
logger.lifecycle("Running test: $descriptor")
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
22 changes: 5 additions & 17 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<property file="build.properties" />

<property name="src.dir" value="src"/>
<property name="testsrc.dir" location="test"/>
<property name="build.dir" value="build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="build.test.classes.dir" value="${build.dir}/test/classes"/>
Expand Down Expand Up @@ -139,6 +138,7 @@ destfile="${build.jar.dir}/gigapaxos-${build.major.number}.${build.minor.number}
</copy>
</target>

<!-- THIS IS EVERYTHING SO WHY DO WE NEED THIS? -->
<path id="classpath.test">
<pathelement location="${build.classes.dir}"/>
<pathelement location="${lib.dir}/junit-4.12.jar"/>
Expand All @@ -152,7 +152,6 @@ destfile="${build.jar.dir}/gigapaxos-${build.major.number}.${build.minor.number}
<pathelement location="${lib.dir}/msgpack-core-0.8.8.jar"/>
<pathelement location="${lib.dir}/jedis-2.8.1.jar"/>
<pathelement location="${lib.dir}/netty-all-4.1.4.Final.jar"/>
<!-- <pathelement location="${conf.dir}"/>-->
</path>

<target name="ensure-test-name" unless="test">
Expand Down Expand Up @@ -345,34 +344,23 @@ value="${build.major.number}.${build.minor.number}.${build.revision.number}_buil

<target name="niorevision">
<propertyfile file="build.properties">
<entry key="no.build.revision.number" type="int" operation="+" value="1" pattern="00"/>
<entry key="nio.build.revision.number" type="int" operation="+" value="1" pattern="00"/>
</propertyfile>
</target>

<target name="niominor">
<propertyfile file="build.properties">
<entry key="nio.build.minor.number" type="int" operation="+" value="1" pattern="00"/>
<entry key="build.revision.number" type="int" value="0" pattern="00"/>
<entry key="nio.build.revision.number" type="int" value="0" pattern="00"/>
</propertyfile>
</target>

<target name="niomajor">
<propertyfile file="build.properties">
<entry key="nio.build.major.number" type="int" operation="+" value="1" pattern="00"/>
<entry key="build.minor.number" type="int" value="0" pattern="00"/>
<entry key="build.revision.number" type="int" value="0" pattern="00"/>
<entry key="nio.build.minor.number" type="int" value="0" pattern="00"/>
<entry key="nio.build.revision.number" type="int" value="0" pattern="00"/>
</propertyfile>
</target>


<!--
<target name="all">
<propertyfile file="build_info.properties">
<entry key="build.major.number" type="int" operation="+" value="1" pattern="00"/>
<entry key="build.minor.number" type="int" operation="+" value="1" pattern="00"/>
<entry key="build.revision.number" type="int" operation="+" value="1" pattern="00"/>
</propertyfile>
</target>
-->

</project>
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Apr 05 16:17:00 EDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip
Loading