Skip to content

Commit

Permalink
Merge pull request #120 from CodeDead/release/v1.3.1
Browse files Browse the repository at this point in the history
Release/v1.3.1
  • Loading branch information
CodeDead authored Mar 28, 2024
2 parents 6fd6a72 + 28eb712 commit bd82d70
Show file tree
Hide file tree
Showing 24 changed files with 82 additions and 104 deletions.
50 changes: 21 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,32 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install -y fuse libfuse2

- name: Set up JDK 21
uses: actions/setup-java@v3
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
run: ./gradlew build

- name: Build (jlink)
uses: gradle/gradle-build-action@v2
with:
arguments: jlink
run: ./gradlew jlink

- name: Build (jpackage)
uses: gradle/gradle-build-action@v2
with:
arguments: jpackage
run: ./gradlew jpackage

- name: Publish artifacts
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
prerelease: false
files: |
Expand All @@ -60,18 +57,21 @@ jobs:
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install -y fuse libfuse2

- name: Set up JDK 21
uses: actions/setup-java@v3
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Switch portable flag (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sed -i 's/final boolean PORTABLE = false/final boolean PORTABLE = true/g' src/main/java/com/codedead/opal/utils/SharedVariables.java
Expand All @@ -81,32 +81,24 @@ jobs:
run: (Get-Content src\main\java\com\codedead\opal\utils\SharedVariables.java).replace('final boolean PORTABLE = false', 'final boolean PORTABLE = true') | Set-Content src\main\java\com\codedead\opal\utils\SharedVariables.java

- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
run: ./gradlew build

- name: Build (AppImage)
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: gradle/gradle-build-action@v2
with:
arguments: AppImage
run: ./gradlew AppImage

- name: Build (jlink)
uses: gradle/gradle-build-action@v2
with:
arguments: jlink
run: ./gradlew jlink

- name: Build (jpackage)
uses: gradle/gradle-build-action@v2
with:
arguments: jpackage
run: ./gradlew jpackage

- name: ZIP artifacts
if: ${{ matrix.os == 'windows-latest' }}
run: Compress-Archive -Path build/jpackage/Opal/* -Destination build/jpackage/Opal-win-portable.zip

- name: Publish artifacts
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
prerelease: false
files: |
Expand Down
29 changes: 11 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,33 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install -y fuse libfuse2

- name: Set up JDK 21
uses: actions/setup-java@v3
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Test
uses: gradle/gradle-build-action@v2
with:
arguments: test
run: ./gradlew test

- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
run: ./gradlew build

- name: Build (AppImage)
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: gradle/gradle-build-action@v2
with:
arguments: AppImage
run: ./gradlew AppImage

- name: Build (jlink)
uses: gradle/gradle-build-action@v2
with:
arguments: jlink
run: ./gradlew jlink

- name: Build (jpackage)
uses: gradle/gradle-build-action@v2
with:
arguments: jpackage
run: ./gradlew jpackage
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ This library is maintained by CodeDead. You can find more about us using the fol
* [Facebook](https://facebook.com/deadlinecodedead)
* [Reddit](https://reddit.com/r/CodeDead)

Copyright © 2023 CodeDead
Copyright © 2024 CodeDead
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {
id 'idea'
id 'eclipse'
id 'application'
id 'org.beryx.jlink' version '3.0.0'
id 'org.beryx.jlink' version '3.0.1'
id 'org.openjfx.javafxplugin' version '0.1.0'
}

group 'com.codedead'
version '1.3.0'
version '1.3.1'

def currentOS = DefaultNativePlatform.currentOperatingSystem

Expand All @@ -25,7 +25,7 @@ application {
}

javafx {
version = '21.0.1'
version = '22'
configuration = 'implementation'
modules = ['javafx.base', 'javafx.controls', 'javafx.fxml', 'javafx.media']
}
Expand Down Expand Up @@ -55,7 +55,7 @@ jlink {
'--win-upgrade-uuid', '876c5464-9a66-4913-89a4-c63a4b8b4bb9',
'--win-help-url', 'https://codedead.com/contact',
'--win-dir-chooser',
'--copyright', 'Copyright (c) 2023 CodeDead',
'--copyright', 'Copyright (c) 2024 CodeDead',
'--description', 'Opal is a free and open-source JavaFX application that can play relaxing music in the background',
'--vendor', 'CodeDead',
'--license-file', 'LICENSE',
Expand All @@ -71,7 +71,7 @@ jlink {
'--linux-shortcut',
'--linux-package-name', 'opal-codedead',
'--linux-rpm-license-type', 'GPLv3',
'--copyright', 'Copyright (c) 2023 CodeDead',
'--copyright', 'Copyright (c) 2024 CodeDead',
'--description', 'Opal is a free and open-source JavaFX application that can play relaxing music in the background',
'--vendor', 'CodeDead',
'--license-file', 'LICENSE',
Expand All @@ -87,7 +87,7 @@ jlink {
'--mac-package-name', 'Opal',
'--mac-package-identifier', 'com.codedead.opal',
'--mac-app-category', 'public.app-category.music',
'--copyright', 'Copyright (c) 2023 CodeDead',
'--copyright', 'Copyright (c) 2024 CodeDead',
'--description', 'Opal is a free and open-source JavaFX application that can play relaxing music in the background',
'--vendor', 'CodeDead',
'--license-file', 'LICENSE',
Expand Down Expand Up @@ -140,11 +140,11 @@ repositories {
}

dependencies {
implementation 'org.apache.logging.log4j:log4j-core:2.21.1'
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
implementation 'io.github.mkpaz:atlantafx-base:2.0.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
}

tasks.named('test') {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ private void settingsAction() {
logger.info("Showing the SettingsWindow");
primaryStage.show();
primaryStage.setWidth(450);
primaryStage.setHeight(320);
primaryStage.setHeight(350);
} catch (final IOException ex) {
logger.error("Unable to open the SettingsWindow", ex);
FxUtils.showErrorAlert(translationBundle.getString("SettingsWindowError"), ex.toString(), getClass().getResourceAsStream(SharedVariables.ICON_URL));
Expand Down Expand Up @@ -510,7 +510,7 @@ private void aboutAction() {
logger.info("Showing the AboutWindow");
primaryStage.show();
primaryStage.setWidth(450);
primaryStage.setHeight(250);
primaryStage.setHeight(280);
} catch (final IOException ex) {
logger.error("Unable to open the AboutWindow", ex);
FxUtils.showErrorAlert(translationBundle.getString("AboutWindowError"), ex.toString(), getClass().getResourceAsStream(SharedVariables.ICON_URL));
Expand Down Expand Up @@ -549,7 +549,7 @@ public void fired() {
String line;
while ((line = reader.readLine()) != null) {
builder.append(line);
builder.append(System.getProperty("line.separator"));
builder.append(System.lineSeparator());
}
final String result = builder.toString();
logger.info("Shutdown command result: {}", result);
Expand Down Expand Up @@ -606,7 +606,7 @@ private void onDragDropped(final DragEvent dragEvent) {
boolean success = false;

if (db.hasFiles()) {
openSoundPreset(db.getFiles().get(0).getAbsolutePath());
openSoundPreset(db.getFiles().getFirst().getAbsolutePath());
success = true;
}

Expand Down
17 changes: 9 additions & 8 deletions src/main/java/com/codedead/opal/controller/UpdateController.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,18 @@ private int versionCompare(final String v1, final String v2) {
public List<PlatformUpdate> getUpdates() throws IOException, InterruptedException, InvalidHttpResponseCodeException {
logger.info("Attempting to retrieve List of PlatformUpdate objects from {}", getUpdateUrl());

final HttpClient client = HttpClient.newHttpClient();
final HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(getUpdateUrl()))
.build();
try (final HttpClient client = HttpClient.newHttpClient()) {
final HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(getUpdateUrl()))
.build();

final HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
final HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

if (response.statusCode() == 200)
return Arrays.asList(objectMapper.readValue(response.body(), PlatformUpdate[].class));
if (response.statusCode() == 200)
return Arrays.asList(objectMapper.readValue(response.body(), PlatformUpdate[].class));

throw new InvalidHttpResponseCodeException(String.format("Invalid HTTP response code (%s)", response.statusCode()));
throw new InvalidHttpResponseCodeException(String.format("Invalid HTTP response code (%s)", response.statusCode()));
}
}

/**
Expand Down
12 changes: 2 additions & 10 deletions src/main/java/com/codedead/opal/utils/FxUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ public static void showInformationAlert(final String content, final InputStream
throw new NullPointerException("Content cannot be null!");

final Alert alert = new Alert(Alert.AlertType.INFORMATION, content, ButtonType.OK);
alert.setResizable(true);

final Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();

if (imageStream != null) {
if (imageStream != null)
stage.getIcons().add(new Image(imageStream));
}

alert.showAndWait();
}
Expand All @@ -50,13 +47,10 @@ public static void showInformationAlert(final String content, final InputStream
*/
public static boolean showConfirmationAlert(final String content, final InputStream imageStream) {
final Alert alert = new Alert(Alert.AlertType.CONFIRMATION, content, ButtonType.YES, ButtonType.NO);
alert.setResizable(true);

final Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();

if (imageStream != null) {
if (imageStream != null)
stage.getIcons().add(new Image(imageStream));
}

alert.showAndWait();

Expand Down Expand Up @@ -110,9 +104,7 @@ private static Alert getErrorAlert(final String content) {
GridPane.setHgrow(textArea, Priority.ALWAYS);

expContent.add(textArea, 0, 0);

alert.getDialogPane().setExpandableContent(expContent);
alert.setResizable(true);

return alert;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/codedead/opal/utils/SharedVariables.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public final class SharedVariables {

public static final String ICON_URL = "/images/opal.png";
public static final String CURRENT_VERSION = "1.3.0.0";
public static final String CURRENT_VERSION = "1.3.1.0";
public static final boolean PORTABLE = false;
public static final String DEFAULT_LOCALE = "en-US";

Expand Down
Binary file modified src/main/resources/documents/help.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/resources/translations/OpalApplication.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
About=About
AboutText=Opal was created by DeadLine\n\nAudio: ZapSplat.com\nImages: Remix Icon\nTheme: AtlantaFX\nVersion: 1.3.0\n\nCopyright © 2023 CodeDead
AboutText=Opal was created by DeadLine\n\nAudio: ZapSplat.com\nImages: Remix Icon\nTheme: AtlantaFX\nVersion: 1.3.1\n\nCopyright © 2024 CodeDead
AboutWindowError=Unable to open the About Window!
AboutWindowTitle=Opal - About
AutoUpdate=Automatically check for updates
Expand Down
Loading

0 comments on commit bd82d70

Please sign in to comment.