Skip to content

Commit 9988303

Browse files
committed
Fix compiling on platforms other than macOS
1 parent b48345f commit 9988303

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

.idea/codeStyles/codeStyleConfig.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/blobsaver_main.iml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/blobsaver_test.iml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ task createLinuxTargz(type: Tar, dependsOn: shadowJar) {
108108
outputs.file("${buildDir}/distributions/blobsaver-linux.tar.gz")
109109

110110
archiveFileName = "blobsaver-linux.tar.gz"
111+
compression = Compression.GZIP
111112
destinationDirectory = file("${buildDir}/distributions/")
112113
from "${buildDir}/libs/blobsaver.jar", "${projectDir}/dist/linux/"
113114

src/main/java/com/airsquared/blobsaver/Main.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ static void launchIt(String[] args) {
143143
}
144144

145145
@Override
146-
public void start(Stage primaryStage) throws IOException {
146+
@SuppressWarnings("unchecked")
147+
public void start(Stage primaryStage) throws IOException, ReflectiveOperationException {
147148
Main.primaryStage = primaryStage;
148149
Parent root = FXMLLoader.load(getClass().getResource("blobsaver.fxml"));
149150
primaryStage.setTitle("blobsaver " + Main.appVersion);
150151
primaryStage.setScene(new Scene(root));
151152
primaryStage.getScene().getStylesheets().add(getClass().getResource("app.css").toExternalForm());
152153
if (PlatformUtil.isMac()) { // setup the dock icon
153-
com.apple.eawt.Application.getApplication().setDockIconImage(javax.imageio.ImageIO.read(getClass().getResourceAsStream("blob_emoji.png")));
154+
Class clazz = Class.forName("com.apple.eawt.Application");
155+
clazz.getMethod("setDockIconImage", java.awt.Image.class).invoke(clazz.getMethod("getApplication").invoke(null), javax.imageio.ImageIO.read(getClass().getResourceAsStream("blob_emoji.png")));
154156
} else {
155157
primaryStage.getIcons().clear();
156158
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("blob_emoji.png")));

0 commit comments

Comments
 (0)