Skip to content

Instantly share code, notes, and snippets.

@iturgeon
Created July 17, 2018 23:58
Show Gist options
  • Save iturgeon/08a63f931ffa0052e2d317b315c687b5 to your computer and use it in GitHub Desktop.
Save iturgeon/08a63f931ffa0052e2d317b315c687b5 to your computer and use it in GitHub Desktop.
Flex mxml ant build script including working framework RSLs
<?xml version="1.0"?>
<!-- FROM http://soenkerohde.com/2008/04/using-the-flash-player-cache-for-the-flex-framework/ http://soenkerohde.com/flex/build.xml -->
<project name="AntExample" default="build" basedir=".">
<!-- property has to be name FLEX_HOME to work with Flex Ant Tasks -->
<property name="FLEX_HOME" value="D:/tools/moxie/sdks/3.0.0" />
<!-- this is default and redundant but you could switch to a custom flex-config.xml -->
<property name="flex.config" value="${FLEX_HOME}/frameworks/flex-config.xml" />
<property name="mxmlc.incremental" value="false" />
<property name="mxmlc.keep_generated_as" value="false" />
<property name="source.mxml" value="src/AntExample.mxml" />
<property name="deploy.dir" value="${basedir}/bin-debug" />
<property name="deploy.swf" value="${deploy.dir}/AntExample.swf" />
<property name="html.title" value="Ant Example" />
<!-- Define Flex Ant Tasks (http://labs.adobe.com/wiki/index.php/Talk:Flex_Ant_Tasks) -->
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<!-- default target builds all -->
<target name="build" depends="compile-flex, copyRSLs, generate-html" />
<!-- Compile Flex MXML Application -->
<target name="compile-flex" description="Compile MXML file to SWF application.">
<mxmlc file="${source.mxml}"
output="${deploy.swf}"
locale="en_US"
static-rsls="false"
actionscript-file-encoding="UTF-8"
incremental="${mxmlc.incremental}"
keep-generated-actionscript="${mxmlc.keep_generated_as}">
<!-- optional -->
<load-config filename="${flex.config}" />
<!-- Add source classpath -->
<source-path path-element="${basedir}/src" />
<!-- RSLs -->
<runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/framework.swc">
<url rsl-url="framework_3.0.0.477.swz" />
<url policy-file-url="" />
<url rsl-url="framework_3.0.0.477.swf" />
<url policy-file-url="" />
</runtime-shared-library-path>
<runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/datavisualization.swc">
<url rsl-url="datavisualization_3.0.0.477.swz" />
<url policy-file-url="" />
<url rsl-url="datavisualization_3.0.0.477.swf" />
<url policy-file-url="" />
</runtime-shared-library-path>
<runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/rpc.swc">
<url rsl-url="rpc_3.0.0.477.swz" />
<url policy-file-url="" />
<url rsl-url="rpc_3.0.0.477.swf" />
<url policy-file-url="" />
</runtime-shared-library-path>
</mxmlc>
</target>
<!-- Copy Flex Framework files -->
<target name="copyRSLs">
<copy todir="${deploy.dir}" overwrite="true">
<fileset dir="${FLEX_HOME}/frameworks/rsls" />
</copy>
</target>
<!-- Generate index.html to embed swf -->
<target name="generate-html" description="Generate HTML page embedding the SWF application.">
<html-wrapper title="${html.title}"
height="100%" width="100%" application="app" swf="AntExample"
version-major="9" version-minor="0" version-revision="60"
template="client-side-detection" history="true"
output="${deploy.dir}" />
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment