Skip to content

Commit

Permalink
Build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
airsquared committed Sep 7, 2023
1 parent be54f71 commit 2e9cace
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 24 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/bump-cask-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Homebrew Bump Cask PR


on:
release:
types: [released]

jobs:
released:
name: Create PR
runs-on: ubuntu-latest
steps:
- name: Update Homebrew cask
uses: macauley/action-homebrew-bump-cask@v1
with:
token: ${{secrets.BUMP_CASK_TOKEN}}
tap: Homebrew/homebrew-cask
cask: blobsaver
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 23 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ plugins {
id 'application'
id 'com.github.ben-manes.versions' version '0.46.0'
id 'org.beryx.jlink' version '2.26.0'
id 'org.openjfx.javafxplugin' version '0.0.14'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'org.javamodularity.moduleplugin' version '1.8.12'

id 'idea'
}
Expand Down Expand Up @@ -77,7 +78,7 @@ application {
}

private String getJarDirectory() {
String dir = ""
String dir = ''
if (DefaultNativePlatform.currentOperatingSystem.isMacOsX()) dir = 'macos/Contents'
else if (DefaultNativePlatform.currentOperatingSystem.isWindows()) dir = 'windows/files'
else if (DefaultNativePlatform.currentOperatingSystem.isLinux()) dir = 'linux'
Expand Down Expand Up @@ -111,7 +112,7 @@ jlink {
imageOptions = [ '--copyright', copyright, '--description', description]
installerOptions.addAll '--about-url', 'https://github.com/airsquared/blobsaver'
vendor = 'airsquared'
installerOutputDir = file("${buildDir}/distributions/")
installerOutputDir = layout.buildDirectory.dir('distributions').get().asFile

if (os.isMacOsX()) {
installerType = 'dmg'
Expand All @@ -133,32 +134,31 @@ jlink {
}
if (os.isMacOsX()) jpackageImage.doLast {
copy {
from "${projectDir}/dist/macos/Contents/MacOS" into "${buildDir}/jpackage/blobsaver.app/Contents/MacOS"
from "${projectDir}/dist/macos/Contents/MacOS" into layout.buildDirectory.dir('jpackage/blobsaver.app/Contents/MacOS')
}
copy {
from "${projectDir}/dist/macos/Contents/Frameworks" into "${buildDir}/jpackage/blobsaver.app/Contents/Frameworks"
from "${projectDir}/dist/macos/Contents/Frameworks" into layout.buildDirectory.dir('jpackage/blobsaver.app/Contents/Frameworks')
}
copy {
from "${projectDir}/LICENSE", "${projectDir}/libraries_used.txt"
into "${buildDir}/jpackage/blobsaver.app/Contents/Resources"
into layout.buildDirectory.dir('jpackage/blobsaver.app/Contents/Resources')
}
exec { // needed to prevent "application is damaged" error when opening quarantined app
commandLine 'codesign', '--force', '--deep', '--sign', '-', "${buildDir}/jpackage/blobsaver.app"
commandLine 'codesign', '--force', '--deep', '--sign', '-', "${layout.buildDirectory.get()}/jpackage/blobsaver.app"
}
} else if (os.isWindows()) jpackageImage.doLast {
copy {
from "${projectDir}/dist/windows/files", "${buildDir}/jpackage/blobsaver/runtime/bin/zip.dll"
from "${projectDir}/dist/windows/files", layout.buildDirectory.dir('jpackage/blobsaver/runtime/bin/zip.dll')
rename 'LICENSE_windows', 'LICENSE'
rename 'libraries_used_windows.txt', 'libraries_used.txt'
into "${buildDir}/jpackage/blobsaver"
into layout.buildDirectory.dir('jpackage/blobsaver')
}
} else jpackageImage.doLast {
copy {
from "${projectDir}/dist/linux", "${projectDir}/LICENSE", "${projectDir}/libraries_used.txt"
into "${buildDir}/jpackage/blobsaver/lib"
into layout.buildDirectory.dir('jpackage/blobsaver/lib')
}
}

}

task createZip(type: Zip, dependsOn: jpackageImage) {
Expand All @@ -168,8 +168,8 @@ task createZip(type: Zip, dependsOn: jpackageImage) {
} else {
archiveFileName = "${project.name}-${project.version}.zip"
}
from "${buildDir}/jpackage"
destinationDirectory = file("${buildDir}/distributions/")
from layout.buildDirectory.dir('jpackage')
destinationDirectory = layout.buildDirectory.dir('distributions')
}

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

task windowsInstaller(dependsOn: jpackageImage) { // requires inno setup to be installed
task windowsInstaller(type: Exec, dependsOn: jpackageImage) { // requires inno setup to be installed
doFirst {
copy {
from "${projectDir}/dist/windows/blob.ico" into "${buildDir}/jpackage"
from "${projectDir}/dist/windows/blob.ico" into layout.buildDirectory.dir('jpackage')
}
copy {
from "${projectDir}/dist/windows/blobsaver.iss" into "${buildDir}/jpackage"
from "${projectDir}/dist/windows/blobsaver.iss" into layout.buildDirectory.dir('jpackage')
filter(ReplaceTokens, tokens: [AppName: project.name, AppVersion: version, AppCopyright: copyright,
OutputDir: "${buildDir}\\distributions".toString()])
}
exec {
commandLine 'iscc', '/Qp', "${buildDir}\\jpackage\\blobsaver.iss"
OutputDir: "${layout.buildDirectory.get()}\\distributions".toString()])
}
delete "${buildDir}/jpackage/blobsaver.iss"
}
commandLine 'iscc', '/Qp', "${layout.buildDirectory.get()}\\jpackage\\blobsaver.iss"
doLast {
delete layout.buildDirectory.dir('jpackage/blobsaver.iss')
}
}

Expand Down

0 comments on commit 2e9cace

Please sign in to comment.