Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6717301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:50:08+00:00 2026-05-26T08:50:08+00:00

How can I build an Ant script to output swfs vs air packages, and

  • 0

How can I build an Ant script to output swfs vs air packages, and to use different classes during the compilation based on my desired destination?

For example I am building an app that will be for the web, mobile and desktop. In some cases my classes will use AIR only components. I want to be able to create ANT build scripts that will not include those classes when outputting a swf for the web. How do I go about doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:50:09+00:00Added an answer on May 26, 2026 at 8:50 am

    Here’s what I did for a similar situation:

    <target name="define.compile.task" depends="initflex">
        <presetdef name="flex.build">
            <mxmlc file="${src.dir}/${src.file.path}" 
                    output="${output.dir}/${output.file.path}" ...>
                <compiler.source-path path-element="${src.dir}"/>
                ...
            </mxmlc>
        </presetdef>
    </target>
    
    <target name="parametrized.web.build" depends="define.compile.task">
        <flex.build>
            <compiler.define name="CONFIG::AllowAirComponents" value="false" />
        </flex.build>   
    </target>
    
    
    <target name="parametrized.air.build" depends="define.compile.task">
        <flex.build configname="airmobile">
            <compiler.define name="CONFIG::AllowAirComponents" value="true" />
        </flex.build>   
    </target>
    

    Then, I could define targets like

    <target name="buildwebclass1">
         <antcall target="parametrized.web.build">
              <param name="src.file.path" value="path/to/MyClass.as"/>
              <param name="output.file.path" value="MyClass.swf"/>
         </antcall>
    </target>
    

    Or:

    <target name="buildairclass1">
         <antcall target="parametrized.air.build">
              <param name="src.file.path" value="path/to/MyAirClass.as"/>
              <param name="output.file.path" value="MyAirClass.swf"/>
         </antcall>
         <exec executable="${FLEX_HOME}/bin/adt" failonerror="true">
             ... (adt arguments)
         </exec>
    </target>
    

    And if I have some factory of common code that instantiates the air class only if necessary, I wrap it with a CONFIG::AllowAirComponents { ... } so my AIR specific classes wouldn’t interfere with the web build.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I check for root privileges with an Ant build script? I tried
In an ant build script, how can I delete all *.java files in one
How can I lookup the latest git commit hash from an ant build script?
When you define an extension-point in an Ant build file you can have it
I inherited an existing Ant build script. It invokes javac three times on three
The ANT build script I have does the following: Perform the builds on Windows
I have the following ant script that I can't seem to find a way
I have some automatically generated Ant build scripts that I need to use to
When i am running my ANT build script, Cobertura is complaining with the following
I'm currently in the process of replacing my homebrewn build script by an Ant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.