-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
262 lines (204 loc) · 6.78 KB
/
Copy pathbuild.gradle
File metadata and controls
262 lines (204 loc) · 6.78 KB
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
256
257
258
259
260
261
/*
JVM "classic" build for klik
0. cp build.gradle.jvm build.gradle
1. make sure you have a JDK with javafx bundled:
sdk install java 25.fx-zulu
2. Enjoy!
start klik 'standalone' with:
gradle klik
start audio_player 'standalone' with:
gradle audio_player
start the launcher with:
gradle run
COSMETIC: to get 'live' transmission
of UI properties (style, font, etc) to work,
you need to start the launcher first as it acts
as a dispatcher for these properties.
*/
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'com.gradleup.shadow' version '9.0.1'
//id 'org.beryx.jlink' version '2.24.0' // Beryx jlink plugin
}
java {
sourceCompatibility = '26'
targetCompatibility = '26'
}
version = '1.0' // application_version
group = 'klikr'
javafx {
version = "26"
modules = [ 'javafx.base', 'javafx.graphics', 'javafx.controls', 'javafx.fxml','javafx.media','javafx.web' ]
}
repositories {
mavenCentral()
}
dependencies {
// MessagePack
implementation 'org.msgpack:msgpack-core:0.9.8'
// EXIF reader
implementation 'com.drewnoakes:metadata-extractor:2.20.0'
// Cache
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: '3.2.2'
// moving folders across different drives
implementation group: 'commons-io', name: 'commons-io', version: '2.19.0'
// for writing png files without AWT
implementation 'ar.com.hjg:pngj:2.1.0'
// for VIPS image rescaling
implementation("app.photofox.vips-ffm:vips-ffm-core:1.9.1")
// for monaco web browser editor
implementation("io.javalin:javalin:6.4.0")
}
tasks.register('klikr', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.Klikr_application'
classpath(sourceSets.main.runtimeClasspath)
group = 'applications'
//jvmArgs = ['--enable-native-access=ALL-UNNAMED', '-Djava.library.path=/usr/local/lib:/opt/homebrew/Cellar/vips/8.17.2/lib']
doFirst {
println 'doFirst start'
def props = new Properties()
def dir = new File(System.getProperty('user.home'), '.klikr')
def file = new File(dir, 'ram.properties')
// 1️⃣ Make sure the file exists
if (!file.exists())
{
println "${file} not found – using default JVM arguments."
return;
}
// Load it safely
try {
file.withInputStream { stream -> props.load(stream) }
println "doFirst props loaded: ${props}"
} catch (Exception e) {
println "Failed to load ${file}: ${e.message}"
// Optional: decide whether to abort or continue
}
// Pull the property, validate it, and set the flag
final int DEFAULT_RAM_GB = 2
def raw = props.getProperty('max_RAM_in_GBytes')
if (!raw) {
println "Property 'max_RAM_in_GBytes' missing – using default (${DEFAULT_RAM_GB}G)."
return
}
// try to parse the value
Integer ramInGb
try {
ramInGb = raw.toInteger()
} catch (NumberFormatException nfe) {
println "'max_RAM_in_GBytes' is not an integer: '${raw}'. Ignoring."
return
}
// validate the range
if (ramInGb <= 0) {
println "'max_RAM_in_GBytes' must be > 0 – got ${ramInGb}. Ignoring."
return
}
// All good – set the flag
println "doFirst found max_RAM_in_GBytes: ${ramInGb}G"
jvmArgs "-Xmx${ramInGb}G"
// If you need to return something from doFirst, put it here.
return
}
}
tasks.register('old_audio_player', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.audio.old_player.Audio_player_application'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
tasks.register('song_playlist_application', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.audio.Song_playlist_application'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
tasks.register('Test_boolean_preferences', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.javalin.boolean_preferences.Test_boolean_preferences'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
tasks.register('simple_audio', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.audio.simple_player.Simple_audio_player_application'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
tasks.register('image_playlist_app', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.images.Image_playlist_app'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
tasks.register('in3D', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.in3D.The_main_circular_3'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
tasks.register('mmap', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.util.mmap.Mmap_test'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
tasks.register('monaco', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.javalin.monaco.Javalin_monaco_app'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
tasks.register('undos', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.javalin.undos.Javalin_undos_app'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
tasks.register('history', JavaExec) {
dependsOn 'classes'
mainClass = 'klikr.javalin.history.Javalin_history_app'
classpath = sourceSets.main.runtimeClasspath
group = 'applications'
return
}
application {
mainClass = "klikr.Klikr_application"
}
run{
standardInput = System.in
classpath = sourceSets.main.runtimeClasspath
//systemProperty 'java.library.path' , '/usr/local/lib:/opt/homebrew/Cellar/vips/8.17.2/lib'
//jvmArgs = ['--enable-native-access=ALL-UNNAMED','-Djava.library.path=/usr/local/lib:/opt/homebrew/Cellar/vips/8.17.2/lib']
}
tasks.register('javalin_history_test', JavaExec) {
mainClass = 'klikr.javalin.active_list.Javalin_history_and_undo_app'
classpath(sourceSets.main.runtimeClasspath)
group = 'test-applications'
}
shadowJar {
archiveFileName.set("klikr.jar")
manifest {
attributes(
'Main-Class': 'klikr.Klikr_application',
'Implementation-Version' : project.version,
'JavaFX-Modules': ['javafx.base','javafx.graphics','javafx.controls','javafx.fxml', 'javafx.media', 'javafx.web']
)
}
mergeServiceFiles()
//dependencies {
// include(dependency('ar.com.hjg:pngj:2.1.0'))
//}
//relocate 'ar.com.hjg.pngj', 'klik.ar.com.hjg.pngj'
}