If you’re reading this, you’re likely aware that Adobe has released ANT tasks for compiling SWFs, module SWFs, and SWCs. My application has lots of modules and also uses an ANT build, so naturally, I wanted to speed up compile times.

My development laptop has a dual-core CPU and I noticed that one core was unused while running my ANT script. In order to speed up my compile times, I simply added <parallel> tags around compiling my modules. My main swf needs to be compiled first because I need to use its link report for building the other modules. I also had to make sure to set the threadCount property to 2 so it wouldn’t overload my machine trying to compile all the modules at once.

<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="NitroAdminFlex"  basedir="." default="AIR">
<property name="version.major" value="6"/>
<property name="version.minor" value="0"/>
<property name="version.revision" value="0"/>
<property name="OPTIMIZE" value="true"/>
<property name="DEBUG" value="false"/>
<property name="FLEX_HOME" value="C:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.2.0"/>
<property name="flex.mxmlc" location="${FLEX_HOME}/bin/mxmlc.exe" />
<property name="src.dir" value="."/>
<property name="lib.dir" value="../libs"/>
<property name="out.dir" value="../bin-release"/>
<property name="jars.dir" value="../../jars-server"/>

    <taskdef name="nitrolm-encrypt" classname="com.simplifiedlogic.nitrolm.LMEncryptAsset" classpath="${jars.dir}/AssetEncrypterX.jar"/>
    <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>

    <target name="clean" description="Clean the project">
        <delete dir="${out.dir}" failonerror="false"/>
    </target>

    <target name="init" description="initialize the project" depends="clean">
        <mkdir dir="${out.dir}"/>
        <copy todir="${out.dir}" includeemptydirs="false">
            <fileset dir="${basedir}">
                <exclude name="**/*.as"/>
                <exclude name="**/*.mxml"/>
                <exclude name="**/*.xml"/>
                <exclude name="**/*.css"/>
                <exclude name="**/*.properties"/>
                <exclude name="**/*.ser"/>
                <exclude name="**/*.vser"/>
                <exclude name="**/*.pfx"/>
                <exclude name="**/*.txt"/>
                <exclude name="**/*.cmd"/>
                <include name="**/*"/>
            </fileset>
        </copy>
    </target>

    <target name="compile.release" description="Compile swf modules and main swf" depends="init">
        <!-- compile main SWF -->
        <mxmlc file="NitroAdminFlex.mxml" output="${out.dir}/NitroAdminFlex.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            link-report="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>
<parallel threadCount="2">
        <!-- compile modules -->
        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/nav/MainWindowNavigator.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/nav/MainWindowNavigator.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/DefineVariablesModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/DefineVariablesModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/NotificationsModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/NotificationsModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/MessagingModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/MessagingModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ManageLicensesModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ManageLicensesModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/UsersModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/UsersModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ManageVariablesModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ManageVariablesModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowUnconfirmedModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowUnconfirmedModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowPaidToModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowPaidToModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowDemosModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowDemosModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowLicensesModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowLicensesModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowMsgHistModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowMsgHistModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowSupportModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowSupportModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowUserFilesModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowUserFilesModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/AddEditProductModule.mxml" output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/AddEditProductModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowReportBuilderModule.mxml"
            output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowReportBuilderModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/AddEditCompanyModule.mxml"
            output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/AddEditCompanyModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowExternalVariablesReportModule.mxml"
            output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowExternalVariablesReportModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/PoolPropertiesModule.mxml"
            output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/PoolPropertiesModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>

        <mxmlc file="com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ManageAdminToolModule.mxml"
            output="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ManageAdminToolModule.swf"
            debug="${DEBUG}"
            optimize="${OPTIMIZE}"
            load-externs="${out.dir}/report.xml"
            locale="en_US"
            allow-source-path-overlap="true"
            configname="air">

            <compiler.context-root>/NitroAdminFlex</compiler.context-root>
            <source-path path-element="${src.dir}"/>
            <source-path path-element="locale/{locale}"/>
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
                <include name="{locale}"/>
            </library-path>
<library-path dir="${lib.dir}" append="true">
                <include name="*.swc"/>
            </library-path>
<library-path dir="../../FlexUtilLibrary/bin" append="true">
                <include name="*.swc"/>
            </library-path>
        </mxmlc>
        </parallel>
    </target>

    <target name="encrypt" description="Encrypt the various swf modules" depends="compile.release">
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/DefineVariablesModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/NotificationsModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/nav/MainWindowNavigator.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/MessagingModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ManageLicensesModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/UsersModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ManageVariablesModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowUnconfirmedModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowPaidToModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowDemosModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowLicensesModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowMsgHistModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowSupportModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowUserFilesModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/AddEditProductModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowReportBuilderModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/AddEditCompanyModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ShowExternalVariablesReportModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/PoolPropertiesModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
        <nitrolm-encrypt
            filename="${out.dir}/com/simplifiedlogic/nitroadmin/cairngorm/view/screens/ManageAdminToolModule.swf"
            product="YOXxycCnrspZhEVOnhYE"
            library="LKX_BYkNwSH4yZJosmHEXooO"
            keydir="."/>
    </target>

    <target name="AIR" description="Create the AIR package for our app" depends="encrypt">
        <exec executable="${FLEX_HOME}/bin/adt.bat" failonerror="true">
            <arg line="-package"/>
            <arg line="-storetype pkcs12"/>
            <arg line="-keystore ${src.dir}/thawte_codesigning.pfx"/>
            <arg line="-storepass 5T00P1d"/>
            <arg line="${out.dir}/NitroAdmin.air"/>
            <arg line="${src.dir}/NitroAdminFlex-app.xml"/>
            <arg line="-C ${out.dir} NitroAdminFlex.swf"/>
            <arg line="-C ${out.dir} assets*"/>
            <arg line="-C ${out.dir} com*"/>
            <arg line="-C ${out.dir} org*"/>
        </exec>
    </target>
</project>

Posted by Andrew, filed under AIR, Flex, as3. Date: January 23, 2009, 4:19 pm | No Comments »

wcap_small

There currently aren’t any options for true multi-threading in Flex or AIR. Apparently, Adobe thinks that every app that exists is nothing more than a webapp that needs one or two desktop capabilities. Projects such as Merapi prove that developers greatly desire much more power than is currently being given to us. For my own application WCAP, I need to do some pretty heavy-duty computations and matrix manipulations to analyze a schematic. Right now, I’m simulating threading by breaking up the calculations into chunks and updating the UI with a progress bar between each chunk. This always uses only one of my two processor cores and ends up taking a significant amount of time because my software is crippled. I don’t use Merapi because it’s not easily deployable/updatable along with my AIR app.

It’s also not feasible for me to put the calculation logic on a server and have it calculate remotely. This software needs to be able to run out in the field or at the job site where a net connection may not be available.

I made a video (click the picture above) of my software just so folks can get a good understanding of why this is really needed and not just a want.

Posted by Andrew, filed under AIR, Flex. Date: January 15, 2009, 9:24 am | 5 Comments »

Last April, I had a blog post about how to use both the Native and Flex DragManagers at the same time by monkey-patching an AIR 1.0 application. I’ve since updated the code for AIR 1.5. This file contains the code to add to your project in order to monkey-patch the necessary DragManager-related classes. In no way do I make any claims about this code, support it, etc, etc… don’t sue me.

DualDragManagers.zip

Posted by Andrew, filed under AIR, Flex, MonkeyPatch. Date: January 10, 2009, 10:11 am | No Comments »

WCAP On Gentoo-64

WCAP On Gentoo-64

Being an uber-geek, running a standard linux distro just isn’t enough excitement for me. For my business’s server, I run Gentoo linux. I use it mostly for subversion, but I also wanted to try out some AIR apps on it. The first hurdle to overcome was that AIR is a 32-bit app and my Gentoo install is 64-bit. I needed to emerge two libraries to get the necessary 32-bit versions of them.

emerge -av emul-linux-x86-baselibs emul-linux-x86-gtklibs

I tried running the standard AIR installer for linux, but got stuck when it said that I could only install on debian based systems like Ubuntu.
To get around this, download the AIR-SDK: http://www.adobe.com/products/air/tools/sdk/

I untar’d it to AIR-SDK in my home folder.

mkdir ~/AIR-SDK<br />
cd ~/AIR-SDK<br />
tar -xvjf ~/air_1.5_sdk.tbz2

Next, I downloaded WCAP Pro and unzipped it to AIR-APPS/wcap

mkdir ~/AIR-APPS/wcap<br />
unzip WCAPPro.air -d ~/AIR-APPS/wcap

Finally, I created a desktop shortcut to run as the root user and setup my icon for it.

/home/westbam/AIR-SDK/bin/adl&nbsp;-nodebug&nbsp;/home/westbam/AIR-APPS/wcap/META-INF/AIR/application.xml&nbsp;/home/westbam/AIR-APPS/wcap/

I had tried to run it as a normal user, but the system would only work when I ran it as root. I’m not quite sure yet why it requires root access to work correctly.

Posted by Andrew, filed under AIR, Linux. Date: January 3, 2009, 12:14 pm | No Comments »