From edd23f46c26dcb3319ed6403217808ed85146afd Mon Sep 17 00:00:00 2001
From: git <tdnorbra@nps.edu>
Date: Sat, 24 Aug 2024 11:06:41 -0700
Subject: [PATCH] [Terry N.] more path surgery

---
 build.properties |  8 ++++--
 build.xml        | 74 ++++++++++++++++++++++++++++--------------------
 2 files changed, 48 insertions(+), 34 deletions(-)

diff --git a/build.properties b/build.properties
index 7fa66e1304..085db50553 100644
--- a/build.properties
+++ b/build.properties
@@ -1,10 +1,12 @@
 # Created 23 AUG 2024
 product.shortname=viskit
-viskit.dir=${basedir}/${product.shortname}
-viskit.editor.jar=${viskit.dir}/viskit-editor.jar
+viskit.dir=${product.shortname}
+viskit.lib.dir=${viskit.dir}/lib
 
 opendis.jar=lib/opendis7-full.jar
-runtime.classpath=${opendis.jar}
+extra.classpath=${opendis.jar}
+
+main.class=viskit.EventGraphAssemblyComboMain
 
 assy.file=${basedir}/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/ArrivalProcessOpenDis7Assembly.xml
 #assy.file=${basedir}/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/SimpleServerDis7Assembly.xml
diff --git a/build.xml b/build.xml
index 0986877f97..ec0f66995f 100644
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
   Copyright (c) 1995-2023 held by the author(s).  All rights reserved.
-                          
+
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
@@ -41,9 +41,9 @@ POSSIBILITY OF SUCH DAMAGE.
 -->
 <project name="MV3500 Networked Graphics" default="all" basedir=".">
     <description>Build targets for NPS Networked Graphics MV3500</description>
-	
+
 	<!-- TODO add targets for project maintenance, testing and deployment
-    
+
     <property name="specificationsDirectory" location="specifications"/>
     <import   file="specifications/build.xml"/> -->
     <property file="build.properties"/>
@@ -75,7 +75,7 @@ POSSIBILITY OF SUCH DAMAGE.
         <echoproperties/> -->
         <echo message="==========================================="/>
     </target>
-    
+
     <target name="all" depends="versions">
         <ant dir="examples"    target="clean"/>
         <ant dir="examples"    target="jar"/>
@@ -83,7 +83,7 @@ POSSIBILITY OF SUCH DAMAGE.
         <ant dir="assignments" target="jar"/>
         <antcall               target="javadoc.all"/>
     </target>
-    
+
     <target name="clean.all.pduLogs" description="clean autogenerated PDU capture logs">
         <ant dir="assignments" target="clean.all.pduLogs"/>
         <ant dir="examples"    target="clean.all.pduLogs"/>
@@ -94,53 +94,53 @@ POSSIBILITY OF SUCH DAMAGE.
         <ant dir="assignments" target="javadoc.custom"/>
         <ant dir="examples"    target="javadoc.custom"/>
     </target>
-    
+
     <target name="view.gitlab.nps.edu.MV3500" description="view MV3500 gitlab site in web browser (via Netbeans only)">
         <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500"/>
         <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500"/>
         <!-- TODO implementation-independent approach if possible.  other Ant approaches have to be customized for each OS -->
     </target>
-    
+
     <target name="view.gitlab.nps.edu.MV3500.assignments" description="view MV3500 gitlab examples in web browser (via Netbeans only)">
         <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/assignments"/>
         <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/assignments"/>
     </target>
-    
+
     <target name="view.gitlab.nps.edu.MV3500.examples" description="view MV3500 gitlab examples in web browser (via Netbeans only)">
         <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/examples"/>
         <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/examples"/>
         <!-- TODO implementation-independent approach if possible.  other Ant approaches have to be customized for each OS -->
     </target>
-    
+
     <target name="view.gitlab.nps.edu.MV3500.issues" description="view online issues in web browser (Netbeans only)">
         <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/issues" />
         <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/issues" />
         <!-- TODO implementation-independent approach if possible, but note that other Ant approaches usually have to be customized for each OS. -->
         <echo message="... for issue visibility, be sure to login" />
     </target>
-    
+
     <target name="view.gitlab.nps.edu.MV3500.specifications.README" description="view MV3500 gitlab examples in web browser (via Netbeans only)">
         <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/specifications/README.md"/>
         <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/specifications/README.md"/>
     </target>
-    
+
     <target name="view.open-dis.github.com" description="view github open-dis site in web browser (via Netbeans only)">
         <echo message="https://github.com/open-dis"/>
         <nbbrowse url="https://github.com/open-dis"/>
     </target>
-    
+
     <target name="view.open-dis.github.com.opendis7-java" description="view github open-dis open-dis-java current build in web browser (via Netbeans only)">
         <echo message="https://github.com/open-dis/opendis7-java"/>
         <nbbrowse url="https://github.com/open-dis/opendis7-java"/>
     </target>
-    
+
     <target name="view.open-dis.github.com.opendis7-source-generator" description="view github open-dis opendis7-source-generator project in web browser (via Netbeans only)">
         <echo message="https://github.com/open-dis"/>
         <nbbrowse url="https://github.com/open-dis"/>
     </target>
-    
+
     <target name="update.opendis7.jar.from.local" description="update opendis7-java jar files from locally built project into lib directory">
-        
+
         <property name="opendis7-java.relative" value="../../x3d-github/opendis7-java/dist"/>
         <echo message="Copy ${opendis7-java.relative}/opendis7-full.jar to project lib/ subdirectory..."/>
         <!-- https://ant.apache.org/manual/Tasks/fail.html -->
@@ -160,21 +160,21 @@ POSSIBILITY OF SUCH DAMAGE.
         <delete file="lib/opendis7-enumerations-classes.jar" verbose="false" failonerror="false"/>
         <delete file="lib/opendis7-enumerations-javadoc.jar" verbose="false" failonerror="false"/>
         <delete file="lib/opendis7-enumerations-source.jar"  verbose="false" failonerror="false"/>
-        
+
         <!-- replace latest version -->
         <delete file="lib/opendis7-full.jar"                   verbose="true" failonerror="false"/>
         <copy file="${opendis7-java.relative}/opendis7-full.jar" todir="lib"                  force="true" verbose="true" failonerror="true"/>
-        
+
         <!--
         <delete file="assignments/dist/lib/opendis7-full.jar" verbose="true" failonerror="false"/>
         <delete file="examples/dist/lib/opendis7-full.jar"    verbose="true" failonerror="false"/>
         <copy file="${opendis7-java.relative}/opendis7-full.jar" todir="assignments/dist/lib" force="true" verbose="true" failonerror="true"/>
         <copy file="${opendis7-java.relative}/opendis7-full.jar" todir="examples/dist/lib"    force="true" verbose="true" failonerror="true"/>
-        
+
         <copy file="${opendis7-java.relative}/opendis7-enumerations-classes.jar" todir="lib" force="true" verbose="true" failonerror="true"/>
         <copy file="${opendis7-java.relative}/opendis7-enumerations-source.jar"  todir="lib" force="true" verbose="true" failonerror="true"/>
         <copy file="${opendis7-java.relative}/opendis7-enumerations-javadoc.jar" todir="lib" force="true" verbose="true" failonerror="true"/>
-        
+
         <fail message="opendis7-pdus-classes.jar not found">
             <condition>
                 <not>
@@ -184,8 +184,8 @@ POSSIBILITY OF SUCH DAMAGE.
                 </not>
             </condition>
         </fail>
-        
-        
+
+
         <copy file="${opendis7-java.relative}/opendis7-pdus-classes.jar"         todir="lib" force="true" verbose="true" failonerror="true"/>
         <copy file="${opendis7-java.relative}/opendis7-pdus-javadoc.jar"         todir="lib" force="true" verbose="true" failonerror="true"/>
         <copy file="${opendis7-java.relative}/opendis7-pdus-source.jar"          todir="lib" force="true" verbose="true" failonerror="true"/>
@@ -193,7 +193,7 @@ POSSIBILITY OF SUCH DAMAGE.
        <!-- <delete file="lib/opendis7-classes.jar" verbose="true" failonerror="false"/> prior name -->
        <!-- <delete file="lib/opendis7-javadoc.jar" verbose="true" failonerror="false"/> prior name -->
        <!-- <delete file="lib/opendis7-source.jar"  verbose="true" failonerror="false"/> prior name -->
-       
+
     </target>
 
     <property name="gitlab.nps.edu.MV3500.lib" value="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/lib"/>
@@ -219,11 +219,11 @@ POSSIBILITY OF SUCH DAMAGE.
              dest="lib" verbose="true" usetimestamp="true"/>
         -->
     </target>
- 
+
     <target name="update.opendis7.jar.from.maven" description="update opendis7.jar in project lib directory">
         <echo message="TODO retrieve from Maven published repository once available"/>
     </target>
-    
+
     <property name="gitlab.nps.edu.MV3302.lib" value="https://gitlab.nps.edu/abuss/MV3302ClassCode/-/tree/master/lib/Simkit"/>
 
     <target name="update.simkit.jar.from.gitlab" description="Update local opendis7 .jar files in project lib directory">
@@ -238,7 +238,7 @@ POSSIBILITY OF SUCH DAMAGE.
         <get src="https://gitlab.nps.edu/abuss/MV3302ClassCode/-/raw/master/lib/Simkit/simkit-doc.zip"
              dest="lib" verbose="true" usetimestamp="true"/>
     </target>
-    
+
     <!-- Viskit properties -->
     <target name="platformInitialize" depends="platformType"/>
     <target name="platformType">
@@ -271,21 +271,33 @@ POSSIBILITY OF SUCH DAMAGE.
     </target>
     <target name="initializeAll" depends="platformInitialize,initWin,initUnix,initMac"/>
     
-    <target name="run.viskit" depends="initializeAll" description="Start the Visual Simikit (viskit) DES Authoring Tool on any O/S">
-        <java dir="${viskit.dir}" jar="${viskit.editor.jar}" fork="true">
-            <classpath path="${runtime.classpath}"/>
+    <target name="set.classpath" depends="initializeAll">
+        <path id="runtime.classpath">
+            <fileset dir="${viskit.lib.dir}">
+                <include name="**/*.jar"/>
+            </fileset>
+        </path>
+        <echo message="runtime.classpath=${toString:runtime.classpath}"/>
+    </target>
+
+    <target name="run.viskit" depends="set.classpath" description="Start the Visual Simikit (viskit) DES Authoring Tool on any O/S">
+        <java classname="${main.class}"
+              classpathref="runtime.classpath"
+              dir="${viskit.dir}"
+              fork="true">
+            <classpath path="${extra.classpath}"/>
 	    <jvmarg line="${run.args}"/>
             <arg value="${assy.file}"/>
         </java>
     </target>
-    
+
     <target name="clean.all.viskit.logs" description="clean autogenerated PDU capture and Viskit generated logs">
         <delete dir="${viskit.dir}/logs"/>
         <delete dir="${viskit.dir}/pduLog"/>
     </target>
-    
+
     <target name="nuke.dot.viskit" description="Abolish an out of synch configuration and metadata directory - only when necessary">
         <delete includeemptydirs="yes" dir="${dot.viskit.dir}"/>
     </target>
-    
+
 </project>
\ No newline at end of file
-- 
GitLab