Replacing build.xml with Build.java - Doing Ant builds directly from Java

View: New views
10 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Re: Doing Ant builds

by ddevienne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jun 12, 2009 at 2:58 PM, Michael Ludwig<milu71@...> wrote:
> Steve Loughran schrieb am 12.06.2009 um 11:49:48 (+0100):
>> we do strive to be more declarative than fully procedural languages,
>> we don't have loops and so lack full turing-equivalence. There are
>> also limits to what you can do in java
>
> I think I can take this to mean "in Ant extensions (written in Java)".
> So what are these limits?

I'm not sure there are that many limits to what you can do in one
task. If you add a <do-something> task and implement it in java, you
can do pretty much anything you want in there, as you have access to a
full and rich programming language and APIs. But one rarely writes a
one-off <do-something> task that takes no input, as it takes time to
design/code/test a task. People write tasks that are generally useful
and can be applied to various situations as parametrized by the tasks
arguments (attributes, nested elements, etc...). I'm not sure what
Steve meant when he wrote "There are also limits to what you can do in
java" in fact... --DD

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


Re: Doing Ant builds

by Eric Fetzer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I wasn't dis'ing Ant.  I was comparing Ant in the Java World or NAnt in the .NET world to Batch files.




________________________________
From: Dominique Devienne <ddevienne@...>
To: Ant Users List <user@...>
Sent: Friday, June 12, 2009 12:43:38 PM
Subject: Re: Doing Ant builds

On Fri, Jun 12, 2009 at 11:32 AM, Eric Fetzer<elstonkers@...> wrote:
> "solution files" - if you're building .NET, go look at NAnt instead of Ant.
> The difference is similar to that of a Volkswagon Beetle vs. Rolls Royce...

Me think in the end more Beetles were sold, for far more total money,
than Rolls Royce's ;-)

Just picking on your analogy, that's all. I'm sure NAnt is a good too.
Always easier to improve on an existing tool you copy, when you have
the luxury of hindsight and no backward compatibility constraints
though. Regarding the XML syntax, yes, it clunky but it's also that
it's good enough that people don't want to spent the time making (or
learning as a user) other front ends to Ant, something the body of Ant
committers have already said on this list (or the dev list) they'd
support and make it easier by adapting the Ant core if needed, if the
patches started coming.

Like many successful projects, Ant in part fell victims to its own
success, where any evolution has to take the large body of scripts
(and code in Ant's case) using it into account. There are many good
alternatives to Ant out there, some better even most likely, but Ant
has a community, tool / IDE support, and books to still make it
relevant despite its many flaws. It's momentum has definitely slowed
mind you, but just like Make it's not going away any time soon.
Gradual obsolescence is normal in this field after all :) --DD

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



Re: Doing Ant builds

by Eric Fetzer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The thing with a mature opensource product is that you get better support than anywhere on the planet.  This is because the people supporting you are also using the product.  They like their own lives to be good as well...




________________________________
From: Michael Ludwig <milu71@...>
To: Ant Users List <user@...>
Sent: Friday, June 12, 2009 1:50:57 PM
Subject: Re: Doing Ant builds

Dominique Devienne schrieb am 12.06.2009 um 13:43:38 (-0500):

> There are many good alternatives to Ant out there, some better even
> most likely, but Ant has a community, tool / IDE support, and books to
> still make it relevant despite its many flaws. It's momentum has
> definitely slowed mind you, but just like Make it's not going away any
> time soon. Gradual obsolescence is normal in this field after all :)

Convinces me to make a greater in investment in learning Ant!

Michael Ludwig

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



RE: Doing Ant builds

by mgainty :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


9/10 when you cant accomplish what is seemingly the simplest task in maven
everyone (even the senior engineers) say run an ant task
http://maven.apache.org/plugins/maven-antrun-plugin/

whatever build environment you're implement ANT is what every build engineer starts with
BTW: CruiseControl, NANT and Maven were ALL built using Ant..

Vielen Danke,
Martin  
______________________________________________
Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.






> Date: Fri, 12 Jun 2009 14:43:14 -0700
> From: elstonkers@...
> Subject: Re: Doing Ant builds
> To: user@...
>
> I wasn't dis'ing Ant.  I was comparing Ant in the Java World or NAnt in the .NET world to Batch files.
>
>
>
>
> ________________________________
> From: Dominique Devienne <ddevienne@...>
> To: Ant Users List <user@...>
> Sent: Friday, June 12, 2009 12:43:38 PM
> Subject: Re: Doing Ant builds
>
> On Fri, Jun 12, 2009 at 11:32 AM, Eric Fetzer<elstonkers@...> wrote:
> > "solution files" - if you're building .NET, go look at NAnt instead of Ant.
> > The difference is similar to that of a Volkswagon Beetle vs. Rolls Royce...
>
> Me think in the end more Beetles were sold, for far more total money,
> than Rolls Royce's ;-)
>
> Just picking on your analogy, that's all. I'm sure NAnt is a good too.
> Always easier to improve on an existing tool you copy, when you have
> the luxury of hindsight and no backward compatibility constraints
> though. Regarding the XML syntax, yes, it clunky but it's also that
> it's good enough that people don't want to spent the time making (or
> learning as a user) other front ends to Ant, something the body of Ant
> committers have already said on this list (or the dev list) they'd
> support and make it easier by adapting the Ant core if needed, if the
> patches started coming.
>
> Like many successful projects, Ant in part fell victims to its own
> success, where any evolution has to take the large body of scripts
> (and code in Ant's case) using it into account. There are many good
> alternatives to Ant out there, some better even most likely, but Ant
> has a community, tool / IDE support, and books to still make it
> relevant despite its many flaws. It's momentum has definitely slowed
> mind you, but just like Make it's not going away any time soon.
> Gradual obsolescence is normal in this field after all :) --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>
>      

_________________________________________________________________
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290

Re: Doing Ant builds

by Steve Loughran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michael Ludwig wrote:
> Steve Loughran schrieb am 12.06.2009 um 11:49:48 (+0100):
>
>> we do strive to be more declarative than fully procedural languages,
>> we don't have loops and so lack full turing-equivalence. There are
>> also limits to what you can do in java
>
> I think I can take this to mean "in Ant extensions (written in Java)".
> So what are these limits?

getting at file permissions is one big problem; no easy way to
read/write the unix permissions. <tar> and <untar> lose stuff, as does
<copy>.

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


Re: Doing Ant builds

by Michael Ludwig-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Steve Loughran schrieb am 15.06.2009 um 12:40:59 (+0100):

> Michael Ludwig wrote:
> >Steve Loughran schrieb am 12.06.2009 um 11:49:48 (+0100):
> >
> >>we do strive to be more declarative than fully procedural languages,
> >>we don't have loops and so lack full turing-equivalence. There are
> >>also limits to what you can do in java
> >
> >I think I can take this to mean "in Ant extensions (written in
> >Java)". So what are these limits?
>
> getting at file permissions is one big problem; no easy way to
> read/write the unix permissions. <tar> and <untar> lose stuff,
> as does <copy>.

Okay, so you were talking about Java limitations in general, not Java
limitations within the context of an Ant extension?

What you're saying about permissions reminds me of my initial post to
this list after discovering that the <delete/> task on Windows will
recursively and unconditionally remove directories - even when they're
write-protected.

Delete task eagerness on Windows - Michael Ludwig
http://markmail.org/thread/ympweusjg2zrzz47

Maybe respecting write-protection on Windows falls outside the limits of
what the JVM can do.

Michael Ludwig

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


Re: Doing Ant builds

by Steve Loughran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michael Ludwig wrote:

> Steve Loughran schrieb am 15.06.2009 um 12:40:59 (+0100):
>> Michael Ludwig wrote:
>>> Steve Loughran schrieb am 12.06.2009 um 11:49:48 (+0100):
>>>
>>>> we do strive to be more declarative than fully procedural languages,
>>>> we don't have loops and so lack full turing-equivalence. There are
>>>> also limits to what you can do in java
>>> I think I can take this to mean "in Ant extensions (written in
>>> Java)". So what are these limits?
>> getting at file permissions is one big problem; no easy way to
>> read/write the unix permissions. <tar> and <untar> lose stuff,
>> as does <copy>.
>
> Okay, so you were talking about Java limitations in general, not Java
> limitations within the context of an Ant extension?

exactly.

>
> What you're saying about permissions reminds me of my initial post to
> this list after discovering that the <delete/> task on Windows will
> recursively and unconditionally remove directories - even when they're
> write-protected.

I suspect permissions in Windows are not what you think they are; that
write protect probably stops you adding stuff inside a directory, not
deleting it from above.

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


Re: Doing Ant builds

by Michael Ludwig-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Steve Loughran schrieb am 16.06.2009 um 16:47:55 (+0100):
> Michael Ludwig wrote:

> >Okay, so you were talking about Java limitations in general, not Java
> >limitations within the context of an Ant extension?
>
> exactly.

Thanks for clarifying.

> >What you're saying about permissions reminds me of my initial post to
> >this list after discovering that the <delete/> task on Windows will
> >recursively and unconditionally remove directories - even when
> >they're write-protected.
>
> I suspect permissions in Windows are not what you think they are; that
> write protect probably stops you adding stuff inside a directory, not
> deleting it from above.

It doesn't stop me adding stuff inside it; it stops me removing the
directory.

You're partially right, though: I can recursively delete a directory
*containing* the write-protected directory, and it does not trigger a
prompt asking "rm: remove write-protected directory `xxx/yyy'?" as on
Linux. It simply and recursively removes the whole tree, never mind
about dispensable write-protection.

Ant, however, goes one step further: It will remove a write-protected
file, which will not work using Windows tools without force, and it will
even recursively remove a write-protected directory. That's not at all
intuitive, and I think you could argue it could be quite harmful.

Michael Ludwig

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


Re: Doing Ant builds

by Steve Loughran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michael Ludwig wrote:

> Steve Loughran schrieb am 16.06.2009 um 16:47:55 (+0100):
>> Michael Ludwig wrote:
>
>>> Okay, so you were talking about Java limitations in general, not Java
>>> limitations within the context of an Ant extension?
>> exactly.
>
> Thanks for clarifying.
>
>>> What you're saying about permissions reminds me of my initial post to
>>> this list after discovering that the <delete/> task on Windows will
>>> recursively and unconditionally remove directories - even when
>>> they're write-protected.
>> I suspect permissions in Windows are not what you think they are; that
>> write protect probably stops you adding stuff inside a directory, not
>> deleting it from above.
>
> It doesn't stop me adding stuff inside it; it stops me removing the
> directory.
>
> You're partially right, though: I can recursively delete a directory
> *containing* the write-protected directory, and it does not trigger a
> prompt asking "rm: remove write-protected directory `xxx/yyy'?" as on
> Linux. It simply and recursively removes the whole tree, never mind
> about dispensable write-protection.
>
> Ant, however, goes one step further: It will remove a write-protected
> file, which will not work using Windows tools without force, and it will
> even recursively remove a write-protected directory. That's not at all
> intuitive, and I think you could argue it could be quite harmful.
>

There's nothing complex going on in there, it just runs through every
file in the list, starting at the bottom, and goes File.delete() on it;
after deleting every file in a directory, it does the directory. I don't
think its trying to be malicious.

If you want ant to honour write-protect options, you could probably
extend delete to do it with a new attribute. Add the relevant tests and
we'll put it in.

-steve


--
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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


Re: Doing Ant builds

by Michael Ludwig-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Steve Loughran schrieb am 18.06.2009 um 16:54:11 (+0100):
> Michael Ludwig wrote:

> >Ant, however, goes one step further: It will remove a write-protected
> >file, which will not work using Windows tools without force, and it
> >will even recursively remove a write-protected directory. That's not
> >at all intuitive, and I think you could argue it could be quite
> >harmful.
>
> There's nothing complex going on in there, it just runs through every
> file in the list, starting at the bottom, and goes File.delete() on
> it; after deleting every file in a directory, it does the directory. I
> don't think its trying to be malicious.
>
> If you want ant to honour write-protect options, you could probably
> extend delete to do it with a new attribute. Add the relevant tests
> and we'll put it in.

A challenge :-) Okay ... It's just "private boolean delete(File f)" in
"org.apache.tools.ant.taskdefs.Delete", right?

I'd add some code to check for an additional attribute (I'm inclined to
check for @force = 'false'), map that to the member "private boolean
force = true" (force by default) and then check for "this.force ==
false" to call file.canWrite() before calling file.delete(), and on
hitting write-protection I'd return false.

And then some tests. Would that be all?

Michael Ludwig

> Author: Ant in Action           http://antbook.org/

PS: Wrong URL?

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

< Prev | 1 - 2 | Next >