Skip to content

Commit

Permalink
Merge branch 'release/4.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
gravit0 committed Jan 3, 2025
2 parents 09db4b0 + fe01238 commit 14faecd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
submodules: recursive

- name: Cache Gradle
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: gravit-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-launcher-runtime
Expand All @@ -40,7 +40,7 @@ jobs:
cp *.jar ../../artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: LauncherRuntime
path: artifacts
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ javafx {
sourceCompatibility = '17'
targetCompatibility = '17'
group 'pro.gravit.launcher'
version '4.0.5'
version '4.0.6'
def mainClassName = "pro.gravit.launcher.gui.JavaRuntimeModule"

task sourcesJar(type: Jar) {
Expand Down Expand Up @@ -61,11 +61,11 @@ repositories {
}

dependencies {
implementation "pro.gravit.launcher:launcher-core:5.6.8"
implementation "pro.gravit.launcher:launcher-ws-api:5.6.8"
implementation "pro.gravit.launcher:launcher-client-api:5.6.8"
implementation "pro.gravit.launcher:launcher-client-start-api:5.6.8"
implementation "pro.gravit.launcher:launcher-client-starter-api:5.6.8"
implementation "pro.gravit.launcher:launcher-core:5.6.9"
implementation "pro.gravit.launcher:launcher-ws-api:5.6.9"
implementation "pro.gravit.launcher:launcher-client-api:5.6.9"
implementation "pro.gravit.launcher:launcher-client-start-api:5.6.9"
implementation "pro.gravit.launcher:launcher-client-starter-api:5.6.9"
implementation "pro.gravit.utils.enfs:enfs:2.0.1-SNAPSHOT"
implementation 'io.netty:netty-codec-http:4.1.67.Final'
implementation 'com.github.oshi:oshi-core:5.8.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class JavaRuntimeModule extends LauncherModule {

public JavaRuntimeModule() {
super(new LauncherModuleInfo("StdJavaRuntime",
new Version(4, 0, 5, 1, Version.Type.STABLE),
new Version(4, 0, 6, 1, Version.Type.STABLE),
0, new String[]{}, new String[]{"runtime"}));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public String getUsageDescription() {
public void invoke(String... args) {
Platform.runLater(() -> {
LogHelper.info("OS %s ARCH %s Java %d", JVMHelper.OS_TYPE.name(), JVMHelper.ARCH_TYPE.name(), JVMHelper.JVM_VERSION);
LogHelper.info("JavaFX version: %s", System.getProperty( "javafx.runtime.version"));
{
List<String> supportedFeatures = new ArrayList<>();
List<String> unsupportedFeatures = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package pro.gravit.launcher.gui.overlays;

import javafx.animation.FadeTransition;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Node;
Expand All @@ -25,6 +26,9 @@ public final void init() throws Exception {
}

public final void hide(double delay, EventHandler<ActionEvent> onFinished) {
if(!Platform.isFxApplicationThread()) {
throw new RuntimeException("hide() called from non FX application thread");
}
if (useCounter.decrementAndGet() != 0) {
contextHelper.runInFxThread(() -> {
if (onFinished != null) {
Expand Down Expand Up @@ -60,6 +64,9 @@ public void enable() {
}

public void show(AbstractStage stage, EventHandler<ActionEvent> onFinished) throws Exception {
if(!Platform.isFxApplicationThread()) {
throw new RuntimeException("show() called from non FX application thread");
}
if (!isInit()) {
init();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,26 @@ public final <T extends WebSocketEvent> void processRequest(AbstractStage stage,
public final <T extends WebSocketEvent> void processRequest(AbstractStage stage, String message, Request<T> request,
Consumer<T> onSuccess, Consumer<Throwable> onException, EventHandler<ActionEvent> onError) {
try {
show(stage, (e) -> {
ContextHelper.runInFxThreadStatic(() -> show(stage, (e) -> {
try {
description.setText(message);
application.service.request(request).thenAccept((result) -> {
LogHelper.dev("RequestFuture complete normally");
onSuccess.accept(result);
hide(0, null);
ContextHelper.runInFxThreadStatic(() -> hide(0, null));
}).exceptionally((error) -> {
if (onException != null) onException.accept(error);
else ContextHelper.runInFxThreadStatic(() -> errorHandle(error.getCause()));
hide(2500, onError);
ContextHelper.runInFxThreadStatic(() -> hide(2500, onError));
return null;
});
} catch (IOException ex) {
errorHandle(ex);
hide(2500, onError);
}
});
}));
} catch (Exception e) {
errorHandle(e);
ContextHelper.runInFxThreadStatic(() -> errorHandle(e));
}
}
}

0 comments on commit 14faecd

Please sign in to comment.