ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject Re: AW: How to use ANT as a command shell
Date Fri, 09 Dec 2005 18:53:49 GMT
I have to admit I did not catch this thread until now, so if this is 
gibberish than do please ignore it :)

But, just reading this particular message, I have to ask, are you using 
Windows?  If so, you would make sure ant IS NOT in your path, then you 
could create a batch file to kind of "bootstrap" ant, like so:

ant -D%2% -D%3% %3%
call c:\temp\ant\ant

...with the call obviosly referencing the real ant.  Then, from a 
command line you would just do:

ant dosomething arg1=val1 arg2=val2

I know you can do the same thing from any *nix shell, I'm just not sure 
of the syntax.

Would that do the trick for you?  Again, I hope I'm not sticking my foot 
in my mouth here :)

Frank

Michael Giroux wrote:
> Thanks for all the comments.  After reading the entire thread, it seems that
> the short answer is "no", at least not at the moment.
> 
> My specific requirement could be handled if a target had visibility to the
> list of remaining targets:
> 
> ant dosomething arg1 arg2 ...
> 
> Given this command line, ant will run targets dosomething, arg1 and arg2 in
> order.  For my purposes, arg1 and arg2 are actually input to dosomething.
> This could be achieved as
> ant -Darg1=something -Darg2=somethingelse dosomething
> 
> however, the -D is more difficult to type, and most users are not expecting
> to use RPN style command lines.
> 
> As I said, I'm attempting to replace existing batch scripts, so the user
> expects to do something like
>  ant dosomething arg1 ...
> 
> If there was a task to enumerate the list of remaining targets (aka command
> line args) and another task to remove args so ant doesnt try to execute them
> as targets, then the problem would be solved.
> 
> I'll keep watching the ant project for future developments.
> 
> On 12/8/05, Matt Benson <gudnabrsam@yahoo.com> wrote:
> 
>>I haven't seen it mentioned on this thread yet, but
>>are we all aware of commons-exec in the sandbox, which
>>was ported from a 1.6.x version of Ant's code?  We had
>>this discussion before... one idea was that if Ant
>>switched over we would probably depend on
>>commons-exec, but that our build process would suck
>>down the files and include that way.  We might then
>>have to decide how to avoid conflicting with other
>>versions of the library, or whether to explicitly say,
>>Ant 1.* includes commons-exec 1.0 or whatever, or we
>>could use jarjar or if bootstrapping is an issue, roll
>>our own similar solution.
>>
>>-Matt
>>
>>--- Steve Loughran <stevel@apache.org> wrote:
>>
>>
>>>Jan.Materne@rzf.fin-nrw.de wrote:
>>>
>>>
>>>>Mmh, so we tune the ant-launcher.jar and that´s
>>>
>>>all. Other could just reuse
>>>
>>>>that jar with a different configuration?
>>>
>>>no,. nothing to do with ant-launcher.
>>>
>>>its the stuff behind Exec and Java that people want.
>>>Ant has the most
>>>debugged process execution logic out there. Plus
>>>property env works on
>>>pre-java1.5 systems
>>>
>>>with the code behind these two in their own library,
>>>you can do a
>>>launcher that takes some xml manifest of a program
>>>to run
>>>
>>><program>
>>>  <name>myapp</name>
>>>  <javaversion min="1.5.05" />
>>>  <jvmargs>
>>>   <maxmem bits="32">128</maxmem>
>>>   <maxmem bits="64">400</maxmem>
>>>  </jvmargs>
>>>  <classpath>
>>>    <....>
>>>  </classpath>
>>>
>>>..whatever. It would be up to someone else to do
>>>this stuff, ideally
>>>using some of the tomcat launcher task.
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>---------------------------------------------------------------------
>>
>>>To unsubscribe, e-mail:
>>>user-unsubscribe@ant.apache.org
>>>For additional commands, e-mail:
>>>user-help@ant.apache.org
>>>
>>>
>>
>>
>>__________________________________________________
>>Do You Yahoo!?
>>Tired of spam?  Yahoo! Mail has the best spam protection around
>>http://mail.yahoo.com
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

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


Mime
View raw message