-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
106 lines (87 loc) · 3.05 KB
/
build.gradle
File metadata and controls
106 lines (87 loc) · 3.05 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
plugins {
id 'java'
id 'application'
id 'com.gluonhq.gluonfx-gradle-plugin' version '1.0.27'
}
group = 'io.github._3xhaust'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
dependencies {
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
implementation 'org.projectlombok:lombok:1.18.38'
annotationProcessor 'org.projectlombok:lombok:1.18.38'
testImplementation 'org.projectlombok:lombok:1.18.38'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.38'
def javafxVersion = '21.0.3'
def os = org.gradle.internal.os.OperatingSystem.current()
def arch = System.getProperty('os.arch')
def PLATFORM = (os.isMacOsX() ? (arch.contains('aarch64') || arch.contains('arm') ? 'mac-aarch64' : 'mac')
: os.isWindows() ? (arch.contains('64') ? 'win' : 'win-x86')
: os.isLinux() ? (arch.contains('aarch64') || arch.contains('arm') ? 'linux-aarch64' : 'linux')
: '')
implementation "org.openjfx:javafx-base:${javafxVersion}:${PLATFORM}"
implementation "org.openjfx:javafx-graphics:${javafxVersion}:${PLATFORM}"
implementation "org.openjfx:javafx-controls:${javafxVersion}:${PLATFORM}"
}
test {
useJUnitPlatform()
}
application {
// 기본 실행 엔트리(JavaFX) - Gluon iOS 빌드에서도 사용됨
mainClass = 'examples.hello_world.FXApp'
}
tasks.register('runFx', JavaExec) {
group = 'application'
description = 'Run JavaFX example'
classpath = sourceSets.main.runtimeClasspath
mainClass = 'examples.hello_world.FXApp'
// Use JavaFX modules from runtimeClasspath as module-path
doFirst {
jvmArgs '--module-path', configurations.runtimeClasspath.asPath,
'--add-modules', 'javafx.controls,javafx.graphics'
}
}
gluonfx {
target = 'ios-sim'
mainClassName = 'examples.hello_world.FXApp'
}
// ---------- iOS Shortcuts ----------
tasks.register('iosBuild') {
group = 'GluonFX'
description = 'Build iOS native image and package the .app bundle'
dependsOn 'nativeBuild', 'nativePackage'
}
tasks.register('iosInstall') {
group = 'GluonFX'
description = 'Install the .app bundle to the booted iOS Simulator'
dependsOn 'nativeInstall'
}
tasks.register('iosRun') {
group = 'GluonFX'
description = 'Run the app on the booted iOS Simulator'
dependsOn 'nativeRun'
}
tasks.register('ios') {
group = 'GluonFX'
description = 'One-shot: build + package + install + run on iOS Simulator'
dependsOn 'iosBuild', 'iosInstall', 'iosRun'
}
// Optional helpers (no rebuild): fast relaunch/open
tasks.register('iosOpen', Exec) {
group = 'GluonFX'
description = 'Open iOS Simulator app'
commandLine 'open', '-a', 'Simulator'
}
tasks.register('iosLaunch', Exec) {
group = 'GluonFX'
description = 'Launch installed app on the booted simulator (no rebuild)'
commandLine 'xcrun', 'simctl', 'launch', 'booted', 'io.github._3xhaust.javaUI'
}