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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:55:17+00:00 2026-06-05T08:55:17+00:00

I have a task like: <target name=someTarget> <concat destfile=someFile> <string>someString</string> <string>someOtherString</string> </concat> </target> <target

  • 0

I have a task like:

<target name="someTarget">
    <concat destfile="someFile">
        <string>someString</string>

        <string>someOtherString</string>
    </concat>
</target>

<target name="someOtherTarget">
    <antcall target="someTarget">
        <param name="myParam" value="myValue"></param>
    </antcall>

    <antcall target="someTarget">
    </antcall>
</target>

How can I concatenate the someOtherString only if myParam was supplied when calling the someTarget target?

  • 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-06-05T08:55:18+00:00Added an answer on June 5, 2026 at 8:55 am

    Without Ant extensions, just use conditional Ant execution:

    <project default="someOtherTarget">
        <target name="someTarget" depends="-someString,-someOtherString"/>
    
        <target name="-someString" unless="myParam">
            <concat destfile="someFile">
                <string>someString</string>
            </concat>
        </target>
    
        <target name="-someOtherString" if="myParam">
            <concat destfile="someOtherFile">
                <string>someString</string>
                <string>someOtherString</string>
            </concat>
        </target>
    
        <target name="someOtherTarget">
            <antcall target="someTarget">
                <param name="myParam" value="myValue"></param>
            </antcall>
            <antcall target="someTarget"/>
        </target>
    </project>
    

    If you don’t mind adding Ant extensions to your project, check out Ant-Contrib‘s If task.

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

Sidebar

Related Questions

I have an ant task set up like so: <target name=unit-test description=unit tests depends=compile-tests>
I have a task like this... def self.perform(parsed_json) do_hard_work use_faye_to_push_status rescue => exception use_faye_to_push_error
I have a process intensive task that I would like to run in the
I would like to have this behavior in a task history stack: First task
I have an asynchronously running Task that fires an event when it's completed like
So I have a rake file like the following: require 'fileutils' task :copy do
I have several long-running Task objects. I'd like them all to just keep running
I have a computationally expensive task in perl, and would like to inform the
We have a SharePoint solution that uses a standard task list. We would like
I am trying task using WCFDataServices. I have a Service operation Like [WebInvoke(Method=POST)] Public

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.