diff --git a/build.xml b/build.xml index bb2b3ba5e063cac224724ed780ab58a949c12e83..7bc2f5b3a5eac6a8c184c7a615d723a971a98d35 100644 --- a/build.xml +++ b/build.xml @@ -536,9 +536,9 @@ Key references: <target name="clean.all" depends="clean.backups,clean.duplicates,clean.Canonical.xml,clean.htmlListings,clean.java,clean.schematron,clean.SVG,clean.wrl,clean.json,clean.x3dv,clean.x3db,clean.X3domXhtml,clean.X_ITE.html,clean.slideshowTools,clean.catalog.pages,clean.X3dTidy" description="clean out autogenerated files (only)"> <echo message="clean/delete autogenerated ${archive.name} catalog pages and files matching *.x3d scenes: *.html *.wrl *.x3db *.x3dv *Canonical.xml (but do not clean autogenerated images under version control)"/> <!-- delete autogenerated directories, but not _archive directory --> - <delete dir="_svg" quiet="true" includeemptydirs="true"/> - <delete dir="_schematron" quiet="true" includeemptydirs="true"/> - <delete verbose="true"> + <delete dir="_svg" quiet="true" includeemptydirs="true" failonerror="false"/> + <delete dir="_schematron" quiet="true" includeemptydirs="true" failonerror="false"/> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <!-- <fileset dir="." includes="build.out*.txt"/> --> <fileset dir="." includes="ContentCatalog*.*"/> <fileset dir="." includes="newScene.*"/> @@ -563,7 +563,7 @@ Key references: <target name="clean.archiveSubdirectories" description="clean out duplicates in archive/ and _archive/ subdirectories"> <echo message="clean/delete archive (backup) files for project ${archive.name}"/> - <delete includeemptydirs="true" verbose="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="." includes="**/archive/**"/> <fileset dir="." includes="**/_archive/**"/> </delete> @@ -571,20 +571,22 @@ Key references: <target name="clean.catalog.pages" description="clean out catalog-produced files and schematron outputs"> <echo message="clean/delete autogenerated catalog files and schematron outputs"/> - <delete verbose="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="." includes="**/*Index.html"/> <fileset dir="." includes="**/index.html" excludes="javadoc/**/*"/> <fileset dir="." includes="**/viewpointSlideshow.html"/> <fileset dir="." includes="**/_schematron/*"/> <fileset dir="." includes="**/_pages/*.html"/><!-- older versions --> </delete> - <delete dir="**/_pages" verbose="true"/><!-- older versions --> - <delete dir="**/_svg" verbose="true"/><!-- older versions --> + <delete failonerror="false" includeemptydirs="true"><!-- older versions --> + <fileset dir="**/_pages"/> + <fileset dir="**/_svg"/> + </delete> </target> <target name="clean.media" description="clean out large files (warning, this included necessary files for scene operation)"> <echo message="clean/delete sound, image and movie files"/> - <delete verbose="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="." includes="**/*.wav"/> <fileset dir="." includes="**/*.gif"/> <fileset dir="." includes="**/*.jpg"/> @@ -596,7 +598,7 @@ Key references: <target name="clean.backups" description="clean out unnecessary backup files (only)"> <echo message="clean/delete backup files for project ${archive.name}"/> - <delete verbose="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="." includes="**/_new_pretty_print.html"/> <fileset dir="." includes="**/_new_result.wrl"/> <fileset dir="." includes="**/_new_result.x3db"/> @@ -824,7 +826,7 @@ Key references: <target name="clean.x3db" description="clean out autogenerated *.x3db files"> <echo message="clean/delete autogenerated files matching *.x3d scenes: *.x3db"/> - <delete verbose="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="." includes="**/*.x3db"/> </delete> </target> @@ -862,7 +864,7 @@ Key references: <target name="clean.Canonical.xml" description="clean out autogenerated *Canonical.xml files (only)"> <echo message="clean/delete autogenerated *Canonical.xml files"/> - <delete verbose="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="." includes="**/*Canonical.xml"/> </delete> </target> @@ -870,14 +872,14 @@ Key references: <target name="clean.SVG" description="clean out autogenerated *.svg files (only)"> <!-- SVG crossSection images are generated along with html pretty-print pages for each scene --> <echo message="clean/delete autogenerated files matching *.x3d scenes: _svg/*.svg"/> - <delete verbose="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="." includes="**/_svg/*.svg"/> </delete> </target> <target name="clean.schematron" description="clean out autogenerated schematron validation files (only)"> <echo message="clean/delete autogenerated files matching *.x3d scenes: _schematron/*"/> - <delete verbose="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="."> <include name="_schematron/*"/> <include name="*/_schematron/*"/> @@ -888,12 +890,12 @@ Key references: <target name="clean.slideshowTools" description="clean out downloaded slideshow tools"> <echo message="clean out downloaded slideshow tools"/> - <delete verbose="true" dir="slideshow"/> + <delete verbose="true" dir="slideshow" includeemptydirs="true" failonerror="false"/> </target> <target name="clean.viewpointImages" description="clean out autogenerated viewpoint image files (only)"> <echo message="clean/delete autogenerated viewpoint image files"/> - <delete verbose="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="."> <include name="*/_viewpoints/*.png"/> <include name="*/*/_viewpoints/*.png"/> @@ -904,7 +906,7 @@ Key references: <target name="clean.thumbnailImages" description="clean out autogenerated thumbnail image files (only)"> <echo message="clean/delete autogenerated thumbnail image files"/> - <delete verbose="true" includeemptydirs="true"> + <delete failonerror="false" includeemptydirs="true" verbose="true"> <fileset dir="."> <include name="**/*Thumbnail.png"/> <!-- TODO why isn't this working ? --> @@ -964,7 +966,7 @@ and <target name="clean.jenkins" description="clean files downloaded by jenkins.prepare"> <echo message="clean/delete directory and files downloaded by jenkins.prepare"/> - <delete dir="jenkins" failonerror="false" verbose="true"/> + <delete dir="jenkins" failonerror="false" includeemptydirs="true" verbose="true"/> <!-- make library directories for supporting jar files --> <mkdir dir="jenkins/lib"/> </target> @@ -1681,6 +1683,20 @@ ignoreSetupDownloadErrors=true <arg value="../../../../specifications/x3d-3.3-JSONSchema.json"/> <arg value="HelloWorld.json"/> </java> + <echo>HelloWorld.java creation with X3dToJava.xslt</echo> + <!-- JavaScript Object Notation (JSON) --> + <Saxon9 scene="HelloWorld" + stylesheet="${stylesheet.dir}/X3dToJava" + extension="java" + expand="on"/> + <!-- expand:on since DTD defaults needed --> + <echo>HelloWorld.py creation with X3dToPython.xslt</echo> + <!-- JavaScript Object Notation (JSON) --> + <Saxon9 scene="HelloWorld" + stylesheet="${stylesheet.dir}/X3dToPython" + extension="py" + expand="on"/> + <!-- expand:on since DTD defaults needed --> <if> <not> @@ -1692,6 +1708,9 @@ ignoreSetupDownloadErrors=true <fileset dir="." includes="HelloWorld.x3dv"/> <fileset dir="." includes="HelloWorld.x3db"/> <fileset dir="." includes="HelloWorld.wrl"/> + <fileset dir="." includes="HelloWorld.json"/> + <fileset dir="." includes="HelloWorld.java"/> + <fileset dir="." includes="HelloWorld.py"/> <fileset dir="." includes="HelloWorld.html"/> <fileset dir="." includes="HelloWorldX_ITE.html"/> <fileset dir="." includes="HelloWorldX3dom.xhtml"/> @@ -1818,6 +1837,20 @@ ignoreSetupDownloadErrors=true <arg value="../../../../specifications/x3d-3.3-JSONSchema.json"/> <arg value="newScene.json"/> </java> + <echo>newScene.java creation with X3dToJava.xslt</echo> + <!-- JavaScript Object Notation (JSON) --> + <Saxon9 scene="newScene" + stylesheet="${stylesheet.dir}/X3dToJava" + extension="java" + expand="on"/> + <!-- expand:on since DTD defaults needed --> + <echo>newScene.py creation with X3dToPython.xslt</echo> + <!-- JavaScript Object Notation (JSON) --> + <Saxon9 scene="newScene" + stylesheet="${stylesheet.dir}/X3dToPython" + extension="py" + expand="on"/> + <!-- expand:on since DTD defaults needed --> <if> <not> @@ -1830,6 +1863,9 @@ ignoreSetupDownloadErrors=true <fileset dir="." includes="newScene.x3db"/> <fileset dir="." includes="newScene.wrl"/> <fileset dir="." includes="newScene.html"/> + <fileset dir="." includes="newScene.json"/> + <fileset dir="." includes="newScene.java"/> + <fileset dir="." includes="newScene.py"/> <fileset dir="." includes="newSceneX_ITE.html"/> <fileset dir="." includes="newSceneX3dom.xhtml"/> <fileset dir="." includes="newSceneCanonical.xml"/> @@ -3940,6 +3976,9 @@ app.replica.args=-mode scene -mipmaps -antialias 8 -anisotropicDegree 16 -verbos <exclude name="Tools/Terrain/GeoManager.*"/> <!-- SavageDefense --> <exclude name="qrcode/**/*.*"/> + <!-- http://ant.apache.org/manual/Tasks/javac.html#bootstrap --> + <!-- https://stackoverflow.com/questions/4134803/ant-passing-compilerarg-into-javac --> + <compilerarg value="-Xbootclasspath/p:${toString:lib.path.ref}"/> </javac> <echo message="now run and validate the java model"/> <echo message="java -classpath ${java.classes.dir};${x3djsail.stylesheets.dir}/${jsai.full.archive.jar.name} ${archive.name}.${relative.path1}.${name.short}"/> @@ -3957,12 +3996,31 @@ app.replica.args=-mode scene -mipmaps -antialias 8 -anisotropicDegree 16 -verbos </target> <target name="processScenes.python" description="generate python source, run validation test" depends="clean.RoundTrip"> + <!-- show python versions --> + <exec executable="python" dir="." vmlauncher="false"> + <arg value="--version"/> + </exec> + <echo message="pip install --user --upgrade x3d"/> + <exec executable="pip" dir="." vmlauncher="false"> + <arg value="install"/> + <arg value="--user"/> + <arg value="--upgrade"/> + <arg value="x3d"/> + </exec> + <echo message="pip show x3d"/> + <exec executable="pip" dir="." vmlauncher="false"> + <arg value="show"/><!-- verbose --> + <arg value="x3d"/> + </exec> + <property name="env.PYTHONPATH" value="${stylesheet.dir}/python"/><!-- local copy of package x3d.py --> + <echo message="PYTHONPATH=${env.PYTHONPATH}"/> + <!-- prior <echo message="$env.JAVA_HOME=${env.JAVA_HOME}"/> <echo message="$env.CLASSPATH=${env.CLASSPATH}"/> <echo message="$env.ANT_OPTS =${env.ANT_OPTS}"/> <echo message="$pyjnius.X3DautoclassPath =${pyjnius.X3DautoclassPath}"/> - <echo message="PYTHONPATH =${pyjnius.X3DautoclassPath}"/> <echo message="$pyjnius.configurationPath=${pyjnius.configurationPath}"/> + --> <echo message="Verifying Apache Ant XML Catalog resolver classpath: ${resolver.dir}/resolver.jar (${resolver.jar.length} bytes)"/> <echo message="====================="/> <for param="file.path.name"> @@ -4016,20 +4074,19 @@ app.replica.args=-mode scene -mipmaps -antialias 8 -anisotropicDegree 16 -verbos <echo message="- - - - - - - - - - -"/> --> <echo message="create python:"/> - <echo message="node xml2all.js ${archive.path}/${relative.path1}/${relative.path2}/${name.short}.x3d"/> - <exec executable="node" vmlauncher="false" timeout="300000"><!-- 5 minute timeout in case process hangs --><!-- vmlauncher switch needed for netbeans invocation --> - <arg value="${pyjnius.X3DautoclassPath}/xml2all.js"/> - <arg value="${archive.path}/${relative.path1}/${relative.path2}/${name.short}.x3d"/> - </exec> - <move file="${archive.path}/${relative.path1}/${relative.path2}/${name.short}.py" failonerror="false" quiet="true" verbose="false" - todir="${archive.path}/${relative.path1}/${relative.path2}/_archive"/> - <move file="${archive.path}/${relative.path1}/${relative.path2}/${name.short}.future.py" - tofile="${archive.path}/${relative.path1}/${relative.path2}/${name.short}.py" failonerror="false" quiet="true" verbose="true"/> - <echo>${name.short}.x3d converted to archive/${name.short}.py (verbose syntax) and ${name.short}.py (pipeline syntax)</echo> - - <!-- now run python output to validate --> - <echo message="- - - - - - - - - - -"/> - <echo message="validate python:"/> + <!-- process individual files here. show full path to facilitate user loading, editing of reported files --> + <echo>${archive.path}/${relative.path1}/${relative.path2}/${name.short}.x3d processing with X3dToPython stylesheet...</echo> + <!-- Saxon9 is locally defined macro --> + <Saxon9 scene="${relative.path1}/${relative.path2}/${name.short}" + stylesheet="${stylesheet.dir}/X3dToPython" + extension="py" + parameterPair1="insertPackagePrefix=true" + expand="on"/> + <!-- expand:on since DTD defaults needed --> + <!-- Default options: + parameterPair1="insertPackagePrefix=true" + --> + <echo>${archive.path}/${relative.path1}/${relative.path2}/${name.short}.py self-validation tests...</echo> <if> <!-- https://ant.apache.org/manual/Tasks/conditions.html --> <contains string="${name.short}" substring="{name.short}" /><!-- undefined --> @@ -4037,51 +4094,23 @@ app.replica.args=-mode scene -mipmaps -antialias 8 -anisotropicDegree 16 -verbos <echo message="filename not found"/> <!-- in order to get a filename --> </then> <else> - <!-- https://ant.apache.org/manual-1.9.x/Tasks/exec.html Examples --> - <!-- https://stackoverflow.com/questions/5607580/how-to-set-the-path-environment-variable-from-ant-script --> - <echo message="Loading archive/${name.short}.py (verbose syntax) with python, if successful then saving as archive/${name.short}_RoundTrip1.x3d version:"/> - <exec executable="python" dir="${pyjnius.X3DautoclassPath}" vmlauncher="false" timeout="300000"><!-- 5 minute timeout in case process hangs --> - <env key="Path" path="${pyjnius.configurationPath}"/> - <env key="PYTHONPATH" path="${pyjnius.X3DautoclassPath}"/> - <arg value="${archive.path}/${relative.path1}/${relative.path2}/_archive/${name.short}.py"/> - <arg value="-v"/><!-- verbose --> - </exec> - <move file="${archive.path}/${relative.path1}/${relative.path2}/${name.short}_RoundTrip.x3d" quiet="true" failonerror="false" verbose="false" - tofile="${archive.path}/${relative.path1}/${relative.path2}/_archive/${name.short}_RoundTrip1.x3d"/> - <echo message="Validating archive/${name.short}_RoundTrip1.x3d version:"/> - <!-- immutable <length property="RoundTrip1.length" file="${archive.path}/${relative.path1}/${relative.path2}/_archive/${name.short}_RoundTrip1.x3d"/> --> - <java classname="org.web3d.x3d.jsail.CommandLine" classpath="${x3djsail.stylesheets.dir}/${jsai.full.archive.jar.name};." fork="${fork}"> - <arg value="-validate"/> - <arg value="${archive.path}/${relative.path1}/${relative.path2}/_archive/${name.short}_RoundTrip1.x3d"/><!-- input model --> - </java> - <echo message="archive/${name.short}.py (verbose syntax) RoundTrip load test #1 complete"/> - <echo message="- - - - - -"/> - - <echo message="Loading ${name.short}.py (pipeline syntax) with python, if successful then saving and validating as ${name.short}_RoundTrip2.x3d version:"/> - <exec executable="python" dir="${pyjnius.X3DautoclassPath}" vmlauncher="false" timeout="300000"><!-- 5 minute timeout in case process hangs --> - <env key="Path" path="${pyjnius.configurationPath}"/> - <env key="PYTHONPATH" path="${pyjnius.X3DautoclassPath}"/> - <arg value="${archive.path}/${relative.path1}/${relative.path2}/${name.short}.py"/> - <arg value="-v"/><!-- verbose --> - </exec> - - <move file="${archive.path}/${relative.path1}/${relative.path2}/${name.short}_RoundTrip.x3d" quiet="true" failonerror="false" verbose="false" - tofile="${archive.path}/${relative.path1}/${relative.path2}/_archive${name.short}_RoundTrip2.x3d"/> - <java classname="org.web3d.x3d.jsail.CommandLine" classpath="${x3djsail.stylesheets.dir}/${jsai.full.archive.jar.name};." fork="${fork}"> - <arg value="-validate"/> - <arg value="${archive.path}/${relative.path1}/${relative.path2}/_archive${name.short}_RoundTrip2.x3d"/><!-- input model --> - </java> - <echo message="${name.short}.py (pipeline syntax) RoundTrip load test #2 complete"/> - <echo message="====================="/> + <echo message="validate python:"/> + <!--<echo message="PYTHONPATH=${stylesheet.dir}/python"/>--> + <exec executable="python" dir="." vmlauncher="false"> + <env key="PYTHONPATH" value="${env.PYTHONPATH}"/> + <arg value="${relative.path1}/${relative.path2}/${name.short}.py"/> <!-- output-doc --> + <arg value="-v"/><!-- verbose --> + </exec> </else> - </if> + </if> + <echo message="==================================="/> </sequential> </outofdate> </sequential> </for> <antcall target="echo.timestamp"/> <echo>processScenes.python complete.</echo> - <!-- <antcall target="processScenes.javadoc"/> --> + <!-- <antcall target="processScenes.javadoc"/> --> <echo message="==============================================================="/> </target> @@ -4175,7 +4204,19 @@ app.replica.args=-mode scene -mipmaps -antialias 8 -anisotropicDegree 16 -verbos <exclude name="X3dSpecifications/SAIExample*.*"/> <!-- ConformanceNist --> <exclude name="Miscellaneous/Script/**/*"/> - <!-- Savage Defense --> + <!-- Savage --> + <exclude name="services/WebServices/**/*"/> + <exclude name="CommunicationAndSensors/Sonobuoys/rra*/**/*"/> + <exclude name="CommunicationAndSensors/TSSR/CommPduGenerator.*"/> + <exclude name="Scenarios/PiracyIncidents/java/**/*"/> + <exclude name="Scenarios/TankManeuver/SRTG.*"/> + <exclude name="Tools/Slider/FloatScaler.*"/> + <exclude name="Tools/Slider/ScaledSFFloatScript.*"/> + <exclude name="Tools/Slider/SingleTypeConversionScript.*"/> + <exclude name="Tools/Slider/SliderScript.*"/> + <exclude name="Tools/Slider/widget/**/*"/> + <exclude name="Tools/Terrain/GeoManager.*"/> + <!-- SavageDefense --> <exclude name="qrcode/**/*.*"/> </fileset> </javadoc>