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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:27:15+00:00 2026-06-13T07:27:15+00:00

Other build systems, e.g. Ant, have an if/then/else construct that allows for simplifying the

  • 0

Other build systems, e.g. Ant, have an if/then/else construct that allows for simplifying the script logic in many cases. The CIFactory NAnt variant has this as well (<ifthenelse/>), but is extremely outdated and does not support .NET 4.0 – nevertheless, updating your NAnt version from CIFactory to an official build complicates your build scripts needlessly, because you now need two <if/> tasks, one with the original condition, one with negation.

Is it possible in NAnt to achieve the if/then/else flow with a single condition?

  • 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-13T07:27:16+00:00Added an answer on June 13, 2026 at 7:27 am

    In NAnt 0.92 a <choose/> task has been promoted from NAnt-contrib and allows you to achieve the if/then/else effect with only a single evaluation of the test condition. An example:

    <property name="operatingSystem"
      value="${operating-system::to-string(environment::get-operating-system())}" /> 
    <choose>
      <when test="${string::contains(operatingSystem, 'Windows')}">
        <echo message="Running on Microsoft Windows" />
      </when>
      <otherwise>
        <echo message="Are we running on Linux?" />
      </otherwise>
    </choose>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a make file that calls ant and maven build files. I've had
I have an ant build system. I have some common build files (common.xml) that
I have a master build file which is calling other build.xml files of different
I am trying to build a php class that will let me include other
I have two projects.One project is build in MVC asp.net and the other project
I've written a PowerShell script to build several .net solutions one after the other.
We have an automated build, managed by Hudson (1.312), that's got a few layers.
I'm moving my build from Ant to Gradle. Ant allows multiple reports with different
I'd like to build a C pre-processor / compiler that allows functions to be
We have an Ant and Ivy-based build management system, which basically consists of a

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.