Skip to content

Commit 2e9cace

Browse files
committed
Build updates
1 parent be54f71 commit 2e9cace

File tree

4 files changed

+43
-24
lines changed

4 files changed

+43
-24
lines changed

.github/workflows/bump-cask-pr.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Homebrew Bump Cask PR
2+
3+
4+
on:
5+
release:
6+
types: [released]
7+
8+
jobs:
9+
released:
10+
name: Create PR
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Update Homebrew cask
14+
uses: macauley/action-homebrew-bump-cask@v1
15+
with:
16+
token: ${{secrets.BUMP_CASK_TOKEN}}
17+
tap: Homebrew/homebrew-cask
18+
cask: blobsaver

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
os: [ubuntu-latest, windows-latest, macOS-latest]
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
- name: Set up JDK
1616
uses: actions/setup-java@v3
1717
with:

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ plugins {
2323
id 'application'
2424
id 'com.github.ben-manes.versions' version '0.46.0'
2525
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'
2728

2829
id 'idea'
2930
}
@@ -77,7 +78,7 @@ application {
7778
}
7879

7980
private String getJarDirectory() {
80-
String dir = ""
81+
String dir = ''
8182
if (DefaultNativePlatform.currentOperatingSystem.isMacOsX()) dir = 'macos/Contents'
8283
else if (DefaultNativePlatform.currentOperatingSystem.isWindows()) dir = 'windows/files'
8384
else if (DefaultNativePlatform.currentOperatingSystem.isLinux()) dir = 'linux'
@@ -111,7 +112,7 @@ jlink {
111112
imageOptions = [ '--copyright', copyright, '--description', description]
112113
installerOptions.addAll '--about-url', 'https://github.com/airsquared/blobsaver'
113114
vendor = 'airsquared'
114-
installerOutputDir = file("${buildDir}/distributions/")
115+
installerOutputDir = layout.buildDirectory.dir('distributions').get().asFile
115116

116117
if (os.isMacOsX()) {
117118
installerType = 'dmg'
@@ -133,32 +134,31 @@ jlink {
133134
}
134135
if (os.isMacOsX()) jpackageImage.doLast {
135136
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')
137138
}
138139
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')
140141
}
141142
copy {
142143
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')
144145
}
145146
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"
147148
}
148149
} else if (os.isWindows()) jpackageImage.doLast {
149150
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')
151152
rename 'LICENSE_windows', 'LICENSE'
152153
rename 'libraries_used_windows.txt', 'libraries_used.txt'
153-
into "${buildDir}/jpackage/blobsaver"
154+
into layout.buildDirectory.dir('jpackage/blobsaver')
154155
}
155156
} else jpackageImage.doLast {
156157
copy {
157158
from "${projectDir}/dist/linux", "${projectDir}/LICENSE", "${projectDir}/libraries_used.txt"
158-
into "${buildDir}/jpackage/blobsaver/lib"
159+
into layout.buildDirectory.dir('jpackage/blobsaver/lib')
159160
}
160161
}
161-
162162
}
163163

164164
task createZip(type: Zip, dependsOn: jpackageImage) {
@@ -168,8 +168,8 @@ task createZip(type: Zip, dependsOn: jpackageImage) {
168168
} else {
169169
archiveFileName = "${project.name}-${project.version}.zip"
170170
}
171-
from "${buildDir}/jpackage"
172-
destinationDirectory = file("${buildDir}/distributions/")
171+
from layout.buildDirectory.dir('jpackage')
172+
destinationDirectory = layout.buildDirectory.dir('distributions')
173173
}
174174

175175
task createTgz(type: Tar, dependsOn: jpackageImage) {
@@ -180,24 +180,24 @@ task createTgz(type: Tar, dependsOn: jpackageImage) {
180180
archiveFileName = "${project.name}-${project.version}.tgz"
181181
}
182182
compression = Compression.GZIP
183-
from "${buildDir}/jpackage"
184-
destinationDirectory = file("${buildDir}/distributions/")
183+
from layout.buildDirectory.dir('jpackage')
184+
destinationDirectory = layout.buildDirectory.dir('distributions')
185185
}
186186

187-
task windowsInstaller(dependsOn: jpackageImage) { // requires inno setup to be installed
187+
task windowsInstaller(type: Exec, dependsOn: jpackageImage) { // requires inno setup to be installed
188188
doFirst {
189189
copy {
190-
from "${projectDir}/dist/windows/blob.ico" into "${buildDir}/jpackage"
190+
from "${projectDir}/dist/windows/blob.ico" into layout.buildDirectory.dir('jpackage')
191191
}
192192
copy {
193-
from "${projectDir}/dist/windows/blobsaver.iss" into "${buildDir}/jpackage"
193+
from "${projectDir}/dist/windows/blobsaver.iss" into layout.buildDirectory.dir('jpackage')
194194
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()])
199196
}
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')
201201
}
202202
}
203203

0 commit comments

Comments
 (0)