<target name="halcyon">
<mxmlc file="halcyon_viewer.as" />
</target>
+
+ <!-- note that there's an asdoc target in Flex 4, if/when we move to that -->
+ <target name="docs" depends="manifests">
+ <exec executable="${ASDOC}" failonerror="true">
+ <arg line="-source-path ."/>
+ <arg line="-doc-sources net/systemeD/"/>
+ <arg line="-external-library-path=lib/"/>
+ <arg line="-exclude-classes ${org_classes} ${it_classes} ${hxasm_classes} ${com_classes}"/>
+ <arg line="-output resources/docs/"/>
+ <arg line="-window-title 'Halcyon and Potlatch2 Developer documentation'" />
+ <arg line="-main-title 'Halcyon and Potlatch2 Developer documentation'" />
+ <arg line="-footer 'Found an error? Help us fix it. http://wiki.openstreetmap.org/wiki/Potlatch2'"/>
+ <arg line="-package net.systemeD.controls 'Custom-built controls used in Poltatch2'" />
+ <arg line="-package net.systemeD.halcyon 'The AS3 rendering library'" />
+ <arg line="-package net.systemeD.halcyon.connection 'The connection to the main OSM server, and the entities'" />
+ <arg line="-package net.systemeD.halcyon.connection.actions 'The undoable actions that apply to OSM data'" />
+ <arg line="-package net.systemeD.halcyon.styleparser 'The logic for parsing MapCSS stylesheets'" />
+ <arg line="-package net.systemeD.potlatch2 'The OpenStreetMap editor'" />
+ <arg line="-package net.systemeD.potlatch2.collections 'Singletons for handling collections loaded from config files'" />
+ <arg line="-package net.systemeD.potlatch2.controller 'The various controller states that p2 can be in'" />
+ <arg line="-package net.systemeD.potlatch2.help 'The Help dialog'" />
+ <arg line="-package net.systemeD.potlatch2.mapfeatures 'The engine behind the mapfeatures parsing'" />
+ <arg line="-package net.systemeD.potlatch2.mapfeatures.editors 'The various widgets used in the Simple panel'" />
+ <arg line="-package net.systemeD.potlatch2.mygpx 'The dialog for loading GPX files from the server'" />
+ <arg line="-package net.systemeD.potlatch2.options 'The options dialog'" />
+ <arg line="-package net.systemeD.potlatch2.panels 'The panels for the left-hand pane of p2'" />
+ <arg line="-package net.systemeD.potlatch2.save 'The save dialog and SaveManager'" />
+ <arg line="-package net.systemeD.potlatch2.tools 'Data manipulation tools'" />
+ <arg line="-package net.systemeD.potlatch2.utils 'Data loading utilities'" />
+
+ <arg line="-left-frameset-width 300" />
+ </exec>
+ </target>
+
+ <target name="manifests">
+ <!-- Adapted from http://dreamingwell.com/articles/archives/2009/12/excluding-direc.php -->
+ <!-- Generating documentation for a class generates all the dependant documentation too. We
+ don't want to do this for certain projects like org.vanrijkom etc (.swc files are
+ automatically ignored). Unfortunately asdoc only has options for excluding particular
+ classes, and there's lots of them - so this stuff autogenerates the class lists that
+ we want to ignore. -->
+
+ <fileset id="com_sources" dir="${basedir}/com/" />
+ <!-- convert the names of excluded classes to packages with class names -->
+ <pathconvert property="com_classes" pathsep=" " refid="com_sources">
+ <chainedmapper>
+ <globmapper from="${basedir}/*" to="*"/>
+ <mapper type="package" from="*.as" to="*"/>
+ </chainedmapper>
+ </pathconvert>
+
+ <!-- Get the list of all files in the org directory -->
+ <fileset id="org_sources" dir="${basedir}/org/" />
+ <!-- convert the names of excluded classes to packages with class names -->
+ <pathconvert property="org_classes" pathsep=" " refid="org_sources">
+ <chainedmapper>
+ <globmapper from="${basedir}/*" to="*"/>
+ <mapper type="package" from="*.as" to="*"/>
+ </chainedmapper>
+ </pathconvert>
+
+ <fileset id="it_sources" dir="${basedir}/it/" />
+ <!-- convert the names of excluded classes to packages with class names -->
+ <pathconvert property="it_classes" pathsep=" " refid="it_sources">
+ <chainedmapper>
+ <globmapper from="${basedir}/*" to="*"/>
+ <mapper type="package" from="*.as" to="*"/>
+ </chainedmapper>
+ </pathconvert>
+
+ <fileset id="hxasm_sources" dir="${basedir}/hxasm/" />
+ <!-- convert the names of excluded classes to packages with class names -->
+ <pathconvert property="hxasm_classes" pathsep=" " refid="hxasm_sources">
+ <chainedmapper>
+ <globmapper from="${basedir}/*" to="*"/>
+ <mapper type="package" from="*.as" to="*"/>
+ </chainedmapper>
+ </pathconvert>
+
+ <!-- if we end up with third-party stuff in the net/ folder, then do something like this -->
+ <!-- <fileset id="net_sources" dir="${basedir}/net/">
+ <exclude name="**net.systemeD**"/>
+ </fileset> -->
+
+ <!-- echo the exlcusions for debugging purposes -->
+ <!--<echo message="manifests = ${org_classes} ${it_classes} ${hxasm_classes}"/>-->
+ </target>
+
+ <!-- ======================================= -->
+ <!-- Unit Test Targets -->
+ <!-- ======================================= -->
+
+ <target name="compileTestRunner" depends="init" description="Compiles the test runner application.">
+
+ <!-- Compile TestRunner MXML as a SWF -->
+ <mxmlc file="${test.src.dir}/${test.application.name}.mxml"
+ output="${test.bin.dir}/${test.application.name}.swf">
+
+ <!--<load-config filename="${FLEX_HOME}/frameworks/air-config.xml" />-->
+
+ <!-- we need to supply source paths for the real source and the test source. But passing
+ the potlatch2 top-level directory causes a problem since that also contains the test source.
+ We could move every source folder (net, org, it and hxasm) into a src/ folder, or alternatively
+ set up a fake root folder in the test folder with symlinks to the four directories concerned.
+ It's a bodge, but it works. -->
+ <source-path path-element="${test.fakeroot.dir}" />
+ <source-path path-element="${test.src.dir}" />
+
+ <!-- The TestRunner needs the flexunit libraries in the build/libs folder -->
+ <library-path dir="${LIBS_DIR}" append="true">
+ <include name="*.swc" />
+ </library-path>
+
+
+ <!-- Sets java.awt.headless=true so font compilation works in headless environments -->
+ <compiler.headless-server>true</compiler.headless-server>
+ </mxmlc>
+
+ <echo message="The ${test.application.name}.swf test runner has been created in ${test.bin.dir}" />
+ </target>
+
+ <target name="runTestsAndReport" depends="init" description="Launches the test runner, captures results, generates test report artifacts.">
+
+ <mkdir dir="${report.dir}" />
+ <mkdir dir="${report.html.dir}" />
+
+ <!-- Run FlexUnit Ant Task to execute the unit tests and capture reporting data -->
+ <!-- on linux, make sure that gflashplayer is in your PATH and launches a standalone flashplayer binary -->
+ <taskdef resource="flexUnitTasks.tasks" classpath="${LIBS_DIR}/flexUnitTasks-4.1.0_RC2-28.jar" />
+ <flexunit swf="${test.bin.dir}/${test.application.name}.swf" toDir="${report.dir}"
+ haltonfailure="false" verbose="false" localTrusted="true" player="flash" />
+
+ <!-- Generate html JUnit-style reports based on test results -->
+ <junitreport todir="${report.dir}">
+ <fileset dir="${report.dir}">
+ <include name="TEST-*.xml" />
+ </fileset>
+ <report format="frames" todir="${report.html.dir}" />
+ </junitreport>
+
+ <echo message="The unit test reports have been created in ${report.dir}" />
+ </target>
+
+ <target name="test" depends="init, compileTestRunner, runTestsAndReport" description="Compiles unit tests and generates test report artifacts." />
+
</project>