Skip to content

Instantly share code, notes, and snippets.

@dylanninin
Created November 12, 2013 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylanninin/7425972 to your computer and use it in GitHub Desktop.
Save dylanninin/7425972 to your computer and use it in GitHub Desktop.
Flex with Ant Task build-flex.xml for Java Web Application using Adobe Flex as frontend. Be free to use it as a template and modify at will. Reference http://ant.apache.org/, http://flex.apache.org/
<?xml version="1.0" encoding="utf-8"?>
<!-- build-flex.xml -->
<!-- 2013-11-12 dylanninin@gmail.com init -->
<project name="FLEX" default="test" basedir=".">
<!--Flex properties and targets-->
<!--Flex SDK-->
<property name="FLEX_HOME" value="D:/Flex/sdks/3.2.0" />
<property name="MXMLC.JAR" value="${FLEX_HOME}/lib/mxmlc.jar" />
<property name="ADL" value="${FLEX_HOME}/bin/adl.exe" />
<property name="ADT.JAR" value="${FLEX_HOME}/lib/adt.jar" />
<property name="FLEXTASKS.JAR" value="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<!--Flex Application -->
<property name="APP_NAME" value="FLEX" />
<property name="APP_ROOT" value="./flex_src/" />
<property name="DEPLOYEE" value="./WebRoot/bin" />
<property name="DEBUG" value="true" />
<property name="MODULES" value="${APP_ROOT}/modules" />
<property name="COMPONENTS" value="${APP_ROOT}/componets" />
<property name="VO" value="${APP_ROOT}/valueObject" />
<property name="CSS" value="${APP_ROOT}/css" />
<property name="ASSETS" value="${APP_ROOT}/assets" />
<property file=".actionScriptProperties"/>
<property name="FLEX.LIB" value="./WebRoot/WEB-INF/flex/libs"/>
<property name="SERVICES" value="./WebRoot/WEB-INF/flex/services-config.xml"/>
<!--flex_libs-->
<property name="FLEX.LIBS" value="./flex_libs"/>
<!--Flex Task -->
<taskdef resource="flexTasks.tasks" classpath="${FLEXTASKS.JAR}">
</taskdef>
<target name="flex.compile">
<mxmlc file="${APP_ROOT}/Login.mxml"
output="${DEPLOYEE}/Login.swf"
actionscript-file-encoding="UTF-8"
keep-generated-actionscript="false"
incremental="true"
locale="zh_CN,en_US"
services="${SERVICES}"
>
<compiler.context-root>./WebRoot/WEB-INF/flex</compiler.context-root>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<source-path path-element="${FLEX_HOME}/frameworks" />
<source-path path-element="locale/{locale}"/>
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
<include name="{locale}" />
</compiler.library-path>
<compiler.library-path dir="${FLEX.LIB}/" append="true">
<include name="**/*.swc" />
</compiler.library-path>
<compiler.library-path dir="${FLEX.LIBS}/" append="true">
<include name="**/*.swc" />
</compiler.library-path>
<compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>
<compiler.headless-server>true</compiler.headless-server>
</mxmlc>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment