- <?xml version="1.0"?>
- <project name="flex_examples" basedir="../" default="compile_modified">
- <property file="./build/build.properties" />
- <!--
- Have you edit the properties file to make sure the paths are right on your system?
- -->
- <target name="properties">
- <fail unless="asdoc.exe">The "asdoc.exe" property must be set in ${build.dir}/build.properties.</fail>
- <fail unless="compc.exe">The "compc.exe" property must be set in ${build.dir}/build.properties.</fail>
- <fail unless="mxmlc.exe">The "mxmlc.exe" property must be set in ${build.dir}/build.properties.</fail>
- </target>
- <!--
- Extension for ANT to allow for tasks like "for" and "propertyregex"
- -->
- <taskdef resource="net/sf/antcontrib/antlib.xml">
- <classpath>
- <pathelement location="libs/ant/ant-contrib.jar" />
- </classpath>
- </taskdef>
- <!--
- Generate the main applications using the library
- -->
- <target name="compile_modified" depends="properties">
- <!--
- Loop over all of the Sample applications in the mains directory,
- compile them, and place the resulting .swf next to the application
- .mxml file.
- -->
- <for param="file">
- <!-- Find the sample applications -->
- <fileset dir="${src.dir}">
- <!--
- The modified selector will only select files that have been
- modified since the mains target was last run. This means we
- can update a single main, then run the mains target and
- only the updated main will get recompiled.
- -->
- <modified/>
- <include name="**/*${application.name.flag}.mxml" />
- <!--
- For only building specific mains, comment out
- the line above, and uncomment the line below and modify
- as appropriate.
- -->
- <!--<include name="**/HorizontalAxisDataSelector_Sample.mxml" />-->
- </fileset>
- <sequential>
- <propertyregex property="mainApplicationName" override="yes" input="@{file}"
- regexp=".*\${file.separator}(.*)${application.name.flag}.mxml" replace="\1" />
- <propertyregex property="mainFolderName" override="yes" input="@{file}"
- regexp="(.*)\${file.separator}(.*)${application.name.flag}.mxml" replace="\1" />
- <exec executable="${mxmlc.exe}" dir="${basedir}">
- <arg line="'@{file}'" />
- <arg line="-o '${mainFolderName}/${mainApplicationName}${application.name.flag}.swf'" />
- <arg line="-l '${lib.dir}'" />
- <arg line="-l '${flexsdk.lib.dir}'" />
- <arg line="-sp '${src.dir}'" />
- <arg line="-optimize" />
- <arg line="-locale ${flexsdk.locale}" />
- <arg line="-l '${flexsdk.locale.dir}'" />
- </exec>
- </sequential>
- </for>
- </target>
- <!--
- Generate ASDoc output for the library
- -->
- <target name="docs" depends="properties">
- <!-- Clean out the contents of the doc directory, without deleting "docs" -->
- <delete includeemptydirs="true">
- <fileset dir="${docs.dir}" includes="**/*" />
- </delete>
- <exec executable="${asdoc.exe}" spawn="no">
- <!-- Place the documentation in the "docs" directory -->
- <arg line="-o '${docs.dir}'" />
- <!-- Specify the main source path as "src" -->
- <arg line="-sp '${src.dir}'" />
- <!-- Document all of the classes in the "src" tree -->
- <arg line="-ds '${src.dir}' " />
- <!-- Include the library name in the window title -->
- <arg line="-window-title '${library.name}' "/>
- <arg line="-templates-path '${flexsdk.templates.dir}' "/>
- </exec>
- </target>
- </project>
相关文章: