Skip to content

Commit

Permalink
fixed bug with empty compilation params, dep cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Newland committed Nov 16, 2023
1 parent 81f4402 commit 114b796
Show file tree
Hide file tree
Showing 8 changed files with 405 additions and 367 deletions.
10 changes: 8 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.chrisnewland</groupId>
<artifactId>jitwatch-parent</artifactId>
<version>1.4.7</version>
<version>1.4.8</version>
</parent>

<artifactId>jitwatch-core</artifactId>
Expand All @@ -20,7 +20,13 @@
<artifactId>FreeLogJ</artifactId>
<version>0.0.1</version>
</dependency>

<!--
<dependency>
<groupId>com.chrisnewland</groupId>
<artifactId>ClassAct</artifactId>
<version>0.0.1</version>
</dependency>
-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
552 changes: 206 additions & 346 deletions core/src/main/java/org/adoptopenjdk/jitwatch/model/bytecode/Opcode.java

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

<groupId>com.chrisnewland</groupId>
<artifactId>jitwatch-parent</artifactId>
<version>1.4.7</version>
<version>1.4.8</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<junit.version>4.13.1</junit.version>
<junit.version>4.13.2</junit.version> <!-- https://mvnrepository.com/artifact/junit/junit -->
<javac.source>1.8</javac.source>
<javac.target>1.8</javac.target>

Expand Down Expand Up @@ -41,7 +41,7 @@
<developers>
<developer>
<name>Chris Newland</name>
<url>https://www.chrisnewland.com</url>
<url>https://www.chriswhocodes.com</url>
<email>[email protected]</email>
<timezone>GMT</timezone>
</developer>
Expand Down
162 changes: 162 additions & 0 deletions ui/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>jitwatch-parent</artifactId>
<groupId>com.chrisnewland</groupId>
<version>1.4.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jitwatch-ui</artifactId>
<name>JITWatch UI</name>
<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>java</goal>
</goals>
<configuration>
<skip>false</skip>
<mainClass>${main.class}</mainClass>
<cleanupDaemonThreads>false</cleanupDaemonThreads>
<classpathScope>compile</classpathScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>linux</id>
<properties>
<javafx.platform>linux</javafx.platform>
</properties>
</profile>
<profile>
<id>macosx</id>
<properties>
<javafx.platform>mac</javafx.platform>
</properties>
</profile>
<profile>
<id>windows</id>
<properties>
<javafx.platform>win</javafx.platform>
</properties>
</profile>
<profile>
<id>with_built_in_javafx</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>project-classifier</shadedClassifierName>
<outputFile>target/jitwatch-ui-shaded.jar</outputFile>
<transformers>
<transformer>
<mainClass>${main.class}</mainClass>
<manifestEntries>
<Add-Exports>jdk.jdeps/com.sun.tools.javap</Add-Exports>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>with_openjfx_from_maven_central</id>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>project-classifier</shadedClassifierName>
<outputFile>target/jitwatch-ui-shaded.jar</outputFile>
<transformers>
<transformer>
<mainClass>${main.class}</mainClass>
<manifestEntries>
<Add-Exports>jdk.jdeps/com.sun.tools.javap</Add-Exports>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${openjfx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>${openjfx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>${openjfx.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
<openjfx.version>19.0.2.1</openjfx.version>
</properties>
</project>
13 changes: 9 additions & 4 deletions ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<parent>
<groupId>com.chrisnewland</groupId>
<artifactId>jitwatch-parent</artifactId>
<version>1.4.7</version>
<version>1.4.8</version>
</parent>

<artifactId>jitwatch-ui</artifactId>

<name>JITWatch UI</name>

<properties>
<openjfx.version>18.0.2</openjfx.version>
<openjfx.version>19.0.2.1</openjfx.version> <!-- https://mvnrepository.com/artifact/org.openjfx/javafx -->
</properties>

<profiles>
Expand Down Expand Up @@ -94,7 +94,6 @@
<jdk>[11,)</jdk>
</activation>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
Expand Down Expand Up @@ -157,7 +156,13 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<!--
<dependency>
<groupId>com.chrisnewland</groupId>
<artifactId>ClassAct</artifactId>
<version>0.0.1</version>
</dependency>
-->
<dependency>
<groupId>com.chrisnewland</groupId>
<artifactId>FreeLogJ</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ private void doScreenshot()

Class<?> swingFXUtils = Class.forName("javafx.embed.swing.SwingFXUtils");

Method methodFromFXImage = swingFXUtils.getMethod("fromFXImage", new Class[] {
javafx.scene.image.Image.class,
java.awt.image.BufferedImage.class });
Method methodFromFXImage = swingFXUtils.getMethod("fromFXImage", javafx.scene.image.Image.class,
java.awt.image.BufferedImage.class);

ImageIO.write((RenderedImage) methodFromFXImage.invoke(null, new Object[] {
imageSnap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,14 @@ public void runSandbox(String language, List<File> compileList, File fileToRun)

lastProcess = compiler;

List<String> compilationSwitches = Arrays.asList(logParser.getConfig().getExtraVMCompilationSwitches().split(" "));
String compilationSwitchesText = logParser.getConfig().getExtraVMCompilationSwitches().trim();

List<String> compilationSwitches = new ArrayList<>();

if (!compilationSwitchesText.isEmpty())
{
compilationSwitches.addAll(Arrays.asList(compilationSwitchesText.split("\\s+")));
}

boolean compiledOK = compiler.compile(compileList, buildUniqueClasspath(logParser.getConfig()), compilationSwitches, SANDBOX_CLASS_DIR.toFile(),
Collections.<String, String>emptyMap(), logListener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public static Button getSnapshotButton(final Scene scene, final String filenameP

buttonSnapShot.setOnAction(new EventHandler<ActionEvent>()
{
@Override public void handle(ActionEvent e)
@Override
public void handle(ActionEvent e)
{
takeSnapShot(scene, filenamePrefix);
}
Expand All @@ -183,14 +184,11 @@ private static void takeSnapShot(Scene scene, String filenamePrefix)

Class<?> classSwingFXUtils = Class.forName("javafx.embed.swing.SwingFXUtils");

Method methodWrite = classImageIO.getMethod("write",
new Class[] { java.awt.image.RenderedImage.class, String.class, File.class });
Method methodWrite = classImageIO.getMethod("write", java.awt.image.RenderedImage.class, String.class, File.class);

Method methodFromFXImage = classSwingFXUtils.getMethod("fromFXImage",
new Class[] { javafx.scene.image.Image.class, java.awt.image.BufferedImage.class });
Method methodFromFXImage = classSwingFXUtils.getMethod("fromFXImage", Image.class, java.awt.image.BufferedImage.class);

methodWrite.invoke(null, new Object[] { methodFromFXImage.invoke(null, new Object[] { imageSnap, null }), "png",
new File(snapshotFilename) });
methodWrite.invoke(null, methodFromFXImage.invoke(null, imageSnap, null), "png", new File(snapshotFilename));
}
catch (Throwable t)
{
Expand Down Expand Up @@ -281,7 +279,8 @@ public TooltipBinding(StringProperty text, String tooltipKey)
this.tooltipKey = tooltipKey;
}

@Override protected Tooltip computeValue()
@Override
protected Tooltip computeValue()
{
return new Tooltip(RESOURCE_FACTORY.getString(tooltipKey));
}
Expand Down

0 comments on commit 114b796

Please sign in to comment.