-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
267 lines (225 loc) · 6.59 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
256
257
258
259
260
261
262
263
264
265
266
plugins {
id 'eclipse'
id 'application'
id 'java-library'
id 'org.javamodularity.moduleplugin' version "1.8.12"
id 'org.beryx.jlink' version "3.0.1"
}
repositories {
mavenCentral()
}
mainClassName = 'Image2C.views.ImageApp'
applicationName = 'GUIslice_Image2C'
archivesBaseName = 'guislice_image2c'
project.version = '3.02'
processResources {
from("src/main/java/") {
include 'resources/**'
}
}
application {
mainClass = 'image2C.views.ImageApp'
mainModule = 'image2C'
}
def compiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(18)
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(18)
}
}
jar {
manifest {
attributes 'Main-Class': 'image2C.views.ImageApp',
"Implementation-Title": 'GUIslice ImageApp',
"Implementation-Version": archiveVersion
}
}
jlink {
options = ['--strip-debug', '--compress', '1', '--no-header-files', '--no-man-pages']
targetPlatform('win-x64') {
jdkHome = jdkDownload('https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.2.1%2B1/OpenJDK18U-jdk_x64_windows_hotspot_18.0.2.1_1.zip')
}
targetPlatform('linux-x64') {
jdkHome = jdkDownload('https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.2.1%2B1/OpenJDK18U-jdk_x64_linux_hotspot_18.0.2.1_1.tar.gz')
}
targetPlatform('linux-aarch64') {
jdkHome = jdkDownload('https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.2.1%2B1/OpenJDK18U-jdk_aarch64_linux_hotspot_18.0.2.1_1.tar.gz')
}
targetPlatform('mac-x64') {
jdkHome = jdkDownload('https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.2.1%2B1/OpenJDK18U-jdk_x64_mac_hotspot_18.0.2.1_1.tar.gz')
}
targetPlatform('mac-aarch64') {
jdkHome = jdkDownload('https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.2.1%2B1/OpenJDK18U-jdk_aarch64_mac_hotspot_18.0.2.1_1.tar.gz')
}
launcher {
name = 'image2c'
noConsole = true
}
}
def JLINK_WIN = "$buildDir/image/Image2C-win-x64"
def TARGET_WIN = "${buildDir}/tmp/windows/GUIslice_Image2C"
def JLINK_LINUX_X64 = "$buildDir/image/image2c-linux-x64"
def TARGET_LINUX_X64 = "${buildDir}/tmp/linux-x64/GUIslice_Image2C"
def JLINK_LINUX_AARCH64 = "$buildDir/image/image2c-linux-aarch64"
def TARGET_LINUX_AARCH64 = "${buildDir}/tmp/linux-aarch64/GUIslice_Image2C"
def JLINK_MAC_X64 = "$buildDir/image/image2c-mac-x64"
def TARGET_MAC_X64 = "${buildDir}/tmp/mac-x64/GUIslice_Image2C"
def JLINK_MAC_AARCH64 = "$buildDir/image/image2c-mac-aarch64"
def TARGET_MAC_AARCH64 = "${buildDir}/tmp/mac-aarch64/GUIslice_Image2C"
def innoSetupDir = new File("${buildDir}/innosetup")
tasks.jlink.doLast {
copy {
from "${projectDir}/scripts-win"
into TARGET_WIN
}
copy {
from JLINK_WIN
into TARGET_WIN
}
copy {
from "${projectDir}/scripts/image2c.sh"
into TARGET_LINUX_X64
}
copy {
from JLINK_LINUX_X64
into TARGET_LINUX_X64
}
copy {
from "${projectDir}/scripts/image2c.sh"
into TARGET_LINUX_AARCH64
}
copy {
from JLINK_LINUX_AARCH64
into TARGET_LINUX_AARCH64
}
copy {
from "${projectDir}/scripts/image2c.sh"
into TARGET_MAC_X64
}
copy {
from JLINK_MAC_X64
into TARGET_MAC_X64
}
copy {
from "${projectDir}/scripts/image2c.sh"
into TARGET_MAC_AARCH64
}
copy {
from JLINK_MAC_AARCH64
into TARGET_MAC_AARCH64
}
delete innoSetupDir
innoSetupDir.mkdir();
copy {
from("${projectDir}/scripts/setup_template.iss")
rename("setup_template.iss", "setup.iss")
expand([
applicationVersion: "${project.version}",
])
into(innoSetupDir)
}
}
task pack_WIN(type: Zip) {
dependsOn build, assemble
group = "assemble"
description = "windows package distribution"
doFirst {
copy {
from("${projectDir}/scripts/setup_template.iss")
rename("setup_template.iss", "setup.iss")
expand([
applicationVersion: "${project.version}",
])
into(innoSetupDir)
}
exec {
workingDir projectDir
commandLine "ISCC.exe ${innoSetupDir}/setup.iss /q".split()
}
delete "${innoSetupDir}/setup.iss"
}
from innoSetupDir
archiveBaseName = "image2c-" + "win-x64"
destinationDirectory = file("${buildDir}/disp")
archiveExtension = "zip"
destinationDirectory = file("${buildDir}/disp")
}
task pack_LINUX_X64(type: Tar) {
dependsOn build, assemble
group = "assemble"
description = "linux-x64 package distribution"
from (TARGET_LINUX_X64) {
excludes = ["**/*.sh", "**/bin/java"]
fileMode 0644
}
from (TARGET_LINUX_X64) {
includes = ["**/*.sh", "**/bin/java"]
fileMode 0755
}
archiveBaseName = "image2c-" + "linux-x64"
destinationDirectory = file("${buildDir}/disp")
archiveExtension = "tgz"
compression = Compression.GZIP
}
task pack_LINUX_AARCH64(type: Tar) {
dependsOn build, assemble
group = "assemble"
description = "linux-aarch64 package distribution"
from (TARGET_LINUX_AARCH64) {
excludes = ["**/*.sh", "**/bin/java"]
fileMode 0644
}
from (TARGET_LINUX_AARCH64) {
includes = ["**/*.sh", "**/bin/java"]
fileMode 0755
}
archiveBaseName = "image2c-" + "linux-aarch64"
destinationDirectory = file("${buildDir}/disp")
archiveExtension = "tgz"
compression = Compression.GZIP
}
task pack_MAC_X64(type: Tar) {
dependsOn build, assemble
group = "assemble"
description = "mac-x64 package distribution"
from (TARGET_MAC_X64) {
excludes = ["**/*.sh", "**/bin/java"]
fileMode 0644
}
from (TARGET_MAC_X64) {
includes = ["**/*.sh", "**/bin/java"]
fileMode 0755
}
archiveBaseName = "image2c-" + "mac-x64"
destinationDirectory = file("${buildDir}/disp")
archiveExtension = "tgz"
compression = Compression.GZIP
}
task pack_MAC_AARCH64(type: Tar) {
dependsOn build, assemble
group = "assemble"
description = "mac-aarch64 package distribution"
from (TARGET_MAC_AARCH64) {
excludes = ["**/*.sh", "**/bin/java"]
fileMode 0644
}
from (TARGET_MAC_AARCH64) {
includes = ["**/*.sh", "**/bin/java"]
fileMode 0755
}
archiveBaseName = "image2c-" + "mac-aarch64"
destinationDirectory = file("${buildDir}/disp")
archiveExtension = "tgz"
compression = Compression.GZIP
}
task packageAll() {
dependsOn build, assemble, pack_WIN, pack_LINUX_X64, pack_LINUX_AARCH64, pack_MAC_X64, pack_MAC_AARCH64
group = "assemble"
description = "package all distributions"
}
dependencies {
implementation 'com.formdev:flatlaf:3.3'
implementation 'com.formdev:flatlaf-intellij-themes:3.3'
}