forked from tom-mohr/particle-life-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
117 lines (94 loc) · 3.23 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
import org.gradle.internal.os.OperatingSystem
plugins {
id "java"
id "application" // for "run" task
id 'edu.sc.seis.launch4j' version '2.5.1' // for generating .exe
id 'org.beryx.runtime' version '1.12.7' // for generating JRE
id 'com.github.johnrengelman.shadow' version '7.1.2' //to make linux build
}
application {
if (OperatingSystem.current() == OperatingSystem.MAC_OS) {
applicationDefaultJvmArgs = ["-XstartOnFirstThread"]
}
}
launch4j {
icon = "${projectDir}/favicon.ico"
mainClassName = 'com.particle_life.app.Main'
dontWrapJar = true
bundledJre64Bit = true
bundledJrePath = "jre"
}
// creates folder "jre"
runtime {
options = ["--compress", "2"]
modules = [
"jdk.zipfs" // needed for "jar" FileSystemProvider (ZipFileSystemProvider), not detected automatically by plugin
]
additive = true
}
task copyJre (type: Copy) {
dependsOn tasks.runtime
from layout.buildDirectory.dir("jre")
into layout.buildDirectory.dir("app/jre")
}
task copyLaunch4j (type: Copy) {
dependsOn tasks.createExe
from layout.buildDirectory.dir("launch4j")
into layout.buildDirectory.dir("app")
}
task assembleApp {
dependsOn tasks.copyLaunch4j, tasks.copyJre
}
task zipApp (type: Zip) {
dependsOn tasks.assembleApp
from layout.buildDirectory.dir("app")
destinationDirectory = layout.buildDirectory.dir("zipApp")
archiveFileName = "particle-life-app.zip"
}
group 'com.particle.life.app'
version '1.0.0'
ext {
lwjglVersion = '3.3.0'
imguiVersion = '1.86.2'
}
jar {
mainClassName = "com.particle_life.app.Main" // required for "run" task
}
project.ext.lwjglVersion = "3.3.0"
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
def osArch = System.getProperty("os.arch")
project.ext.natives = osArch.startsWith("arm") || osArch.startsWith("aarch64")
? "linux-${osArch.contains("64") || osArch.startsWith("armv8") ? "arm64" : "arm32"}"
: "linux"
break
case OperatingSystem.MAC_OS:
project.ext.natives = "macos"
break
case OperatingSystem.WINDOWS:
def osArch = System.getProperty("os.arch")
project.ext.natives = osArch.contains("64")
? "windows${osArch.startsWith("aarch64") ? "-arm64" : ""}"
: "windows-x86"
break
}
repositories {
mavenCentral()
mavenLocal()
maven { url "https://jitpack.io" }
}
dependencies {
implementation "com.github.tom-mohr:particle-life:v0.2.0"
// jOOR
implementation 'org.jooq:joor:0.9.14'
// imGui
implementation "io.github.spair:imgui-java-binding:$imguiVersion"
implementation "io.github.spair:imgui-java-natives-$natives:$imguiVersion"
// LWJGL
[".lwjgl", ".assimp", ".bgfx", ".cuda", ".egl", ".glfw", ".jawt", ".jemalloc", ".libdivide", ".llvm",
".lmdb", ".lz4", ".meow", ".nanovg", ".nfd", ".nuklear", ".odbc", ".openal", ".opencl", ".opengl", ".opengles",
".opus", ".ovr", ".par", ".remotery", ".rpmalloc", ".shaderc", ".sse", ".stb", ".tinyexr", ".tinyfd",
".tootle", ".vma", ".vulkan", ".xxhash", ".yoga", ".zstd"].each {
implementation "org.lwjgl.osgi:org.lwjgl$it:$lwjglVersion"
}
}