2xMax
2xMax

Reputation: 1772

Flex Ant compile project

i want to use Ant task to compile flex project(with many libraries, modules)

i use -dump-config build.xml compiler option in flash builder to extract build config

after i create this Ant task(for start, i try to compile only one mxml-module) :

<project name="My App Builderrrr" basedir="." default="main">

<property name="QA_PM_DEST" value="[my project dir]\src"/>
<property name="BIN_DEBUG" value="[my project dir]\bin-debug"/>
<property name="FLEX_HOME" value="C:/Program Files/Adobe/Adobe Flash Builder 4/sdks/4.0.0"/>
<property name="APP_ROOT" value="src"/>
<property name="DEPLOY_DIR" value="c:\output"/>


<taskdef resource="flexTasks.tasks" classpath="${basedir}/libs/flexTasks.jar"/>

<target name="main">

     <mxmlc  file="${QA_PM_DEST}/***.mxml"
        output="${DEPLOY_DIR}/***.swf">
         <load-config filename="***\build.xml"/>

     </mxmlc>


</target>

and after

ant -buldfile mybuildfile.xml

but it generates very small swf file that runs with errors(67kb insted of 300kb in release build and 800kb in debug)

Upvotes: 2

Views: 1891

Answers (1)

hering
hering

Reputation: 1954

I think you need to load the following config, too:

<property name="flex.config" value="${FLEX_HOME}/frameworks/flex-config.xml"/>
<load-config filename="${flex.config}" />

(UPDATE 2010-08-19)

I also add incremental="false" to my mxmlc call and the libraries this way:

<library-path dir="${lib.dir}" append="true">
    <include name="**.swc" />
</library-path> 

An the following is also missing in your file:

<source-path path-element="${src.dir}"/>

Upvotes: 2

Related Questions