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 563861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:42:17+00:00 2026-05-13T12:42:17+00:00

I have been struggling trying to figure out how to conditionally include Flex libraries

  • 0

I have been struggling trying to figure out how to conditionally include Flex libraries in an ant build based on a property that is set on the command line. I have tried a number of approaches with the <condition/> task, but so far have not gotten it to work. Here is where I am currently.

I have an init target that includes condition tasks like this:

 <condition property="automation.libs" value="automation.qtp">
  <equals arg1="${automation}" arg2="qtp" casesensitive="false" trim="true"/>
 </condition>

The purpose of this task is to set a property that determines the name of the patternset to be used when declaring the implicit fileset on a mxmlc or compc task. The pattern set referenced above is defined as:

 <patternset id="automation.qtp">
  <include name="automation*.swc"/>
  <include name="qtp.swc"/>
 </patternset>

The named patternset is then referenced by the mxmlc or compc task like this:

<compc>
 <compiler.include-libraries dir="${FLEX_HOME}/frameworks/libs" append="true">
  <patternset refid="${automation.libs}"/>
 </compiler.include-libraries>
</compc>

This doesn’t appear to work. At least the SWC size does not indicate that the additional automation libraries have been compiled in. I want to be able to specify a command line property that determine which patternset to use for various types of builds.

Does anyone have any ideas about how to accomplish this? Thanks!

  • 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-13T12:42:17+00:00Added an answer on May 13, 2026 at 12:42 pm

    If you can’t get <patternset> to work correctly, you might want to take a look at the <if> <then> and <else> tasks provided by ant-contrib. We ended up doing something like this:

    <target name = "build">
        <if>
            <equals arg1="automation.qtp" arg2="true"/>
            <then>
                <!--
                   - Build with QTP support.
                   -->
            </then>
            <else>
                <!--
                   - Build without QTP support.
                   -->
            </else>
        </if>
    </target>
    

    There is some duplication of build logic between the if and else branch, but you can factor some of that out if you wrap <mxmlc> with a macrodef.

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

Sidebar

Related Questions

I have been struggling for a few days trying to find out how come
I've been struggling for a week now trying to figure out how to generate
I've been struggling for several hours trying to figure out how to get this
I have been trying to create a notification window, but I'm struggling to figure
I have been struggling all afternoon trying to get a simple mailto: tag to
Have been struggling all day trying to make this simple example work using socket.io.
I have been struggling for days trying to find the proper way to implement
So I have been struggling for days now, trying to simply create a new
i have been struggling getting this to work for 2 weeks, I am trying
I've been trying to figure this out all evening but to no avail. I

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.