You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Shweta Bodade <sb...@businessobjects.com> on 2006/03/07 13:08:40 UTC

And I want to input two args at a time through console

Can I have multiple choices for deploying target 

 

I mean if an input message is given on selecting between three choices
and I want to execute two of them one after the other 

How can I do that 

 

For eg

<input message=-"Select between 1. TOMCAT 2. WEBSPHERE 3.WEBLOGIC"

Validargs="1,2,3">

 

 

And I want to input two args at a time through console

 

Can you hlep me with some examples.


Re: And I want to input two args at a time through console

Posted by Rhino <rh...@sympatico.ca>.
This example is quite similar to what you want to do. It offers the user a 
choice of where to upload some files; the user can choose server Alpha as 
the target of the upload, or server Beta, or both.

The upload target depends on the getserver task so the getserver task 
executes first. The getserver task asks the user which target(s) the user 
wants and sets the value of the property  'servername' accordingly. Then, 
the antcall task within the upload target executes the appropriate target: 
upload-Alpha, upload-Beta, or upload-Both. To keep the example simple, the 
upload-Alpha and upload-Beta targets only display a short message to prove 
that they have been invoked but you could have many complex tasks within 
each of those targets. The upload-Both target is even simpler; it uses a 
depends parameter to invoke upload-Alpha and upload-Beta.

--------------------------------------------------------------------------------------------------
<?xml version="1.0" ?><project name="Foo" default="upload" basedir=".">

<description>Let the user choose one or more options from a list.

</description>


<!--==================================================================

Determine which server is the target.

==================================================================-->

<target name="getserver" description="Determine which server is the target">

<input message="Which server should receive the files? 1. Alpha 2. Beta 3. 
Both"

validargs="1,2,3"

addproperty="server.choice"

defaultvalue="2"/>

<condition property="servername" value="Alpha">

<equals arg1="${server.choice}" arg2="1"/>

</condition>

<condition property="servername" value="Beta">

<equals arg1="${server.choice}" arg2="2"/>

</condition>

<condition property="servername" value="Both">

<equals arg1="${server.choice}" arg2="3"/>

</condition>

</target>

<!--==================================================================

Execute the appropriate upload target, depending on which server

was chosen.

==================================================================-->

<target name="upload" depends="getserver" description="Upload to the 
selected server.">

<antcall target="upload-${servername}"/>

</target>

<!--==================================================================

Upload to the Alpha server.

==================================================================-->

<target name="upload-Alpha" description="Upload to the Alpha server.">

<echo message="Uploading to Alpha...."/>

</target>

<!--==================================================================

Upload to the Beta server.

==================================================================-->

<target name="upload-Beta" description="Upload to the Beta server.">

<echo message="Uploading to Beta...."/>

</target>

<!--==================================================================

Upload to both servers.

==================================================================-->

<target name="upload-Both" depends="upload-Alpha,upload-Beta" 
description="Upload to both servers.">

</target>


</project>

--------------------------------------------------------------------------------------------------

--
Rhino

----- Original Message ----- 
From: "Shweta Bodade" <sb...@businessobjects.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Tuesday, March 07, 2006 7:08 AM
Subject: And I want to input two args at a time through console


Can I have multiple choices for deploying target



I mean if an input message is given on selecting between three choices
and I want to execute two of them one after the other

How can I do that



For eg

<input message=-"Select between 1. TOMCAT 2. WEBSPHERE 3.WEBLOGIC"

Validargs="1,2,3">





And I want to input two args at a time through console



Can you hlep me with some examples.




--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 10/03/2006



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 10/03/2006


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: And I want to input two args at a time through console

Posted by Patrick Martin <an...@gmail.com>.
Hello,

You can also use <antform>[1] instead of <input>. It has a
<checkSelectionProperty> element which allows you to select multiple
elements from a list.
You can then use an ant-contrib <for> or <foreach> task to loop on the
resulting list and do what you want for each item.

Rgds,

Patrick Martin

[1] http://antforms.sourceforge.net/

On 3/12/06, Res Pons <po...@hotmail.com> wrote:
> Google and download Ant-Contrib to take advantage of the if-then-else
> feature.
>
> ----Original Message Follows----
> From: "Shweta Bodade" <sb...@businessobjects.com>
> Reply-To: "Ant Users List" <us...@ant.apache.org>
> To: "Ant Users List" <us...@ant.apache.org>
> Subject: And I want to input two args at a time through console
> Date: Tue, 7 Mar 2006 04:08:40 -0800
> MIME-Version: 1.0
> Received: from mail.apache.org ([209.237.227.199]) by
> bay0-mc3-f13.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 12
> Mar 2006 03:39:31 -0800
> Received: (qmail 7573 invoked by uid 500); 12 Mar 2006 11:39:30 -0000
> Received: (qmail 2641 invoked by uid 99); 7 Mar 2006 12:08:12 -0000
> Received: pass (asf.osuosl.org: local policy includes SPF record at
> spf.trusted-forwarder.org)
> X-Message-Info: 6sSXyD95QpUOARoNlNFckybRV/7yL8TzbucRAh8oFnY=
> Mailing-List: contact user-help@ant.apache.org; run by ezmlm
> Precedence: bulk
> List-Unsubscribe: <ma...@ant.apache.org>
> List-Help: <ma...@ant.apache.org>
> List-Post: <ma...@ant.apache.org>
> List-Id: "Ant Users List" <user.ant.apache.org>
> Delivered-To: mailing list user@ant.apache.org
> X-ASF-Spam-Status: No, hits=0.0 required=10.0tests=HTML_MESSAGE
> X-Spam-Check-By: apache.org
> X-IronPort-Anti-Spam-Filtered: true
> X-IronPort-Anti-Spam-Result: AQAAAMEADUQJgyo
> X-IronPort-AV: i="4.02,171,1139212800";    d="scan'208,217";
> a="1993970:sNHT42912051"
> X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
> Content-class: urn:content-classes:message
> X-MS-Has-Attach:
> X-MS-TNEF-Correlator:
> Thread-Topic: And I want to input two args at a time through console
> Thread-Index: AcZB397wmPoW2cgbSmuwpxpXWCyCaA==
> X-OriginalArrivalTime: 07 Mar 2006 12:06:54.0873 (UTC)
> FILETIME=[A0407890:01C641DF]
> X-Virus-Checked: Checked by ClamAV on apache.org
> Return-Path: user-return-55163-pons32=hotmail.com@ant.apache.org
>
> Can I have multiple choices for deploying target
>
>
>
> I mean if an input message is given on selecting between three choices
> and I want to execute two of them one after the other
>
> How can I do that
>
>
>
> For eg
>
> <input message=-"Select between 1. TOMCAT 2. WEBSPHERE 3.WEBLOGIC"
>
> Validargs="1,2,3">
>
>
>
>
>
> And I want to input two args at a time through console
>
>
>
> Can you hlep me with some examples.
>
> _________________________________________________________________
> On the road to retirement? Check out MSN Life Events for advice on how to
> get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: And I want to input two args at a time through console

Posted by Res Pons <po...@hotmail.com>.
Google and download Ant-Contrib to take advantage of the if-then-else 
feature.

----Original Message Follows----
From: "Shweta Bodade" <sb...@businessobjects.com>
Reply-To: "Ant Users List" <us...@ant.apache.org>
To: "Ant Users List" <us...@ant.apache.org>
Subject: And I want to input two args at a time through console
Date: Tue, 7 Mar 2006 04:08:40 -0800
MIME-Version: 1.0
Received: from mail.apache.org ([209.237.227.199]) by 
bay0-mc3-f13.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 12 
Mar 2006 03:39:31 -0800
Received: (qmail 7573 invoked by uid 500); 12 Mar 2006 11:39:30 -0000
Received: (qmail 2641 invoked by uid 99); 7 Mar 2006 12:08:12 -0000
Received: pass (asf.osuosl.org: local policy includes SPF record at 
spf.trusted-forwarder.org)
X-Message-Info: 6sSXyD95QpUOARoNlNFckybRV/7yL8TzbucRAh8oFnY=
Mailing-List: contact user-help@ant.apache.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <ma...@ant.apache.org>
List-Help: <ma...@ant.apache.org>
List-Post: <ma...@ant.apache.org>
List-Id: "Ant Users List" <user.ant.apache.org>
Delivered-To: mailing list user@ant.apache.org
X-ASF-Spam-Status: No, hits=0.0 required=10.0tests=HTML_MESSAGE
X-Spam-Check-By: apache.org
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AQAAAMEADUQJgyo
X-IronPort-AV: i="4.02,171,1139212800";    d="scan'208,217"; 
a="1993970:sNHT42912051"
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: And I want to input two args at a time through console
Thread-Index: AcZB397wmPoW2cgbSmuwpxpXWCyCaA==
X-OriginalArrivalTime: 07 Mar 2006 12:06:54.0873 (UTC) 
FILETIME=[A0407890:01C641DF]
X-Virus-Checked: Checked by ClamAV on apache.org
Return-Path: user-return-55163-pons32=hotmail.com@ant.apache.org

Can I have multiple choices for deploying target



I mean if an input message is given on selecting between three choices
and I want to execute two of them one after the other

How can I do that



For eg

<input message=-"Select between 1. TOMCAT 2. WEBSPHERE 3.WEBLOGIC"

Validargs="1,2,3">





And I want to input two args at a time through console



Can you hlep me with some examples.

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org