You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Anderson, Rob (Global Trade)" <Ro...@nike.com> on 2004/08/13 18:18:03 UTC

ant -projecthelp not working under certain conditions...

I have an issue with the use of ant -projecthelp. I have a build file that will load properties from a file based on the value of a property passed in on the command line. Here is a little build file to illustrate my point...

<project name="LPO Automation" basedir="." default="build">
<property file="${env}.properties"/>

<fail unless="env">
Please specify the environment on the command line...
        ant -Denv=environment target</fail>

<target name="build"/>
<target name="target_a"/>
<target name="target_b"/>
<target name="target_c"/>
</project>

Now with the build file above running 'ant -p' shows no output. In order to see the available targets I must run 'ant -Denv=something -p'. I would prefer that 'ant -p' work as without having to add the -Denv=something option. If that is not possible, it would be great if the fail task reported the failure so the user is not wondering why there is no output from 'ant -p'. I would like to open a change request for this issue, but I would like to get some consensus from the developers on the best way to address this issue. The two options I have come up with are:

a) Make 'ant -p' work under these conditions (preferred)
b) Make it so the fail task reports the failure

Thoughts?

Thanks,
_________________________________________________________________
Robert Anderson  Sr. System Engineer  Nike - Global Trade IT  (503) 532-6803  d

"Outside of a dog, a book is probably man's best
friend; inside of dog, it's too dark to read." -Groucho Marx



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


Re: ant -projecthelp not working under certain conditions...

Posted by Dale Anson <da...@germane-software.com>.
Rob,

Also look at bug 27722. There are other issues with -projecthelp, it 
might be good to roll them all up together.

Dale


Anderson, Rob (Global Trade) wrote:

> I have an issue with the use of ant -projecthelp. I have a build file that will load properties from a file based on the value of a property passed in on the command line. Here is a little build file to illustrate my point...
> 
> <project name="LPO Automation" basedir="." default="build">
> <property file="${env}.properties"/>
> 
> <fail unless="env">
> Please specify the environment on the command line...
>         ant -Denv=environment target</fail>
> 
> <target name="build"/>
> <target name="target_a"/>
> <target name="target_b"/>
> <target name="target_c"/>
> </project>
> 
> Now with the build file above running 'ant -p' shows no output. In order to see the available targets I must run 'ant -Denv=something -p'. I would prefer that 'ant -p' work as without having to add the -Denv=something option. If that is not possible, it would be great if the fail task reported the failure so the user is not wondering why there is no output from 'ant -p'. I would like to open a change request for this issue, but I would like to get some consensus from the developers on the best way to address this issue. The two options I have come up with are:
> 
> a) Make 'ant -p' work under these conditions (preferred)
> b) Make it so the fail task reports the failure
> 
> Thoughts?
> 
> Thanks,
> _________________________________________________________________
> Robert Anderson  Sr. System Engineer  Nike - Global Trade IT  (503) 532-6803  d
> 
> "Outside of a dog, a book is probably man's best
> friend; inside of dog, it's too dark to read." -Groucho Marx
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 

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


Re: ant -projecthelp not working under certain conditions...

Posted by Matt Benson <gu...@yahoo.com>.
Rob:  Are you using Ant 1.6.2?  In that version the
<fail> output should show up.

-Matt

--- "Anderson, Rob (Global Trade)"
<Ro...@nike.com> wrote:

> I have an issue with the use of ant -projecthelp. I
> have a build file that will load properties from a
> file based on the value of a property passed in on
> the command line. Here is a little build file to
> illustrate my point...
> 
> <project name="LPO Automation" basedir="."
> default="build">
> <property file="${env}.properties"/>
> 
> <fail unless="env">
> Please specify the environment on the command
> line...
>         ant -Denv=environment target</fail>
> 
> <target name="build"/>
> <target name="target_a"/>
> <target name="target_b"/>
> <target name="target_c"/>
> </project>
> 
> Now with the build file above running 'ant -p' shows
> no output. In order to see the available targets I
> must run 'ant -Denv=something -p'. I would prefer
> that 'ant -p' work as without having to add the
> -Denv=something option. If that is not possible, it
> would be great if the fail task reported the failure
> so the user is not wondering why there is no output
> from 'ant -p'. I would like to open a change request
> for this issue, but I would like to get some
> consensus from the developers on the best way to
> address this issue. The two options I have come up
> with are:
> 
> a) Make 'ant -p' work under these conditions
> (preferred)
> b) Make it so the fail task reports the failure
> 
> Thoughts?
> 
> Thanks,
>
_________________________________________________________________
> Robert Anderson  Sr. System Engineer  Nike - Global
> Trade IT  (503) 532-6803  d
> 
> "Outside of a dog, a book is probably man's best
> friend; inside of dog, it's too dark to read."
> -Groucho Marx
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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