Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
151 lines (123 sloc) 5.56 KB
apply plugin: 'application'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
version = "2.1-SNAPSHOT"
mainClassName = 'co.paralleluniverse.spaceships.Spaceships'
ext.mainClass = mainClassName
ext.jogampVer = '2.2.1'
repositories {
flatDir { dirs 'lib' }
flatDir { dirs 'jogamp' }
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/releases" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "http://download.oracle.com/maven/" }
}
configurations {
quasar
natives
}
dependencies {
compile "co.paralleluniverse:quasar-core:0.7.3:jdk8" // JDK 8
compile "co.paralleluniverse:quasar-actors:0.7.3"
compile "co.paralleluniverse:quasar-galaxy:0.7.3"
compile "co.paralleluniverse:spacebase-core:2.3-SNAPSHOT:jdk8" // JDK 8
compile "co.paralleluniverse:spacebase-galaxy:2.3-SNAPSHOT"
compile "co.paralleluniverse:galaxy:1.4"
quasar "co.paralleluniverse:quasar-core:0.7.3:jdk8@jar" // JDK 8
compile "com.google.guava:guava:18.0"
compile "com.codahale.metrics:metrics-core:3.0.2"
compile "com.codahale.metrics:metrics-jvm:3.0.2"
compile 'org.apache.commons:commons-lang3:3.1'
compile ":jogl-all:$jogampVer"
compile ":gluegen-rt:$jogampVer"
runtime ":jogl-all:$jogampVer:natives-linux-i586", ":jogl-all:$jogampVer:natives-linux-amd64",
":jogl-all:$jogampVer:natives-windows-i586", ":jogl-all:$jogampVer:natives-windows-amd64",
":jogl-all:$jogampVer:natives-macosx-universal"
runtime ":gluegen-rt:$jogampVer:natives-linux-i586", ":gluegen-rt:$jogampVer:natives-linux-amd64",
":gluegen-rt:$jogampVer:natives-windows-i586", ":gluegen-rt:$jogampVer:natives-windows-amd64",
":gluegen-rt:$jogampVer:natives-macosx-universal"
// natives "org.jogamp.jogl:jogl-all:$jogampVer"
// natives "org.jogamp.gluegen:gluegen-rt:$jogampVer"
// natives "org.jogamp.jogl:jogl-all:$jogampVer:natives-linux-i586", "org.jogamp.jogl:jogl-all:$jogampVer:natives-linux-amd64",
// "org.jogamp.jogl:jogl-all:$jogampVer:natives-windows-i586", "org.jogamp.jogl:jogl-all:$jogampVer:natives-windows-amd64",
// "org.jogamp.jogl:jogl-all:$jogampVer:natives-macosx-universal"
// natives "org.jogamp.gluegen:gluegen-rt:$jogampVer:natives-linux-i586", "org.jogamp.gluegen:gluegen-rt:$jogampVer:natives-linux-amd64",
// "org.jogamp.gluegen:gluegen-rt:$jogampVer:natives-windows-i586", "org.jogamp.gluegen:gluegen-rt:$jogampVer:natives-windows-amd64",
// "org.jogamp.gluegen:gluegen-rt:$jogampVer:natives-macosx-universal"
}
sourceSets {
main {
compileClasspath += configurations.natives
}
test {
compileClasspath += configurations.natives
}
}
task copyJogamp(type: Sync) {
from { configurations.natives }
into { "${rootProject.projectDir}/jogamp" }
}
task copyLibs(type: Sync) {
// dependsOn copyJogamp
from { configurations.compile }
into { "${rootProject.projectDir}/lib" }
include 'spacebase-*.jar'
}
task copyShaders(type:Copy) {
from 'src/main/java/co/paralleluniverse/spaceships/render/shader'
into 'build/classes/main/co/paralleluniverse/spaceships/render/shader'
}
classes.dependsOn copyShaders
run {
classpath = sourceSets.main.runtimeClasspath
if(project.hasProperty('args')){
args project.args.split('\\s+')
}
if(project.hasProperty('mainClass')){
main = project.mainClass
}
}
tasks.withType(JavaExec) {
jvmArgs '-server'
// Quasar
// systemProperty "co.paralleluniverse.fibers.DefaultFiberPool.parallelism", "4"
systemProperty "co.paralleluniverse.fibers.DefaultFiberPool.monitor", "JMX" // "METRICS" // "NONE" //
jvmArgs "-javaagent:${configurations.quasar.singleFile}" // =vdmc (verbose, debug, allow monitors, check class)
// Galaxy
systemProperty 'java.net.preferIPv4Stack', 'true'
// systemProperty "jgroups.bind_addr", "127.0.0.1"
systemProperty "co.paralleluniverse.io.useJDKSerialization", "true"
systemProperty "galaxy.multicast.address", "225.0.0.1"
systemProperty "galaxy.multicast.port", "7050"
systemProperty "co.paralleluniverse.galaxy.configFile", "build/resources/main/config/peer.xml"
systemProperty "co.paralleluniverse.galaxy.autoGoOnline", "true"
// memory
jvmArgs '-Xmx1024m'
jvmArgs '-XX:+UseParallelGC'
jvmArgs '-XX:+UseCondCardMark'
// jvmArgs '-XX:+UseG1GC', '-XX:MaxGCPauseMillis=50'
// profiling
// jvmArgs '-XX:+UnlockCommercialFeatures', '-XX:+FlightRecorder'
// jvmArgs '-verbose:gc'
// jvmArgs '-XX:+UnlockDiagnosticVMOptions', '-XX:+TraceClassLoading', '-XX:+LogCompilation' // use with jitwatch
// jvmArgs '-XX:+UnlockDiagnosticVMOptions', '-XX:+PrintInlining'
// logging
systemProperty "log4j.configurationFile", "${rootProject.projectDir}/log4j.xml"
systemProperty "Log4jContextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"
// debugging
//jvmArgs '-ea'
// systemProperty "co.paralleluniverse.debugMode", "true"
systemProperty "co.paralleluniverse.globalFlightRecorder", "true"
systemProperty "co.paralleluniverse.flightRecorderDumpFile", "spaceships.log"
systemProperty "co.paralleluniverse.monitoring.flightRecorderLevel", "1"
systemProperty "co.paralleluniverse.monitoring.flightRecorderSize","100000"
}
task wrapper(type: Wrapper) {
gradleVersion = '2.1'
}
task classpath << {
println configurations.runtime.files.join(':')
}
defaultTasks 'build','run'