/
build.gradle
138 lines (113 loc) · 5.39 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
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.6.2-SNAPSHOT:jdk8" // JDK 8
compile "co.paralleluniverse:quasar-actors:0.6.2-SNAPSHOT"
compile "co.paralleluniverse:quasar-galaxy:0.6.2-SNAPSHOT"
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.6.2-SNAPSHOT:jdk8@jar" // JDK 8
compile "com.google.guava:guava:17.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
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 "co.paralleluniverse.io.useJDKSerialization", "true"
systemProperty "jgroups.bind_addr", "127.0.0.1"
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'