From 4879bcfc5111255728b24d76e9f6d0ab015d0ff5 Mon Sep 17 00:00:00 2001 From: jmpenn Date: Tue, 24 Jan 2023 17:19:19 -0600 Subject: [PATCH] Use Maven to build AircraftDisplay.jar instead of directly from Makefile. (#1435) --- trick_sims/SIM_aircraft/RUN_test/input.py | 2 +- .../SIM_aircraft/models/graphics/Makefile | 36 +----- .../SIM_aircraft/models/graphics/pom.xml | 121 ++++++++++++++++++ .../aircraftDisplay}/AircraftDisplay.java | 2 +- 4 files changed, 126 insertions(+), 35 deletions(-) mode change 100644 => 100755 trick_sims/SIM_aircraft/models/graphics/Makefile create mode 100644 trick_sims/SIM_aircraft/models/graphics/pom.xml rename trick_sims/SIM_aircraft/models/graphics/src/{trick => main/java/trick/aircraftDisplay}/AircraftDisplay.java (99%) diff --git a/trick_sims/SIM_aircraft/RUN_test/input.py b/trick_sims/SIM_aircraft/RUN_test/input.py index abf26810..5d3c19e6 100644 --- a/trick_sims/SIM_aircraft/RUN_test/input.py +++ b/trick_sims/SIM_aircraft/RUN_test/input.py @@ -11,7 +11,7 @@ dyn.aircraft.desired_speed = 200 # meters per second # Start the Satellite Graphics Client #========================================== varServerPort = trick.var_server_get_port(); -AircraftDisplay_path = "models/graphics/dist/AircraftDisplay.jar" +AircraftDisplay_path = "models/graphics/build/AircraftDisplay.jar" if (os.path.isfile(AircraftDisplay_path)) : AircraftDisplay_cmd = "java -jar " \ diff --git a/trick_sims/SIM_aircraft/models/graphics/Makefile b/trick_sims/SIM_aircraft/models/graphics/Makefile old mode 100644 new mode 100755 index a80e3a13..d3e0cbc0 --- a/trick_sims/SIM_aircraft/models/graphics/Makefile +++ b/trick_sims/SIM_aircraft/models/graphics/Makefile @@ -1,36 +1,6 @@ -SHELL = /bin/sh -PROJECT_NAME = AircraftDisplay -SRC_DIR = src -BUILD_DIR = build -CLASSES_DIR = $(BUILD_DIR)/classes -JAR_DIR = dist -MAIN_CLASS = trick.AircraftDisplay - -all: jar +all: + mvn package clean: - rm -rf $(BUILD_DIR) - rm -f manifest - -spotless: clean - rm -rf dist - -$(CLASSES_DIR): - @ mkdir -p $(CLASSES_DIR) - -compile: | $(CLASSES_DIR) - javac -sourcepath $(SRC_DIR) -d $(CLASSES_DIR) $(SRC_DIR)/trick/AircraftDisplay.java - -manifest: - @ echo "Main-Class: $(MAIN_CLASS)" > $@ - -$(JAR_DIR): - @ mkdir -p $(JAR_DIR) - -jar: compile manifest | $(JAR_DIR) - jar cvfm $(JAR_DIR)/$(PROJECT_NAME).jar manifest -C $(CLASSES_DIR) . - @ echo "-------------------------------------------------------------------------------" - @ echo " BUILD COMPLETE" - @ echo "The Java jar file (the Java Executable) is located at: $(JAR_DIR)/$(PROJECT_NAME).jar" - @ echo "-------------------------------------------------------------------------------" + rm -rf build diff --git a/trick_sims/SIM_aircraft/models/graphics/pom.xml b/trick_sims/SIM_aircraft/models/graphics/pom.xml new file mode 100644 index 00000000..d3d3e1d9 --- /dev/null +++ b/trick_sims/SIM_aircraft/models/graphics/pom.xml @@ -0,0 +1,121 @@ + + + + 4.0.0 + + trick-java + trick-java + 23.0.0-beta + + trick-java + + https://github.com/nasa/trick + + + UTF-8 + 1.8 + 1.8 + + + + + junit + junit + 4.13.1 + test + + + + + + AircraftDisplay + + build + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + ${java.home}/bin/javadoc + ../../share/doc/trick/java + + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + + maven-resources-plugin + 3.0.2 + + + + maven-compiler-plugin + 3.8.0 + + + -g + -Xlint:unchecked + -Xlint:deprecation + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + + true + lib/ + AircraftDisplay + + + + + + + maven-surefire-plugin + 2.22.1 + + + + maven-install-plugin + 2.5.2 + + + + maven-deploy-plugin + 2.8.2 + + + + + maven-site-plugin + 3.7.1 + + + + + + + + diff --git a/trick_sims/SIM_aircraft/models/graphics/src/trick/AircraftDisplay.java b/trick_sims/SIM_aircraft/models/graphics/src/main/java/trick/aircraftDisplay/AircraftDisplay.java similarity index 99% rename from trick_sims/SIM_aircraft/models/graphics/src/trick/AircraftDisplay.java rename to trick_sims/SIM_aircraft/models/graphics/src/main/java/trick/aircraftDisplay/AircraftDisplay.java index 75ec2b22..16eae817 100644 --- a/trick_sims/SIM_aircraft/models/graphics/src/trick/AircraftDisplay.java +++ b/trick_sims/SIM_aircraft/models/graphics/src/main/java/trick/aircraftDisplay/AircraftDisplay.java @@ -3,7 +3,7 @@ * 2016 (c) National Aeronautics and Space Administration (NASA) */ -package trick; +/* package trick;*/ import java.awt.Graphics2D; import java.awt.Graphics;