|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
run script after ant finishedIs there a way to run something after ANT has finished with log output? I am trying to implement an auto-update feature of my ant scripts. They are in a SVN sandbox that all my users checkout. I would like the ANT scripts to check if the user's sandbox is up to date and run svn update if not. The problem is that you can't update yourself since some files will be locked by the OS since they are in use at the time. So I was thinking I could run the svn update command after ANT has completed the up to date check of the sandbox. I did this using the java svn client and the spawn/fork options of the java task. The spawn/fork options allow this svn update command to outlive the ANT process which allows the ANT process to die unlocking the files allowing them to be updated. Everything works well except the spawn/fork options prevent the output of the svn update command from displaying in the console. I would like the end user to see the update take place to know when it is complete. Anybody have any ideas?
--- Shawn Castrianni ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. |
|
|
RE: run script after ant finished-----Original Message----- From: Shawn Castrianni [mailto:Shawn.Castrianni@...] Sent: Wednesday, June 24, 2009 12:55 AM To: 'Ant Users List' Subject: run script after ant finished /* Is there a way to run something after ANT has finished with log output? [...] when it is complete. Anybody have any ideas? */ maybe the exec-listener will fit in, just run your stuff afterwards, see = http://marc.info/?l=ant-user&m=121680439101163&w=2 Regards, Gilbert --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
RE: run script after ant finishedThis online presentation is hanging after slide 2. Can I get this information some other way or can I download the presentation locally?
--- Shawn Castrianni -----Original Message----- From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@...] Sent: Wednesday, June 24, 2009 2:13 AM To: 'Ant Users List' Subject: RE: run script after ant finished -----Original Message----- From: Shawn Castrianni [mailto:Shawn.Castrianni@...] Sent: Wednesday, June 24, 2009 12:55 AM To: 'Ant Users List' Subject: run script after ant finished /* Is there a way to run something after ANT has finished with log output? [...] when it is complete. Anybody have any ideas? */ maybe the exec-listener will fit in, just run your stuff afterwards, see = http://marc.info/?l=ant-user&m=121680439101163&w=2 Regards, Gilbert --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: run script after ant finishedOn Wed, Jun 24, 2009 at 10:39 AM, Shawn
Castrianni<Shawn.Castrianni@...> wrote: > This online presentation is hanging after slide 2. Can I get this information some other way or can I download the presentation locally? Worked for me (in FireFox). But a Listener or a Logger are part of the Ant VM, so it doesn't you here I think Shawn, since you want something after the VM has finished, right? A much easier solution is simply to fail the build when you detect an update is necessary, asking the user to explicitly update, with possibly adding a way to circumvent that temporarily. Forcing the update "transparently" without the user's consent is not quite nice actually, with or without seing the SVN update messages. --DD --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
RE: run script after ant finishedCorrect, I need something after the ANT VM has exited.
Dominique, I do ask the user if he/she wants to perform the update before either continuing or ending the build and transparently updating. By the way, here is another example to have a task for ending an ANT build early WITHOUT using the <fail> task. If the user says yes to updating, that is NOT a failure so seeing the BUILD FAILED message caused by the <fail> task is misleading. Using my new EndTask which ends the build successfully makes more sense. I would suggest ANT change the <fail> task to a <stop> task with an attribute called fail="yes/no" to allow the developer to choose either a successful stop of the build or a failed stop of the build. --- Shawn Castrianni -----Original Message----- From: Dominique Devienne [mailto:ddevienne@...] Sent: Wednesday, June 24, 2009 10:48 AM To: Ant Users List Subject: Re: run script after ant finished On Wed, Jun 24, 2009 at 10:39 AM, Shawn Castrianni<Shawn.Castrianni@...> wrote: > This online presentation is hanging after slide 2. Can I get this information some other way or can I download the presentation locally? Worked for me (in FireFox). But a Listener or a Logger are part of the Ant VM, so it doesn't you here I think Shawn, since you want something after the VM has finished, right? A much easier solution is simply to fail the build when you detect an update is necessary, asking the user to explicitly update, with possibly adding a way to circumvent that temporarily. Forcing the update "transparently" without the user's consent is not quite nice actually, with or without seing the SVN update messages. --DD --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
RE: run script after ant finishedI have a somewhat similar situation - what I did was create a shell script that invokes ant, and I simply invoke ant twice - the first one is a target to get the latest versions of the build files (build.xml and some property files, etc) which updates itself, then the next call does the build. The second ant invocation uses the new files. The script doesn't check if it's up to date or not; it simply does an update each time.
I don't run into the problem of a file being locked - I don't know why that would be. We are using this setup on linux boxes (for the build machines) as well as developer systems running XP/Vista. The SCM is Perforce and I'm using the p4sync task - maybe that's the reason? Hopefully I understood your situation... HTH, KaJun |
|
|
Re: run script after ant finishedOn Wed, Jun 24, 2009 at 11:17 AM, Shawn
Castrianni<Shawn.Castrianni@...> wrote: > Correct, I need something after the ANT VM has exited. Weiji's solution of running Ant twice from the outside script is the easiest, provided it can be used, which may not be the case when it's an IDE that runs the Ant script for example. There may be a possible solution involving the Ant launcher and class loading. Ant has a very small executable jar containing the launcher class and which can (and does) manipulate the classpath Ant "proper" will be using. You could code the update boostrap step directly into the launcher, independently of the build itself, although that does hide it since would now live in code. The advantage of this approach is that you can do the update before Ant has really started and any jars are locked by the VM on Windows. If you really want to run two builds, but in the same VM, you could even try to play tricks with classloaders, downloading the new jars under a different name, routing to these jar using a custom class loader on the second run, and next time trying to rename them. But this is getting into the weeds, and may not play well with IDE integration again. I just wanted to point out that there's good opportunity for customization in Ant's launcher, like when I added support for -- arg0 arg1 arg2 ... --DD --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
| Free embeddable forum powered by Nabble | Forum Help |