Skip to content

Commit

Permalink
Create build.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph authored Dec 27, 2024
1 parent 5b2e734 commit ad7baf1
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions etc/build/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0"?>
<project basedir="." default="all">

<property file="build.properties.local" />
<property file="build.properties" />
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask" classpath="${jscompiler}" />

<target name="merge">
<concat destfile="${basedir}/../../build/shapes.js" fixlastline="yes" append="no">
<fileset dir="${war.dir}/shapes" includes="**/*.js"/>
<fileset dir="${war.dir}/stencils" includes="**/*.js"/>
</concat>

<java fork="false" classname="Xml2Js" classpath=".">
<arg value="../../src/main/webapp/stencils"/>
<arg value="../../src/main/webapp/js/stencils.min.js"/>
</java>

<jscomp compilationLevel="simple" debug="false" forceRecompile="true" output="${war.dir}/js/shapes-14-6-5.min.js">
<sources dir="${basedir}/../../build">
<file name="shapes.js" />
</sources>
</jscomp>

<tstamp>
<format property="time.stamp" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
</tstamp>

<delete dir="${basedir}/../../build"/>
</target>

<target name="app" depends="merge">
</target>

<target name="atlas" depends="app">
<concat destfile="${war.dir}/js/atlas-viewer.min.js" fixlastline="yes" append="no">
<file name="${basedir}/base-viewer.min.js" />
<file name="${war.dir}/js/orgchart.min.js" />
</concat>

<jscomp compilationLevel="simple" debug="false" forceRecompile="true" output="${basedir}/.tmp0.js">
<sources dir="${war.dir}/connect/common/js">
<file name="mxReader.js" />
</sources>
</jscomp>

<concat destfile="${war.dir}/js/atlas.min.js" fixlastline="yes" append="no">
<file name="${basedir}/base.min.js" />
<file name="${war.dir}/js/extensions.min.js" />
<file name="${basedir}/.tmp0.js" />
</concat>

<delete file="${basedir}/.tmp0.js"/>
</target>

<target name="integrate" depends="atlas">
<copy file="${war.dir}/js/atlas.min.js" tofile="${war.dir}/js/integrate.min.js" overwrite="true"/>

<jscomp compilationLevel="simple" debug="false" forceRecompile="true" output="${basedir}/.tmp0.js">
<sources dir="${basedir}/../integrate">
<file name="Integrate.js" />
</sources>
</jscomp>

<concat destfile="${war.dir}/js/integrate.min.js" fixlastline="yes" append="yes">
<file name="${war.dir}/js/shapes-14-6-5.min.js" />
<file name="${war.dir}/js/stencils.min.js" />
<file name="${basedir}/.tmp0.js" />
</concat>

<delete file="${basedir}/.tmp0.js"/>
</target>

<target name="all" depends="integrate">
<delete file="${war.dir}/js/atlas-viewer.min.js"/>
<delete file="${war.dir}/js/atlas.min.js"/>
</target>

<!-- ================== Stand-alone war creation ============================= -->

<path id="javac.class.path">
<fileset dir="${war.dir}/WEB-INF/lib" />
</path>

<target name="javac" description="Java compilation">
<mkdir dir="${javac.dir}"/>
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${javac.dir}">
<classpath refid="javac.class.path" />
</javac>
<copy todir="${javac.dir}" file="${src.dir}/log4j.properties" />
</target>

<target name="clean" description="Cleans build directories">
<delete dir="${javac.dir}"/>
<delete dir="${build.dir}"/>
<delete file="${basedir}/base.min.js"/>
<delete file="${basedir}/base-viewer.min.js"/>
</target>

<target name="war" depends="app, javac" description="Create the stand-alone war file">
<zip destfile="${build.dir}/${war.name}" basedir="${war.dir}" >
</zip>
</target>

</project>

0 comments on commit ad7baf1

Please sign in to comment.