-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
255 lines (222 loc) · 8.47 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.2.60'
id 'com.github.johnrengelman.shadow' version '4.0.2'
id 'java'
id 'application'
id 'idea'
id 'edu.sc.seis.macAppBundle' version '2.3.0'
id "com.peterabeles.gversion" version "1.2.4"
id "com.google.protobuf" version "0.8.8"
}
group = 'com.symmetrylabs'
version = '1.0.5'
sourceCompatibility = 1.8
mainClassName = 'com.symmetrylabs.slstudio.SymmetryLauncher'
allprojects {
repositories {
mavenCentral()
maven {
url 'https://jitpack.io'
// these credentials are for the symmetry-labs account
credentials { username 'jp_ad5p43bkk3kiaah4slmihuagci' }
}
}
tasks.withType(JavaCompile) {
sourceCompatibility = '1.8'
}
}
repositories {
// needed for aparapi dependency
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
implementation "com.aparapi:aparapi-jni:1.1.3-20180211.063116-7" // lock aparapi-jni snapshot version
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
implementation 'com.fazecast:jSerialComm:[2.0.0,3.0.0)'
implementation 'com.github.SymmetryLabs:ArtNetStack:44ddfed'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation group: 'com.google.guava', name: 'guava', version: '23.5-jre'
implementation group: 'com.harium', name: 'kdtree', version: '1.0.0'
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
implementation group: 'de.javagl', name: 'obj', version: '0.3.0'
implementation group: 'io.github.lukehutch', name: 'fast-classpath-scanner', version: '2.9.3'
implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.3'
implementation group: 'org.javassist', name: 'javassist', version: '3.22.0-GA'
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: '1.2.60'
implementation group: 'org.processing', name: 'core', version: '3.3.6'
implementation group: 'org.processing', name: 'video', version: '3.2.3'
/* used for logging in vlcj, for more information about why this dependency
is declared here instead of vlcj (which is intentional!) check out
https://www.slf4j.org/manual.html */
implementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
implementation group: 'uk.co.caprica', name: 'vlcj', version: '3.10.1'
implementation group: 'uk.co.xfactory-librarians', name: 'coremidi4j', version: '0.9'
implementation group: 'org.smurn', name: 'jply', version: '0.2.0'
implementation group: 'joda-time', name: 'joda-time', version: '2.10.1'
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: protocVersion
implementation group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion
implementation group: 'io.grpc', name: 'grpc-stub', version: grpcVersion
runtimeOnly group: 'io.grpc', name: 'grpc-netty-shaded', version: grpcVersion
implementation group: 'io.netty', name: 'netty-all', version: '4.1.36.Final'
implementation files('libs/minim.jar')
implementation files('libs/jogamp-fat.jar')
implementation files('libs/aparapi-b6fffad.jar')
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.1.1'
testCompile 'junit:junit:4.12'
compile 'org.glassfish:javax.annotation:10.0-b28'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
run {
mainClassName = rootProject.mainClassName
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
jvmArgs '-XX:+UseParNewGC', '-XX:+UseConcMarkSweepGC'
}
jvmArgs '-Xmx1024M'
// To select a layout from the command line, "gradlew run -Playout=cubes"
systemProperty 'com.symmetrylabs.layout', findProperty('layout')
systemProperty 'com.symmetrylabs.app', 'slstudio'
doLast {
while (file(".restart").exists()) {
file(".restart").delete()
println 'Restarting...'
run.exec()
}
}
}
test {
testLogging {
events "passed", "failed", "skipped"
showStandardStreams = true
exceptionFormat = "full"
}
}
macAppBundle {
mainClassName = rootProject.mainClassName
icon = "src/main/resources/application.icns"
bundleJRE = true
javaProperties.put("apple.laf.useScreenMenuBar", "true")
jarTask = "shadowJar"
javaExtras.put("-XX:+UseParNewGC", null);
javaExtras.put("-XX:+UseConcMarkSweepGC", null);
}
task genPrebuiltSlimgui(type: Copy) {
description "builds and copies slimgui library into the libs prebuilt library folder"
dependsOn ":slimgui:assembleRelease"
from("slimgui/build/lib/main/release") {
include "*.dylib"
include "*.so"
include "*.dll"
include "*.lib"
}
into "libs"
}
task buildAndRunUIv2(type: JavaExec) {
dependsOn ":genPrebuiltSlimgui"
dependsOn ":runUIv2"
}
task runUIv2(type: JavaExec) {
if (System.properties["os.name"] == "Mac OS X") {
/* GLFW needs to run on the main thread of the process on MacOS,
because MacOS only lets you make windows from the main thread. */
jvmArgs '-XstartOnFirstThread'
/* but! AWT on MacOS also wants to run its main loop on the main thread
for the same reason, and it installs weird hooks into the classloader
that causes the entire JVM to hang forever because of a concurrency
bug if you try to load a native library from off the main thread.
Also, it just straight up doesn't work; any call into AWT just
deadlocks the JVM. Setting headless mode causes calls to AWT to just
crash instead of deadlocking the whole system. */
systemProperty 'java.awt.headless', true
}
main = rootProject.mainClassName
systemProperty 'org.lwjgl.util.Debug', false
systemProperty 'java.library.path', 'libs'
systemProperty 'com.symmetrylabs.app', 'volume'
/* copy our classpath from the normal run task, which has its classpath filled in
by the java application plugin. */
classpath = run.classpath
}
/* this doesn't add a dependency, but specifies that, in cases where both are
going to be run because they're both needed for whatever task we're
completing (like buildAndRunUIv2), building the prebuilt must happen before
running. */
runUIv2.mustRunAfter genPrebuiltSlimgui
task runServer(type: JavaExec) {
systemProperty 'com.symmetrylabs.app', 'server'
main = rootProject.mainClassName
/* copy our classpath from the normal run task, which has its classpath filled in
by the java application plugin. */
classpath = run.classpath
}
task genUiHeader(type: Exec) {
description "generates the JNI header file for the UI class wrapper around slimgui"
commandLine "javac", "-h", "slimgui/src/main/cpp/", "src/main/java/com/symmetrylabs/slstudio/ui/v2/UI.java"
}
shadowJar {
classifier = "all"
}
task dist(type: Zip) {
dependsOn ":shadowJar"
from(".") {
include 'libs/**'
include 'shows/**'
include 'data/**'
include 'src/main/resources/**'
}
from("scripts") {
include 'SLStudio.bat'
include 'SLStudio.sh'
include 'Volume.bat'
include 'Volume.sh'
include 'VolumeServer.sh'
include 'VolumeServer.service'
filter { line -> line.replace('$VERSION', project.version) }
}
from(shadowJar) {
include "*"
}
into "SLStudio-" + project.version
}
tasks.withType(Javadoc) {
/* configure javadoc tool to link to the official Java 8 javadoc for JDK classes */
options.with {
links "https://docs.oracle.com/javase/8/docs/api/"
}
}
/* creates com.symmetrylabs.slstudio.Version class with build information */
gversion {
srcDir = "src/main/java/"
classPackage = "com.symmetrylabs.slstudio"
className = "Version"
}
project.compileJava.dependsOn(createVersionFile)
protobuf {
protoc {
// Download protoc compiler from repositories
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}