Skip to content

Commit 24cd17c

Browse files
committed
added configuration to remote start.
1 parent b845b26 commit 24cd17c

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

build-native.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585

8686
<javac includeantruntime="false" source="${javaSourceVersion}" target="${javaTargetVersion}"
8787
srcdir="${basedir}/build/src" destdir="${basedir}/build/classes"
88-
encoding="UTF-8">
88+
encoding="UTF-8" debug="true">
8989
<classpath>
9090
<fileset dir="${basedir}/build/libs">
9191
<include name="*"/>
@@ -180,7 +180,7 @@
180180

181181
<fx:platform>
182182
<fx:jvmarg value="-XX:+UseParallelGC"/>
183-
<fx:jvmarg value="-agentlib:jdwp=transport=dt_socket,server=n,address=127.0.0.1:6005,suspend=y"/>
183+
<fx:jvmarg value="-agentlib:jdwp=transport=dt_socket,server=n,address=javasabr-NB:6005,suspend=y"/>
184184
</fx:platform>
185185

186186
<preferences shortcut="true" menu="true" install="false"/>

src/main/java/com/ss/editor/JFXApplication.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.ss.editor.ui.scene.EditorFXScene;
3535
import com.ss.editor.util.OpenGLVersion;
3636
import com.ss.editor.util.svg.SvgImageLoaderFactory;
37+
import com.ss.rlib.concurrent.util.ThreadUtils;
3738
import com.ss.rlib.logging.Logger;
3839
import com.ss.rlib.logging.LoggerManager;
3940
import com.ss.rlib.manager.InitializeManager;
@@ -100,7 +101,7 @@ public class JFXApplication extends Application {
100101
* @throws IOException the io exception
101102
*/
102103
public static void main(final String[] args) {
103-
104+
104105
// need to disable to work on macos
105106
Configuration.GLFW_CHECK_THREAD0.set(false);
106107
// use jemalloc

src/main/java/com/ss/editor/config/CommandLineConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ss.editor.config;
22

3+
import java.nio.file.Paths;
34
import java.util.Map;
45

56
/**
@@ -13,6 +14,9 @@ public class CommandLineConfig {
1314
* @param args the args
1415
*/
1516
public static void args(final String[] args) {
17+
18+
final EditorConfig editorConfig = EditorConfig.getInstance();
19+
1620
for (final String arg : args) {
1721

1822
if (!arg.contains("=")) {
@@ -60,5 +64,8 @@ public static void args(final String[] args) {
6064
if (env.containsKey("Server.api.port")) {
6165
Config.REMOTE_CONTROL_PORT = Integer.parseInt(env.get("Server.api.port"));
6266
}
67+
if (env.containsKey("Editor.assetFolder")) {
68+
editorConfig.setCurrentAsset(Paths.get(env.get("Editor.assetFolder")));
69+
}
6370
}
6471
}

src/main/java/com/ss/editor/remote/control/client/OpenFileClientPacket.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ protected void readImpl(@NotNull final ConnectionOwner owner, @NotNull final Byt
3535

3636
final Path assetPath = Paths.get(readString(buffer));
3737
final Path fileToOpen = Paths.get(readString(buffer));
38-
final Path assetFile = assetPath.relativize(fileToOpen);
3938

4039
final EditorConfig editorConfig = EditorConfig.getInstance();
4140
final Path currentAsset = editorConfig.getCurrentAsset();
@@ -51,15 +50,15 @@ protected void readImpl(@NotNull final ConnectionOwner owner, @NotNull final Byt
5150
@Override
5251
public void handle(final Event event) {
5352
FX_EVENT_MANAGER.removeEventHandler(AssetComponentLoadedEvent.EVENT_TYPE, this);
54-
FX_EVENT_MANAGER.notify(new RequestedOpenFileEvent(assetFile));
53+
FX_EVENT_MANAGER.notify(new RequestedOpenFileEvent(fileToOpen));
5554
}
5655
};
5756

5857
FX_EVENT_MANAGER.addEventHandler(AssetComponentLoadedEvent.EVENT_TYPE, eventHandler);
5958
});
6059

6160
} else {
62-
FX_EVENT_MANAGER.notify(new RequestedOpenFileEvent(assetFile));
61+
FX_EVENT_MANAGER.notify(new RequestedOpenFileEvent(fileToOpen));
6362
}
6463
}
6564
}

0 commit comments

Comments
 (0)