@@ -23,7 +23,8 @@ plugins {
23
23
id ' application'
24
24
id ' com.github.ben-manes.versions' version ' 0.46.0'
25
25
id ' org.beryx.jlink' version ' 2.26.0'
26
- id ' org.openjfx.javafxplugin' version ' 0.0.14'
26
+ id ' org.openjfx.javafxplugin' version ' 0.1.0'
27
+ id ' org.javamodularity.moduleplugin' version ' 1.8.12'
27
28
28
29
id ' idea'
29
30
}
@@ -77,7 +78,7 @@ application {
77
78
}
78
79
79
80
private String getJarDirectory () {
80
- String dir = " "
81
+ String dir = ' '
81
82
if (DefaultNativePlatform . currentOperatingSystem. isMacOsX()) dir = ' macos/Contents'
82
83
else if (DefaultNativePlatform . currentOperatingSystem. isWindows()) dir = ' windows/files'
83
84
else if (DefaultNativePlatform . currentOperatingSystem. isLinux()) dir = ' linux'
@@ -111,7 +112,7 @@ jlink {
111
112
imageOptions = [ ' --copyright' , copyright, ' --description' , description]
112
113
installerOptions. addAll ' --about-url' , ' https://github.com/airsquared/blobsaver'
113
114
vendor = ' airsquared'
114
- installerOutputDir = file( " ${ buildDir } / distributions/ " )
115
+ installerOutputDir = layout . buildDirectory . dir( ' distributions' ) . get() . asFile
115
116
116
117
if (os. isMacOsX()) {
117
118
installerType = ' dmg'
@@ -133,32 +134,31 @@ jlink {
133
134
}
134
135
if (os. isMacOsX()) jpackageImage. doLast {
135
136
copy {
136
- from " ${ projectDir} /dist/macos/Contents/MacOS" into " ${ buildDir } / jpackage/blobsaver.app/Contents/MacOS"
137
+ from " ${ projectDir} /dist/macos/Contents/MacOS" into layout . buildDirectory . dir( ' jpackage/blobsaver.app/Contents/MacOS' )
137
138
}
138
139
copy {
139
- from " ${ projectDir} /dist/macos/Contents/Frameworks" into " ${ buildDir } / jpackage/blobsaver.app/Contents/Frameworks"
140
+ from " ${ projectDir} /dist/macos/Contents/Frameworks" into layout . buildDirectory . dir( ' jpackage/blobsaver.app/Contents/Frameworks' )
140
141
}
141
142
copy {
142
143
from " ${ projectDir} /LICENSE" , " ${ projectDir} /libraries_used.txt"
143
- into " ${ buildDir } / jpackage/blobsaver.app/Contents/Resources"
144
+ into layout . buildDirectory . dir( ' jpackage/blobsaver.app/Contents/Resources' )
144
145
}
145
146
exec { // needed to prevent "application is damaged" error when opening quarantined app
146
- commandLine ' codesign' , ' --force' , ' --deep' , ' --sign' , ' -' , " ${ buildDir } /jpackage/blobsaver.app"
147
+ commandLine ' codesign' , ' --force' , ' --deep' , ' --sign' , ' -' , " ${ layout.buildDirectory.get() } /jpackage/blobsaver.app"
147
148
}
148
149
} else if (os. isWindows()) jpackageImage. doLast {
149
150
copy {
150
- from " ${ projectDir} /dist/windows/files" , " ${ buildDir } / jpackage/blobsaver/runtime/bin/zip.dll"
151
+ from " ${ projectDir} /dist/windows/files" , layout . buildDirectory . dir( ' jpackage/blobsaver/runtime/bin/zip.dll' )
151
152
rename ' LICENSE_windows' , ' LICENSE'
152
153
rename ' libraries_used_windows.txt' , ' libraries_used.txt'
153
- into " ${ buildDir } / jpackage/blobsaver"
154
+ into layout . buildDirectory . dir( ' jpackage/blobsaver' )
154
155
}
155
156
} else jpackageImage. doLast {
156
157
copy {
157
158
from " ${ projectDir} /dist/linux" , " ${ projectDir} /LICENSE" , " ${ projectDir} /libraries_used.txt"
158
- into " ${ buildDir } / jpackage/blobsaver/lib"
159
+ into layout . buildDirectory . dir( ' jpackage/blobsaver/lib' )
159
160
}
160
161
}
161
-
162
162
}
163
163
164
164
task createZip (type : Zip , dependsOn : jpackageImage) {
@@ -168,8 +168,8 @@ task createZip(type: Zip, dependsOn: jpackageImage) {
168
168
} else {
169
169
archiveFileName = " ${ project.name} -${ project.version} .zip"
170
170
}
171
- from " ${ buildDir } / jpackage"
172
- destinationDirectory = file( " ${ buildDir } / distributions/ " )
171
+ from layout . buildDirectory . dir( ' jpackage' )
172
+ destinationDirectory = layout . buildDirectory . dir( ' distributions' )
173
173
}
174
174
175
175
task createTgz (type : Tar , dependsOn : jpackageImage) {
@@ -180,24 +180,24 @@ task createTgz(type: Tar, dependsOn: jpackageImage) {
180
180
archiveFileName = " ${ project.name} -${ project.version} .tgz"
181
181
}
182
182
compression = Compression . GZIP
183
- from " ${ buildDir } / jpackage"
184
- destinationDirectory = file( " ${ buildDir } / distributions/ " )
183
+ from layout . buildDirectory . dir( ' jpackage' )
184
+ destinationDirectory = layout . buildDirectory . dir( ' distributions' )
185
185
}
186
186
187
- task windowsInstaller (dependsOn : jpackageImage) { // requires inno setup to be installed
187
+ task windowsInstaller (type : Exec , dependsOn : jpackageImage) { // requires inno setup to be installed
188
188
doFirst {
189
189
copy {
190
- from " ${ projectDir} /dist/windows/blob.ico" into " ${ buildDir } / jpackage"
190
+ from " ${ projectDir} /dist/windows/blob.ico" into layout . buildDirectory . dir( ' jpackage' )
191
191
}
192
192
copy {
193
- from " ${ projectDir} /dist/windows/blobsaver.iss" into " ${ buildDir } / jpackage"
193
+ from " ${ projectDir} /dist/windows/blobsaver.iss" into layout . buildDirectory . dir( ' jpackage' )
194
194
filter(ReplaceTokens , tokens : [AppName : project. name, AppVersion : version, AppCopyright : copyright,
195
- OutputDir : " ${ buildDir} \\ distributions" . toString()])
196
- }
197
- exec {
198
- commandLine ' iscc' , ' /Qp' , " ${ buildDir} \\ jpackage\\ blobsaver.iss"
195
+ OutputDir : " ${ layout.buildDirectory.get()} \\ distributions" . toString()])
199
196
}
200
- delete " ${ buildDir} /jpackage/blobsaver.iss"
197
+ }
198
+ commandLine ' iscc' , ' /Qp' , " ${ layout.buildDirectory.get()} \\ jpackage\\ blobsaver.iss"
199
+ doLast {
200
+ delete layout. buildDirectory. dir(' jpackage/blobsaver.iss' )
201
201
}
202
202
}
203
203
0 commit comments