-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
130 lines (105 loc) · 3.15 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
plugins {
id 'java'
id 'application'
id 'org.beryx.jlink' version '3.1.1'
id 'io.github.jwharm.flatpak-gradle-generator' version '1.2.0'
id 'io.github.crimix.replace-placeholders' version '2.0'
}
if ("@ID@".endsWith("@")) {
group = 'com.toxicstoxm.LEDSuite'
version = '1.0.0-rc2'
} else {
group = '@ID@'
version = '@VERSION@'
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation 'io.github.jwharm.javagi:adw:0.11.2'
implementation 'org.yaml:snakeyaml:2.4'
implementation 'jakarta.websocket:jakarta.websocket-client-api:2.2.0'
implementation 'org.glassfish.tyrus:tyrus-client:2.2.0'
implementation 'org.glassfish.tyrus:tyrus-container-grizzly-client:2.2.0'
compileOnly 'org.jetbrains:annotations:26.0.2'
annotationProcessor 'org.jetbrains:annotations:26.0.2'
implementation 'com.toxicstoxm.YAJSI:YAJSI:2.1.3'
implementation 'com.toxicstoxm.YAJL:YAJL:2.0.3'
compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36'
implementation 'io.github.classgraph:classgraph:4.8.179'
testImplementation 'org.junit.jupiter:junit-jupiter:5.12.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.0'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(23)
}
}
tasks.named('test', Test) {
useJUnitPlatform()
maxHeapSize = '1G'
testLogging {
events "passed"
}
}
tasks.register('glibCompileResources') {
doLast {
exec {
workingDir 'src/main/resources'
commandLine 'glib-compile-resources', 'LEDSuite.gresource.xml'
}
}
}
tasks.named('classes') {
dependsOn glibCompileResources
}
application {
mainClass = 'com.toxicstoxm.LEDSuite.Main'
mainModule = 'com.toxicstoxm.LEDSuite'
applicationDefaultJvmArgs = [
'--enable-native-access=org.gnome.glib',
'--enable-native-access=org.gnome.gobject',
'--enable-native-access=org.gnome.gio',
'--enable-native-access=org.gnome.gdk',
'--enable-native-access=org.gnome.gtk',
'--enable-native-access=org.gnome.adw',
'--enable-native-access=org.freedesktop.cairo',
'--enable-native-access=com.toxicstoxm.LEDSuite'
]
}
jlink {
options = [
'--strip-debug',
'--no-header-files',
'--no-man-pages'
]
launcher {
name = 'LEDSuite'
}
}
tasks.flatpakGradleGenerator {
outputFile = file('flatpak-sources.json')
downloadDirectory = './offline-repository'
}
replaceSourcePlaceholders {
enabled true
filesToExpand '**/LEDSuiteApplication.java'
extraProperties 'version'
}
tasks.jar {
dependsOn('fatJar')
manifest {
attributes['Main-Class'] = 'com.toxicstoxm.LEDSuite.Main'
}
}
tasks.register('fatJar', Jar) {
manifest {
attributes['Main-Class'] = 'com.toxicstoxm.LEDSuite.Main'
}
archiveBaseName = "${rootProject.name}-fat"
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}