Skip to content

Commit

Permalink
support launching from external program and setting input file, sourc…
Browse files Browse the repository at this point in the history
…e and classpaths
  • Loading branch information
chriswhocodes committed Aug 8, 2022
1 parent 921f850 commit 40c4ac0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ui/src/main/java/org/adoptopenjdk/jitwatch/ui/main/JITWatchUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.IOException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;

Expand Down Expand Up @@ -153,6 +154,9 @@ public class JITWatchUI extends Application
private String focusMemberFromProperty = null;

private static final String PROPERTY_LOGFILE = "jitwatch.logfile";
private static final String PROPERTY_SOURCES = "jitwatch.sourcepath";
private static final String PROPERTY_CLASSPATH = "jitwatch.classpath";

private static final String PROPERTY_FOCUS_MEMBER = "jitwatch.focus.member";

private boolean isReadingLogFile = false;
Expand Down Expand Up @@ -892,6 +896,20 @@ public void changed(ObservableValue<? extends CompilationTableRow> arg0, Compila

log("Setting JIT log file from property " + PROPERTY_LOGFILE + ": " + logFileFromProperty);

JITWatchConfig config = logParser.getConfig();

String sourceLocations = System.getProperty(PROPERTY_SOURCES);
String classLocations = System.getProperty(PROPERTY_CLASSPATH);

List<String> configSources = new ArrayList<>();
List<String> configClasses = new ArrayList<>();

configSources.addAll(Arrays.asList(sourceLocations.split(File.pathSeparator)));
configClasses.addAll(Arrays.asList(classLocations.split(File.pathSeparator)));

config.setSourceLocations(configSources);
config.setClassLocations(configClasses);

Platform.runLater(new Runnable()
{
@Override
Expand Down

0 comments on commit 40c4ac0

Please sign in to comment.