From 5fb58712d2e60b47ca700309a78674cffc33e023 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Fri, 30 Aug 2024 20:39:50 +0200 Subject: [PATCH 1/7] Add launcher class --- .../src/main/java/spoon/visualisation/Launcher.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 spoon-visualisation/src/main/java/spoon/visualisation/Launcher.java diff --git a/spoon-visualisation/src/main/java/spoon/visualisation/Launcher.java b/spoon-visualisation/src/main/java/spoon/visualisation/Launcher.java new file mode 100644 index 00000000000..cf3aca24ad4 --- /dev/null +++ b/spoon-visualisation/src/main/java/spoon/visualisation/Launcher.java @@ -0,0 +1,9 @@ +package spoon.visualisation; + +import javafx.application.Application; + +public class Launcher { + public static void main(String[] args) { + Application.launch(ShowMe.class); + } +} From 1ba83544a289c5ca10f726bbdaa79a779bfaf361 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Fri, 30 Aug 2024 20:39:55 +0200 Subject: [PATCH 2/7] Trim pom --- spoon-visualisation/pom.xml | 112 ++---------------------------------- 1 file changed, 6 insertions(+), 106 deletions(-) diff --git a/spoon-visualisation/pom.xml b/spoon-visualisation/pom.xml index 5422204dae3..03cc32c8d22 100644 --- a/spoon-visualisation/pom.xml +++ b/spoon-visualisation/pom.xml @@ -9,7 +9,7 @@ The MIT license - http://www.opensource.org/licenses/mit-license.php + https://www.opensource.org/licenses/mit-license.php repo @@ -17,7 +17,7 @@ fr.inria.gforge.spoon spoon-pom - 1.0 + 11.1.0 ../spoon-pom @@ -30,85 +30,25 @@ maven-jar-plugin - 3.4.2 ${project.build.directory}/modules - - org.apache.maven.plugins - maven-dependency-plugin - 3.8.0 - - - main deps - package - - copy-dependencies - - - linux,win,mac - - ${project.build.directory}/modules - - runtime - - - - - JFX deps - package - - copy-dependencies - - - - ${project.build.directory}/modules - - runtime - - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.4.1 - - - main module - package - - exec - - - ${java.home}/bin/jar - - --update - --file=${project.build.directory}/modules/${project.build.finalName}.jar - --main-class=spoon.visualisation.ShowMe - --module-version=${project.version} - - - - - - org.apache.maven.plugins maven-surefire-plugin false false - -Xmx2000m - -Dglass.platform=Monocle + + -Xmx2000m -Dheadless.geometry=1280x1024-32 -Djava.awt.headless=true -Dtestfx.robot=glass -Dtestfx.headless=true - -Dprism.order=sw + -Dprism.order=sw + @@ -130,36 +70,6 @@ fr.inria.gforge.spoon spoon-core 11.1.0 - - - * - com.fasterxml.jackson.core - - - * - org.codehaus.plexus - - - * - org.apache.maven.shared - - - * - org.apache.maven - - - * - org.eclipse.platform - - - * - org.tukaani - - - commons-compress - org.apache.commons - - org.openjfx @@ -212,14 +122,4 @@ - - - - spoon-snapshot - Maven Repository for Spoon Snapshots - https://repository.ow2.org/nexus/content/repositories/snapshots/ - true - false - - From 292e36ce1b2795b838836c0d964f989eb6f60512 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Fri, 30 Aug 2024 20:46:40 +0200 Subject: [PATCH 3/7] Produce single fat jar --- spoon-visualisation/pom.xml | 42 +++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/spoon-visualisation/pom.xml b/spoon-visualisation/pom.xml index 03cc32c8d22..dbae2e1064b 100644 --- a/spoon-visualisation/pom.xml +++ b/spoon-visualisation/pom.xml @@ -29,9 +29,47 @@ - maven-jar-plugin + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + none + + + + + org.apache.maven.plugins + maven-shade-plugin + + + shade-jar + + shade + + package + + - ${project.build.directory}/modules + spoon-${project.name}-all + + + + spoon.visualisation.Launcher + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + From 377da2b6259d7394c9cebb196f34e9a110543d9d Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Fri, 30 Aug 2024 20:51:47 +0200 Subject: [PATCH 4/7] Add javafx plugin --- spoon-visualisation/pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spoon-visualisation/pom.xml b/spoon-visualisation/pom.xml index dbae2e1064b..ed1e8c12a22 100644 --- a/spoon-visualisation/pom.xml +++ b/spoon-visualisation/pom.xml @@ -89,6 +89,15 @@ + + + org.openjfx + javafx-maven-plugin + 0.0.8 + + spoon.visualisation/spoon.visualisation.Launcher + + From 5218b3e1484ff42134af9043f2a7a8b2606f0ccd Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Fri, 30 Aug 2024 20:51:50 +0200 Subject: [PATCH 5/7] Update readme --- spoon-visualisation/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spoon-visualisation/README.md b/spoon-visualisation/README.md index 76c6cab2134..b4bea978f25 100644 --- a/spoon-visualisation/README.md +++ b/spoon-visualisation/README.md @@ -9,11 +9,9 @@ It is an alternative to the Swing-based GUI of Spoon ASTs (`$ java -cp spoon...- ## How to run -The app requires a JDK 11. -We currently do not provide any packaging of the app (`jlink` cannot package apps having non-modular libraries, such as Spoon). - -So, to run the app, run: `mvn clean package`. -Then go into the `target/modules` folder and launch: `java --module-path . --add-modules=ALL-MODULE-PATH -jar visualisation-1.1.jar` +1. Install Java **22** or newer. +2. Run: `mvn javafx:run`. Alternativatively, build a fat jar using `mvn + package` and then run `java -jar target/spoon-visualisation-all.jar`. ## Features Summary From cf791111e5318571c0f4f6ae8b51e2ce65ca963e Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Fri, 30 Aug 2024 20:56:17 +0200 Subject: [PATCH 6/7] Use classpath mode for javafx plugin module path mode does not work with eclipse jdt, which is incorrectly split for modularization --- spoon-visualisation/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spoon-visualisation/pom.xml b/spoon-visualisation/pom.xml index ed1e8c12a22..4673c25972c 100644 --- a/spoon-visualisation/pom.xml +++ b/spoon-visualisation/pom.xml @@ -41,6 +41,7 @@ org.apache.maven.plugins maven-shade-plugin + 3.6.0 shade-jar @@ -96,6 +97,7 @@ 0.0.8 spoon.visualisation/spoon.visualisation.Launcher + CLASSPATH From 51e2ea60e86277842b868c1aefbea7f1c52ae5f1 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Fri, 30 Aug 2024 20:57:57 +0200 Subject: [PATCH 7/7] Increase compliance level to 22 --- .../main/java/spoon/visualisation/command/SpoonTreeCmdBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spoon-visualisation/src/main/java/spoon/visualisation/command/SpoonTreeCmdBase.java b/spoon-visualisation/src/main/java/spoon/visualisation/command/SpoonTreeCmdBase.java index c022baab360..6a7863b0679 100644 --- a/spoon-visualisation/src/main/java/spoon/visualisation/command/SpoonTreeCmdBase.java +++ b/spoon-visualisation/src/main/java/spoon/visualisation/command/SpoonTreeCmdBase.java @@ -82,7 +82,7 @@ protected void doCmdBody() { env.setAutoImports(true); env.disableConsistencyChecks(); env.setLevel("OFF"); - env.setComplianceLevel(11); + env.setComplianceLevel(22); launcher.buildModel().getRootPackage().accept(new SpoonTreeScanner(createSpoonVisitor(levelsToIgnore), hideImplicit));