From halljames@example.net Sat Jul 1 00:47:56 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 63881 invoked from network); 1 Jul 2000 00:47:56 -0000 Received: from oznet15.ozemail.com.au (83.161.120.155) by locus.apache.org with SMTP; 1 Jul 2000 00:47:56 -0000 Received: from cognetnt (1Cust18.tnt5.syd2.da.uu.net [83.161.120.155]) by oznet15.ozemail.com.au (8.9.0/8.6.12) with SMTP id KAA18000 for <halljames@example.net>; Sat, 1 Jul 2000 10:47:51 +1000 (EST) From: "Conor MacNeill" <halljames@example.net> To: <halljames@example.net> Subject: RE: self modifying jar? Date: Sat, 1 Jul 2000 10:46:38 +1000 Message-ID: <halljames@example.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 In-Reply-To: <halljames@example.net> Importance: Normal X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: halljames@example.net [mailto:halljames@example.net] > Sent: Saturday, 1 July 2000 3:15 > To: halljames@example.net > Subject: Re: self modifying jar? > > > > > Let's discuss this for a moment. > > The build process for Castor simply loads everything found in the lib > directory into the classpath. I've tried making the cocoon build process > match, and I found that I like what I see. Now I would like to suggest > that we make the ant build process match. It makes adding something to > your classpath is as easy as copying/linking a jar into the $ANT_HOME/lib > directory. Removing something is just as easy. > > The reason why I'm bringing this up in response to your post is that this > conflicts with your suggestion. Thinking about this, the issue > is that the > build.xml chooses to place this one file (ant.jar) into a special place; > all other build outputs are placed into a separate build directory. My > preference is that this be changed - and have everything placed in the > build directory. If users want to actually run from this, that > should be a > separate, overt, install step. > > Thoughts? > +1 We would need to make sure that people understand this - ie. they do not expect building ant to be enough to use the latest features. I'm saying that because of Craig's response to my proposal to move the lib directory > This would be nasty for build files or scripts assuming they can refer to > $ANT_HOME/lib/ant.jar for the Ant files. Today, this assumption > is correct > whether you are using the source or the binary distribution of > Ant -- but it > would no longer be the case if you build externally unless you > always remember > to change ANT_HOME. > From halljames@example.net Sat Jul 1 00:53:34 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 65952 invoked from network); 1 Jul 2000 00:53:34 -0000 Received: from me-sv-02.free.net.au (83.161.120.155) by locus.apache.org with SMTP; 1 Jul 2000 00:53:34 -0000 Received: (qmail 18883 invoked from network); 1 Jul 2000 00:52:51 -0000 Received: from me-as-04-055.free.net.au (HELO donalgar) (83.161.120.155) by me-sv-02.free.net.au with SMTP; 1 Jul 2000 00:52:51 -0000 Message-Id: <halljames@example.net> X-Sender: halljames@example.net X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Sat, 01 Jul 2000 10:49:17 +1000 To: halljames@example.net From: Peter Donald <halljames@example.net> Subject: RE: Urgent help with Javac task In-Reply-To: <halljames@example.net .com> References: <halljames@example.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N At 04:43 30/6/00 -0700, you wrote: >I've just started using Ant (and am new to this list). I tried the "modern" >option and found the same thing. When I looked in the Ant source, I saw that >this option is not actually implemented (it does nothing). Ug - you are using source code from a while back (maybe 2 months ???) and if you want to download the newest code (which is highly recomended) goto http://jakarta.apache.org/builds/tomcat/nightly At 04:24 30/6/00 -0700, you wrote: >I sent a message a few days ago, but I got no response. I hope I have better >luck this time. > >I really want to use Ant on a project I am working on, which requires the >compiler of JDK 1.3 due to bugs in the 1.2.x compilers. As I said then it works fine with the 1.3 version I have from sun and I believe I have tried the 1.3 ibm linux version aswell (thou not sure). So try going back to a stable 1.3 and not a beta. Alternatively you can type ./build.bat -version if this brings up an error you downloaded an old version of ant and should download it from site above. Otherwise try sending verbose output (ie with -verbose flag to list. Then we may be able to help you but as it stands now you haven't given us remotely enough information to work with :P Cheers, Pete *------------------------------------------------------* | "Nearly all men can stand adversity, but if you want | | to test a man's character, give him power." | | -Abraham Lincoln | *------------------------------------------------------* From halljames@example.net Sat Jul 1 02:36:30 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 4607 invoked from network); 1 Jul 2000 02:36:30 -0000 Received: from renoir.op.net (halljames@example.net) by locus.apache.org with SMTP; 1 Jul 2000 02:36:30 -0000 Received: from monet.op.net (halljames@example.net [83.161.120.155]) by renoir.op.net (o1/$Revision: 1.18 $) with ESMTP id WAA01825; Fri, 30 Jun 2000 22:36:29 -0400 (EDT) From: Andrew Sudell <halljames@example.net> Received: (from asudell@localhost) by monet.op.net ($Revision: 1.2 $) id WAA11457; Fri, 30 Jun 2000 22:36:28 -0400 (EDT) Message-Id: <halljames@example.net> Subject: Setting ANT_HOME in build.sh/build.bat To: halljames@example.net Date: Fri, 30 Jun 2000 22:36:28 -0400 (EDT) Reply-To: halljames@example.net Reply-to: halljames@example.net X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Since build.bat saves the old ANT_HOME, and build.sh can't bother it's parent environment, and the ant you just bootstraped may well be incompatible with the one in ANT_HOME, it's probably a good idea to always set ANT_HOME to the directory being build. For example building aginst the current source (but with ANT_HOME pointing to something a week or so out), I blow out in build with BUILD CONFIG ERROR Class class org.apache.tools.ant.taskdefs.Copydir doesn't support the "forceover write" property ... But work fine with the patch below. Index: build.bat =================================================================== RCS file: /home/cvspublic/jakarta-ant/build.bat,v retrieving revision 1.7 diff -u -r1.7 build.bat --- build.bat 2000/06/30 22:39:45 1.7 +++ build.bat 2000/07/01 02:35:00 @@ -1,7 +1,7 @@ @echo off set _ANTHOME=%ANT_HOME% -if "%ANT_HOME%" == "" set ANT_HOME=. +set ANT_HOME=. set LOCALCLASSPATH=%CLASSPATH% for %%i in (%ANT_HOME%\lib\*.jar) do call lcp.bat %%i Index: build.sh =================================================================== RCS file: /home/cvspublic/jakarta-ant/build.sh,v retrieving revision 1.8 diff -u -r1.8 build.sh --- build.sh 2000/06/30 22:39:45 1.8 +++ build.sh 2000/07/01 02:35:00 @@ -1,8 +1,6 @@ #!/bin/sh -if [ "$ANT_HOME" = "" ] ; then - ANT_HOME=`pwd` -fi +ANT_HOME=`pwd` export ANT_HOME LOCALCLASSPATH=`echo $ANT_HOME/lib/*.jar | tr ' ' ':'` -- Drew Sudell halljames@example.net http://www.op.net/~asudell From halljames@example.net Sat Jul 1 15:02:26 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 37109 invoked from network); 1 Jul 2000 15:02:26 -0000 Received: from fep8.mail.ozemail.net (83.161.120.155) by locus.apache.org with SMTP; 1 Jul 2000 15:02:26 -0000 Received: from cognetnt (1Cust70.tnt2.syd2.da.uu.net [83.161.120.155]) by fep8.mail.ozemail.net (8.9.0/8.6.12) with SMTP id BAA00237 for <halljames@example.net>; Sun, 2 Jul 2000 01:02:14 +1000 (EST) From: "Conor MacNeill" <halljames@example.net> To: <halljames@example.net> Subject: RE: unless and nested includes/excludes undocumented?! Date: Sun, 2 Jul 2000 01:01:00 +1000 Message-ID: <halljames@example.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 In-Reply-To: <halljames@example.net> Importance: Normal X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Vassilis Rizopoulos [mailto:halljames@example.net] > Sent: Thursday, 29 June 2000 20:35 > To: 'halljames@example.net' > Subject: RE: unless and nested includes/excludes undocumented?! > > > > We cannot remove the ambiguity in c:/jdk1.1 but a lot of other things > > are already handled - a : will always be treated as a path separator > > unless there is exactly one letter in front of it for example. > > > I might be dragging this too far, but if you check for things like 'one > letter infront' > why not check for 'one letter infront and (slash or backslash) > after' which > handles the ambiguity (I'm probablybeing awfully naive here). > I think it is indeed possible to parse c:/blah correctly. Originally I didn't think this was strictly necessary (This issue was raised previously by Phil Hanna). I now think on systems with DOS style filesystems that c:/blah should be supported. In fact I rewrote translatePath in terms of PathTokenizer to support it. The presence of Thomas' Path stuff will not eliminate the need to parse and translate paths since they may be passed in from the external environment as properties. Thomas has considered this. Conor From halljames@example.net Sat Jul 1 16:48:23 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 67403 invoked from network); 1 Jul 2000 16:48:23 -0000 Received: from e22.nc.us.ibm.com (83.161.120.155) by locus.apache.org with SMTP; 1 Jul 2000 16:48:23 -0000 Received: from southrelay02.raleigh.ibm.com (southrelay02.raleigh.ibm.com [83.161.120.155]) by e22.nc.us.ibm.com (8.9.3/8.9.3) with ESMTP id MAA15870 for <halljames@example.net>; Sat, 1 Jul 2000 12:26:51 -0500 From: halljames@example.net Received: from d54mta04.raleigh.ibm.com (d54mta04.raleigh.ibm.com [83.161.120.155]) by southrelay02.raleigh.ibm.com (8.8.8m3/NCO v4.9) with SMTP id MAA32482 for <halljames@example.net>; Sat, 1 Jul 2000 12:48:22 -0400 Received: by d54mta04.raleigh.ibm.com(Lotus SMTP MTA v4.6.5 (863.2 5-20-1999)) id 8525690F.005C4E53 ; Sat, 1 Jul 2000 12:48:13 -0400 X-Lotus-FromDomain: IBMUS To: halljames@example.net Message-ID: <halljames@example.net> Date: Sat, 1 Jul 2000 12:48:16 -0400 Subject: Re: Setting ANT_HOME in build.sh/build.bat Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Andrew Sudell wrote: > > Since build.bat saves the old ANT_HOME, and build.sh can't > bother it's parent environment, and the ant you just > bootstraped may well be incompatible with the one in > ANT_HOME, it's probably a good idea to always set ANT_HOME > to the directory being build. I often use Ant to build projects other than Ant itself... - Sam Ruby From halljames@example.net Sat Jul 1 19:38:12 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 20874 invoked from network); 1 Jul 2000 19:38:12 -0000 Received: from renoir.op.net (halljames@example.net) by locus.apache.org with SMTP; 1 Jul 2000 19:38:12 -0000 Received: from vega.sudell.org (d-bm5-04.ppp.op.net [83.161.120.155]) by renoir.op.net (o1/$Revision: 1.18 $) with ESMTP id PAA06655 for <halljames@example.net>; Sat, 1 Jul 2000 15:38:06 -0400 (EDT) Received: (from asudell@localhost) by vega.sudell.org (8.9.2/8.9.2) id PAA00858; Sat, 1 Jul 2000 15:38:18 -0400 (EDT) (envelope-from halljames@example.net) From: "Andrew B. Sudell" <halljames@example.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 1 Jul 2000 15:38:15 -0400 (EDT) To: halljames@example.net Subject: Re: Setting ANT_HOME in build.sh/build.bat In-Reply-To: <halljames@example.net> References: <halljames@example.net> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <halljames@example.net> Reply-To: Drew Sudell <halljames@example.net> X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N halljames@example.net writes: > > > Andrew Sudell wrote: > > > > Since build.bat saves the old ANT_HOME, and build.sh can't > > bother it's parent environment, and the ant you just > > bootstraped may well be incompatible with the one in > > ANT_HOME, it's probably a good idea to always set ANT_HOME > > to the directory being build. > > I often use Ant to build projects other than Ant itself... > Of course, that's the point. But generally I build other projects using ANT_HOME/bin/ant (in the case of local development) or the build script in the project (when supplied as in the case of the jakarta projects). Honestly, it had not occurred to me that anyone would use the build scripts in jakarta-ant to build other things. I'd prefer that build.[sh|bat] add the local ant.jar to the classpath, but for my purposes, I can unset ANT_HOME before building ant. (The paranoid part of me should have thought of that anyway!) As I've had an opportunity to build on other machines though, I've hit a related issue. The other change was to explicitly invoke java with "-classpath $LOCALCLASSPATH". On JDK 1.1.x, unfortunately there is a difference between CLASSPATH=foo:bar export CLASSPATH java blah and java -classpath foo:bar blah Since the java script alters CLASSPATH before loading the VM. Using "-classpath" ends up omitting classes.zip from the classpath, and results in the error Unable to initialize threads: cannot find class java/lang/Thread Can I suggest adding something like if test -f $JAVA_HOME/lib/classes.zip ; then LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip fi to build.sh to get around that difference? The alternative might be to set and reset classpath in the environment and avoid the -classpath flag. Drew -- Drew Sudell halljames@example.net http://www.op.net/~asudell From halljames@example.net Sat Jul 1 21:37:13 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 54654 invoked from network); 1 Jul 2000 21:37:13 -0000 Received: from f227.law3.hotmail.com (HELO hotmail.com) (83.161.120.155) by locus.apache.org with SMTP; 1 Jul 2000 21:37:13 -0000 Received: (qmail 98248 invoked by uid 0); 1 Jul 2000 21:36:47 -0000 Message-ID: <halljames@example.net> Received: from 83.161.120.155 by www.hotmail.com with HTTP; Sat, 01 Jul 2000 14:36:47 PDT X-Originating-IP: [83.161.120.155] From: "Richard Esmond" <halljames@example.net> To: halljames@example.net Subject: RE: !oh yeah! Date: Sat, 01 Jul 2000 16:36:47 CDT Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Seems like you could use XML:namespaces and\or XLink to shorten the syntax. Schema also has a few options as well. ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com From halljames@example.net Sat Jul 1 23:33:55 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 90172 invoked by uid 500); 1 Jul 2000 23:33:55 -0000 Delivered-To: halljames@example.net Received: (qmail 90169 invoked by uid 1064); 1 Jul 2000 23:33:55 -0000 Date: 1 Jul 2000 23:33:55 -0000 Message-ID: <halljames@example.net> From: halljames@example.net To: halljames@example.net Subject: cvs commit: jakarta-ant build.bat build.sh rubys 00/07/01 16:33:55 Modified: . build.bat build.sh Log: Better support for JDK 1.1 Submitted by: Drew Sudell <halljames@example.net> Revision Changes Path 1.8 +1 -0 jakarta-ant/build.bat Index: build.bat =================================================================== RCS file: /home/cvs/jakarta-ant/build.bat,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- build.bat 2000/06/30 22:39:45 1.7 +++ build.bat 2000/07/01 23:33:54 1.8 @@ -6,6 +6,7 @@ set LOCALCLASSPATH=%CLASSPATH% for %%i in (%ANT_HOME%\lib\*.jar) do call lcp.bat %%i if exist %JAVA_HOME%\lib\tools.jar call lcp.bat %JAVA_HOME%\lib\tools.jar +if exist %JAVA_HOME%\lib\classes.zip call lcp.bat %JAVA_HOME%\lib\classes.zip echo. echo Building with classpath: %LOCALCLASSPATH% 1.9 +4 -0 jakarta-ant/build.sh Index: build.sh =================================================================== RCS file: /home/cvs/jakarta-ant/build.sh,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- build.sh 2000/06/30 22:39:45 1.8 +++ build.sh 2000/07/01 23:33:54 1.9 @@ -15,6 +15,10 @@ LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar fi +if test -f $JAVA_HOME/lib/classes.zip ; then + LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip +fi + echo echo Building with classpath: $LOCALCLASSPATH echo From halljames@example.net Sun Jul 2 01:47:40 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 28406 invoked from network); 2 Jul 2000 01:47:40 -0000 Received: from mother.thoughtworks.com (83.161.120.155) by locus.apache.org with SMTP; 2 Jul 2000 01:47:40 -0000 Subject: [PATCH] logging cleanup To: halljames@example.net Bcc: X-Mailer: Lotus Notes Release 5.0.2c February 2, 2000 Message-ID: <halljames@example.net> From: halljames@example.net Date: Sat, 1 Jul 2000 20:47:38 -0500 X-MIMETrack: Serialize by Router on Mother/ThoughtWorks.COM/US(Release 5.0.2c |February 2, 2000) at 07/01/2000 08:49:25 PM MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=3v4n1nTlTGKz7A1XMY2MZzdKQd0XR24onomn0FaauusQfouHTRqmLw0z" Content-Disposition: inline X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N --0__=3v4n1nTlTGKz7A1XMY2MZzdKQd0XR24onomn0FaauusQfouHTRqmLw0z Content-type: text/plain; charset=us-ascii (See attached file: patch.jar) Here's a patch that cleans up some of the output generated by Ant. I've made the following changes: * Moved the rest of the "System.out.println" code in Main.java over to DefaultLogger.java. * Cleaned up the default output to be a little more readable, by putting blank lines between targets and aligning the message part of each log statement. * Added a System.exit() call in main() to avoid dumping a stack trace for every single error. Other tools that want to invoke Ant without exiting can still call new Main(args).runBuild(). * Changed the Javac task back to logging each line as it's generated. I've created a generic TaskOutputStream to replace JavacOutputStream, which is designed to be usable in any task. Here's how the new output looks when building ant itself. Let me know if you think it's an improvement or not... D:\jakarta-ant>build clean main Buildfile: build.xml clean: [Deltree] Deleting: D:\build\ant [Deltree] Deleting: D:\dist\ant prepare: [Mkdir] Created dir: D:\build\ant check_for_optional_packages: compile: [Mkdir] Created dir: D:\build\ant\classes [Javac] Compiling 65 source files to D:\build\ant\classes [Copydir] Copying 2 files to D:\build\ant\classes [Copydir] Copying 1 files to D:\build\ant\classes jar: [Jar] Building jar: D:\jakarta-ant\lib\ant.jar main: BUILD SUCCESSFUL Total time: 18 seconds --0__=3v4n1nTlTGKz7A1XMY2MZzdKQd0XR24onomn0FaauusQfouHTRqmLw0z Content-type: application/octet-stream; name="patch.jar" Content-Disposition: attachment; filename="patch.jar" Content-transfer-encoding: base64 UEsDBBQACAAIAJml4SgAAAAAAAAAAAAAAAAJAAQATUVUQS1JTkYv/soAAAMAUEsHCAAAAAACAAAA AAAAAFBLAwQUAAgACACZpeEoAAAAAAAAAAAAAAAAFAAAAE1FVEEtSU5GL01BTklGRVNULk1G803M y0xLLS7RDUstKs7Mz7NSMNQz4OVyLkpNLElN0XWqBAkY6RkpaASX5in4ZiYX5RdXFpek5hYreOYl 62nycvFyAQBQSwcIqqPdbEQAAABEAAAAUEsDBBQACAAIAIql4SgAAAAAAAAAAAAAAAAJAAAAYW50 LnBhdGNozVrrb9s4Ev+cAv0fuAYOqzS25EfStOl20TRxdtPLo4jTvcXtLgpFomM1smiIVB63yP9+ M0NKFiX5kRaHqz5EjkTOizPD3wx1nIT8fo/JNPCmfpR4Ir32/JkfTLinhIil5yfKO+RjP4vVibi+ 5qn7xb/1nz97++3X82cXByM2jmK+x7yJmHIvuJWz7CqOAu+Lf+Onyu8g+6cK1759/izlKo34bZRc sxRuMhIJ67m958/CaDxmnYx1UviXNWnW6XSebI+Nfrfb9bovvf4263X3dnb2Bq82iN/W1tbXUtv1 un3W7e1t9/YG/efP3r1jnZf99iu2BX97Pfbu3fNnjL1gzE8e2JRL6V9zydTEV+yaKxYjvdClMR78 1YZlQexLaevNouks5lOeKMneZ1EcnkRS8QRe/A3yM7hmaXTrK86k8hXQiBLFToZHl58Pzk8+nZ59 Hh3/e8jesl7/DYxHhqUpH1MYPVIp96dMZOpN5TWSmsrr80zNMnXCb3n8psIzFrCGwDhVl9GU43xD wnvxwvxCIxyIRKo0C0AHnyX8TuufsrtJFEzYXRTH7C6NgJ4SYCNQZcaDaBzxUBt2d7vd22Vbu7vt 7VfGsuZSk0i6IDkoWJK/eGMLD4Nq2tDYR7KMVkwvxK2IQnaF5h6hcjx0yPbDW1gHxvHvZmF/vAoT AI/RAyzQ1A2yNIVx+PAUFIyks5lbr8SP7LSV24nWQ4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hQAFAAIAAgAiqXh KITwyMrLDAAAcjAAAAkAAAAAAAAAAAAAAAAAwwAAAGFudC5wYXRjaFBLAQIUABQACAAIAJCl4Sgt iun6dwcAAEYRAAAVAAAAAAAAAAAAAAAAAMUNAABUYXNrT3V0cHV0U3RyZWFtLmphdmFQSwUGAAAA AAQABAD3AAAAfxUAAAAA --0__=3v4n1nTlTGKz7A1XMY2MZzdKQd0XR24onomn0FaauusQfouHTRqmLw0z-- From halljames@example.net Sun Jul 2 12:49:20 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 62478 invoked from network); 2 Jul 2000 12:49:20 -0000 Received: from rabbit.active.ch (83.161.120.155) by locus.apache.org with SMTP; 2 Jul 2000 12:49:20 -0000 Received: from vaio (pop-mu-1-2-dialup-13.freesurf.ch [83.161.120.155]) by rabbit.active.ch (8.9.3/8.9.3) with SMTP id OAA29745 for <halljames@example.net>; Sun, 2 Jul 2000 14:49:17 +0200 (MET DST) Message-ID: <002501bfe424$137d5640$952cfea9@vaio> From: "Thomas Haas" <halljames@example.net> To: <halljames@example.net> Subject: [PATCH]: new task zipparanoia Date: Sun, 2 Jul 2000 14:47:02 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_001D_01BFE434.625911E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express +1-914-664-6866 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_001D_01BFE434.625911E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi Attached find a small and maybe usefull task called ZipParanoia. ZipParanoia helps controlling the contents of zip or jar archives. ZipParanioa takes an input archive, include lists and exclude lists and creates an output archive applying the following rules: - every file from the include lists is in the output archive - every file from the exclude lists is not in the output archive in paranoia mode the following must be true: - include and exclude are not allowed to overlap - the union of all include and exclude lists must match the contents of the input archive WHY - QA wants to know exactly what an archive consists of, hence paranioa mode - an input archive may result in several output archives with various contents - input archives are created by merging many different archives together. We found it easier to create one huge archive and than remove in a controlled manner the uneeded stuff. - No current ant task provided the paranoia level we needed. ZipParanoia serves us well. Let me know, if you think this should be included as an optional task or not. Improvements or better ways to solve this problem are welcomed as well. - tom -- * Thomas Haas <mailto:halljames@example.net> * SoftWired AG <http://ww.softwired-inc.com/> * Technoparkstr. 1 *** CH-8005 Zurich *** +41-1-4452370 ------=_NextPart_000_001D_01BFE434.625911E0 Content-Type: text/plain; name="patchfile.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patchfile.txt" --- ZipParanoia.java.orig Sun Jul 02 14:30:24 2000 +++ ZipParanoia.java Sun Jul 02 14:30:24 2000 @@ -0,0 +1,283 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software = itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software + * Foundation" must not be used to endorse or promote products = derived + * from this software without prior written permission. For written + * permission, please contact halljames@example.net. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +package org.apache.tools.ant.taskdefs.optional; + +import org.apache.tools.ant.Task; +import org.apache.tools.ant.BuildException; + + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.BufferedReader; +import java.io.Reader; +import java.io.FileReader; +import java.io.IOException; +import java.util.Hashtable; +import java.util.Enumeration; +import java.util.Vector; +import java.util.zip.*; +import java.util.StringTokenizer; + + +/** + * ZipParanoia checks and trims zip or jar archives. + * + * ZipParanoia needs a list of files to remain in the archive + * and a list of files to be removed. No wildcards are allowed and = every file + * in the archive must either be listed in the include or in the = exclude list. + * The two lists must not overlap.<br> + * This strict behaviour has been chosen on purpose. + * <p> + * ZipParanoia helps assureing a zip or jar really contains what we = think it + * should contain. + * + * Example: + * <tt> + * &lt;zipparanoia includeFile=3D"include1.txt,include2.txt" = excludeFile=3D"exclude1.txt,exclude2.txt" zipFile=3D"xyz.jar"/&gt; + * </tt> + * + * @author halljames@example.net + */ +public class ZipParanoia extends Task { + + final static String EOL =3D System.getProperty("line.separator"); + + Hashtable include =3D new Hashtable(); + Hashtable exclude =3D new Hashtable(); + File sourceZIP =3D null; + File destZIP =3D null; + Vector includeFile =3D new Vector(); + Vector excludeFile =3D new Vector(); + boolean paranoia =3D true; + boolean removeSource =3D false; + final StringBuffer error =3D new StringBuffer(); + + public void setZipfile(String name) { + sourceZIP =3D project.resolveFile(name); + } + + public void setIncludefile(String value) throws BuildException { + if (value.length() =3D=3D 0) { + throw new BuildException("IncludeFile name is empty."); + } + setFile(includeFile, value); + } + + public void setExcludefile(String value) throws BuildException { + if (value.length() =3D=3D 0) { + throw new BuildException("ExcludeFile name is empty."); + } + setFile(excludeFile, value); + } + + + public void setZipDestination(String name) throws BuildException { + if (name.length() =3D=3D 0) { + throw new BuildException("ZipDestination name is empty."); + } + destZIP =3D project.resolveFile(name); + } + + + public void setParanoia(String value) { + paranoia =3D project.toBoolean(value); + } + + + protected void fillList(File file, Hashtable list) + throws IOException { + BufferedReader br =3D new BufferedReader(new FileReader(file)); + try { + String line; + while ((line =3D br.readLine()) !=3D null) { + if (line.length() > 0) { + list.put(line, line); + } + } + } + finally { + br.close(); + } + } + + + + + public void execute() throws BuildException { + createIncludeExclude(); + createZIPs(); + + try { + ZipInputStream zin =3D new ZipInputStream(new = FileInputStream(sourceZIP)); + ZipOutputStream zos =3D new ZipOutputStream(new = FileOutputStream(destZIP)); + ZipEntry entry; + while ((entry =3D zin.getNextEntry()) !=3D null) { + if (!entry.isDirectory()) { + //System.out.println("Processing " + entry); + if (exclude !=3D null + && exclude.remove(entry.getName()) !=3D = null) { + continue; + } + if (include !=3D null + && include.remove(entry.getName()) =3D=3D = null) { + error.append("ARCHIVE ") + .append(entry).append(EOL); + } + } + zos.putNextEntry(entry); + int c; // TODO: use byte[] instead of single byte + while ((c =3D zin.read()) !=3D -1) { + zos.write(c); + } + zos.closeEntry(); + } + zos.close(); + zin.close(); + + } catch(IOException e) { + throw new BuildException(e); + } + + if (include.size() > 0 || exclude.size() > 0) { + Enumeration list; + list =3D include.elements(); + if (list.hasMoreElements()) { + while(list.hasMoreElements()) { + error.append("INCLUDE ") + .append(list.nextElement()).append(EOL); + } + } + list =3D exclude.elements(); + if (list.hasMoreElements()) { + while(list.hasMoreElements()) { + error.append("EXCLUDE ") + .append(list.nextElement()).append(EOL); + } + } + } + if (error.length() > 0) { + if (paranoia) { + throw new BuildException("ERRORS IN INCLUDE/EXCLUDE" + = EOL + + error.toString()); + } + System.out.println("ERRORS IN INCLUDE/EXCLUDE"); + System.out.println(error); + } + // do not delete file if exception thrown to ease debugging + if (removeSource) { + sourceZIP.delete(); + } + } + + + protected void createIncludeExclude() throws BuildException { + try { + if (includeFile.size() =3D=3D 0) { + paranoia =3D false; + } + for (int i=3D0; i < includeFile.size(); i++) { + fillList((File)includeFile.elementAt(i), include); + } + for (int i=3D0; i < excludeFile.size(); i++) { + fillList((File)excludeFile.elementAt(i), exclude); + } + } catch (IOException e) { + throw new BuildException(e); + } + Enumeration list =3D exclude.elements(); + Vector doubles =3D new Vector(); + while (list.hasMoreElements()) { + Object e =3D include.get(list.nextElement()); + if (e !=3D null) { + doubles.addElement(e); + } + } + if (doubles.size() > 0) { + for (int i=3D0; i < doubles.size(); i++) { + error.append("INC-EXC ") + .append(doubles.elementAt(i)).append(EOL); + } + } + + if (paranoia && error.length() > 0) { + throw new BuildException(error.toString()); + } + } + + protected void createZIPs() throws BuildException { + if (!sourceZIP.exists() || !sourceZIP.isFile()) { + throw new BuildException("SourceFile is invalid: " + = sourceZIP); + } + + if (destZIP =3D=3D null) { + destZIP =3D sourceZIP; + sourceZIP =3D new File(sourceZIP.getParentFile(), + sourceZIP.getName() + ".o"); + sourceZIP.delete(); + if (!destZIP.renameTo(sourceZIP)) { + throw new BuildException("Unable to create temp file: " = + sourceZIP); + } + removeSource =3D true; + } + } + + protected void setFile(Vector result, String value) throws = BuildException { + final StringTokenizer tokenizer =3D new StringTokenizer(value, = ",", false); + while (tokenizer.hasMoreTokens()) { + = result.addElement(project.resolveFile(tokenizer.nextToken())); + } + } +} ------=_NextPart_000_001D_01BFE434.625911E0-- From halljames@example.net Sun Jul 2 12:49:19 2000 Return-Path: <halljames@example.net> Mailing-List: contact halljames@example.net; run by ezmlm Delivered-To: mailing list halljames@example.net Received: (qmail 62466 invoked from network); 2 Jul 2000 12:49:19 -0000 Received: from rabbit.active.ch (83.161.120.155) by locus.apache.org with SMTP; 2 Jul 2000 12:49:19 -0000 Received: from vaio (pop-mu-1-2-dialup-13.freesurf.ch [83.161.120.155]) by rabbit.active.ch (8.9.3/8.9.3) with SMTP id OAA29719 for <halljames@example.net>; Sun, 2 Jul 2000 14:49:03 +0200 (MET DST) Message-ID: <002401bfe424$0b1bf380$952cfea9@vaio> From: "Thomas Haas" <halljames@example.net> To: <halljames@example.net> Subject: [PATCH]: Path, Execution framework, JUnit and JavaCC Date: Sun, 2 Jul 2000 14:28:59 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0009_01BFE431.DC8E31A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express +1-914-664-6866 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0009_01BFE431.DC8E31A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi Please find attached patches for the mutch discussed Path object, JUnit task, JavaCC task and the execution framework. I put these into different patches for easier review. If no disagreement is expressed on the list till tuesday, I will commit the patches. Any enhancements sent to me by tuesday will go in as well. Patches to build.xml and taskef are not included in ths email. TODO - add Project.resolveFile functionality to Path. - Path should use the FileTokenizer instead of my home brew parser. - Commandline should be able to change the current directory of the running subprocess, like the Execute task does. - improve documentation. Thanks - tom -- * Thomas Haas <mailto:halljames@example.net> * SoftWired AG <http://ww.softwired-inc.com/> * Technoparkstr. 1 *** CH-8005 Zurich *** +41-1-4452370 ------=_NextPart_000_0009_01BFE431.DC8E31A0 Content-Type: text/plain; name="exec-patchfile.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="exec-patchfile.txt" --- Commandline.java.orig Sun Jul 02 14:07:38 2000 +++ Commandline.java Wed Jun 07 16:45:38 2000 @@ -0,0 +1,207 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software = itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software + * Foundation" must not be used to endorse or promote products = derived + * from this software without prior written permission. For written + * permission, please contact halljames@example.net. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +package org.apache.tools.ant.taskdefs.optional; + +import org.apache.tools.ant.BuildException; +import java.util.Vector; +import java.util.StringTokenizer; + + +/** + * Commandline objects help handling command lines specifying processes = to + * execute. + * + * The class can be used to define a command line as nested elements or = as a + * helper to define a command line by an application. + * <p> + * <code> + * &lt;someelement&gt;<br> + * &nbsp;&nbsp;&lt;acommandline = executable=3D"/executable/to/run"&gt;<br> + * &nbsp;&nbsp;&nbsp;&nbsp;&lt;argument value=3D"argument 1" /&gt;<br> + * &nbsp;&nbsp;&nbsp;&nbsp;&lt;argument line=3D"argument_1 argument_2 = argument_3" /&gt;<br> + * &nbsp;&nbsp;&nbsp;&nbsp;&lt;argument value=3D"argument 4" /&gt;<br> + * &nbsp;&nbsp;&lt;/acommandline&gt;<br> + * &lt;/someelement&gt;<br> + * </code> + * The element <code>someelement</code> must provide a method + * <code>createAcommandline</code> which returns an instance of this = class. + * + * @author halljames@example.net + */ +public class Commandline { + + private Vector definition =3D new Vector(); + private String executable =3D null; + private Argument argument =3D null; + + /** + * Used for nested xml command line definitions. + */ + public class Argument { + + /** + * Sets a single commandline argument. + * + * @param value a single commandline argument. + */ + public void setValue(String value) { + Commandline.this.addValue(value); + } + + /** + * Line to split into several commandline arguments. + * + * @param line line to split into several commandline arguments + */ + public void setLine(String line) { + Commandline.this.addLine(translateCommandline(line)); + } + } + + + /** + * Creates an argument object. + * Each commandline object has at most one instance of the argument = class. + * @return the argument object. + */ + public Argument createArgument() { + if (argument =3D=3D null) { + argument =3D new Argument(); + } + return argument; + } + + + /** + * Sets the executable to run. + */ + public void setExecutable(String executable) { + if (executable =3D=3D null || executable.length() =3D=3D 0) = return; + this.executable =3D executable; + } + + + public String getExecutable() { + return executable; + } + + + public void addValue(String value) { + if (value =3D=3D null || value.length() =3D=3D 0) return; + definition.addElement(value); + } + + + public void addLine(String[] line) { + for (int i=3D0; i < line.length; i++) { + createArgument().setValue(line[i]); + } + } + + + /** + * Returns the executable and all defined arguments. + */ + public String[] getCommandline() { + if (executable =3D=3D null) return getArguments(); + final String[] args =3D getArguments(); + final String[] result =3D new String[args.length+1]; + result[0] =3D executable; + System.arraycopy(args, 0, result, 1, args.length); + return result; + } + + + /** + * Returns all arguments defined by <code>addLine</code>, + * <code>addValue</code> or the argument object. + */ + public String[] getArguments() { + final String [] result; + result =3D new String[definition.size()]; + definition.copyInto(result); + return result; + } + + + public String toString() { + return toString(getCommandline()); + } + + public static String toString(String [] line) { + // empty path return empty string + if (line.length =3D=3D 0) return ""; + + // path containing one or more elements + final StringBuffer result =3D new StringBuffer(line[0]); + for (int i=3D1; i < line.length; i++) { + result.append(' '); + result.append(line[i]); + } + return result.toString(); + } + + + public static String[] translateCommandline(String to_process) { + // Runtime uses the same tokenizer. + final StringTokenizer token =3D new = StringTokenizer(to_process); + + final Commandline result =3D new Commandline(); + while (token.hasMoreTokens()) { + result.addValue(token.nextToken()); + } + return result.getArguments(); + } +} --- CommandlineJava.java.orig Sun Jul 02 14:07:46 2000 +++ CommandlineJava.java Fri Jun 09 13:57:38 2000 @@ -0,0 +1,78 @@ + +package org.apache.tools.ant.taskdefs.optional; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Path; +import org.apache.tools.ant.Project; + +public class CommandlineJava { + + private Commandline vmCommand =3D new Commandline(); + private Commandline javaCommand =3D new Commandline(); + private Path classpath =3D new Path(); + private String vmVersion; + + + public CommandlineJava() { + setVm("java"); + setVmversion(Project.getJavaVersion()); + } + + public Commandline.Argument createArgument() { + return javaCommand.createArgument(); + } + + public Commandline.Argument createVmArgument() { + return vmCommand.createArgument(); + } + + public void setVm(String vm) { + vmCommand.setExecutable(vm); + } + + public void setVmversion(String value) { + vmVersion =3D value; + } + + public void setClassname(String classname) { + javaCommand.setExecutable(classname); + } + + public Path createClasspath() { + return classpath; + } + + public String getVmversion() { + return vmVersion; + } + + public String[] getCommandline() { + final Commandline result =3D new Commandline(); + result.addLine(vmCommand.getCommandline()); + final String classpath =3D this.classpath.toString(); + if (classpath.length() > 0) { + result.createArgument().setValue("-classpath"); + result.createArgument().setValue(classpath); + } + result.addLine(javaCommand.getCommandline()); + return result.getCommandline(); + } + + + public String toString() { + String[] list =3D getCommandline(); + + // empty path return empty string + if (list.length =3D=3D 0) return ""; + + // path containing one or more elements + final StringBuffer result =3D new StringBuffer(list[0]); + for (int i=3D1; i < list.length; i++) { + result.append(' '); + result.append(list[i]); + } + + return result.toString(); + } + +} --- Execute.java.orig Sun Jul 02 14:07:58 2000 +++ Execute.java Wed Jun 07 16:45:38 2000 @@ -0,0 +1,165 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software = itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software + * Foundation" must not be used to endorse or promote products = derived + * from this software without prior written permission. For written + * permission, please contact halljames@example.net. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +package org.apache.tools.ant.taskdefs.optional; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + + +/** + * Runs an external program. + * + * @author halljames@example.net + */ +public class Execute { + + /** Invalid exit code. **/ + public final static int INVALID =3D Integer.MAX_VALUE; + + private String[] cmdl =3D null; + private int exitValue =3D INVALID; + private ExecuteStreamHandler streamHandler; + private ExecuteWatchdog watchdog; + + + /** + * Creates a new execute object using = <code>PumpStreamHandler</code> for + * stream handling. + */ + public Execute() { + this(new PumpStreamHandler(), null); + } + + + /** + * Creates a new execute object. + * + * @param streamHandler the stream handler used to handle the input = and + * output streams of the subprocess. + * @param watchdog a watchdog for the subprocess or = <code>null</code> to + * to disable a timeout for the subprocess. + */ + public Execute(ExecuteStreamHandler streamHandler, ExecuteWatchdog = watchdog) { + this.streamHandler =3D streamHandler; + this.watchdog =3D watchdog; + } + + + /** + * Returns the commandline used to create a subprocess. + * + * @return the commandline used to create a subprocess + */ + public String[] getCommandline() { + return cmdl; + } + + + /** + * Sets the commandline of the subprocess to launch. + * + * @param commandline the commandline of the subprocess to launch + */ + public void setCommandline(String[] commandline) { + cmdl =3D commandline; + } + + + /** + * Runs a process defined by the command line and returns its exit = status. + * + * @return the exit status of the subprocess or = <code>INVALID</code> + * @exception java.io.IOExcpetion The exception is thrown, if = launching + * of the subprocess failed + */ + public int execute() throws IOException { + final Process process =3D exec(); + try { + = streamHandler.setProcessInputStream(process.getOutputStream()); + = streamHandler.setProcessOutputStream(process.getInputStream()); + = streamHandler.setProcessErrorStream(process.getErrorStream()); + } catch (IOException e) { + process.destroy(); + throw e; + } + streamHandler.start(); + if (watchdog !=3D null) watchdog.start(process); + waitFor(process); + if (watchdog !=3D null) watchdog.stop(); + streamHandler.stop(); + return getExitValue(); + } + + + protected Process exec() throws IOException { + return Runtime.getRuntime().exec(getCommandline()); + } + + protected void waitFor(Process process) { + try { + process.waitFor(); + setExitValue(process.exitValue()); + } catch (InterruptedException e) {} + } + + protected void setExitValue(int value) { + exitValue =3D value; + } + + protected int getExitValue() { + return exitValue; + } +} --- ExecuteJava.java.orig Sun Jul 02 14:08:06 2000 +++ ExecuteJava.java Wed Jun 07 16:45:38 2000 @@ -0,0 +1,41 @@ + +package org.apache.tools.ant.taskdefs.optional; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Path; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class ExecuteJava { + + private Commandline javaCommand =3D null; + + public void setJavaCommand(Commandline javaCommand) { + this.javaCommand =3D javaCommand; + } + + public void execute() throws BuildException{ + final String classname =3D javaCommand.getExecutable(); + final Object[] argument =3D { javaCommand.getArguments() }; + final Class[] param =3D { argument[0].getClass() }; + try { + final Class target =3D Class.forName(classname); + final Method main =3D target.getMethod("main", param); + main.invoke(null, argument); + } catch (NullPointerException e) { + throw new BuildException("Could not find main() method in " = + classname); + } catch (ClassNotFoundException e) { + throw new BuildException("Could not find " + classname + ". = Make sure you have it in your classpath"); + } catch (InvocationTargetException e) { + Throwable t =3D e.getTargetException(); + if (!(t instanceof SecurityException)) { + throw new BuildException(t.toString()); + } + // else ignore because the security exception is thrown + // if the invoked application tried to call System.exit() + } catch (Exception e) { + throw new BuildException(e.toString()); + } + } +} \ No newline at end of file --- ExecuteStreamHandler.java.orig Sun Jul 02 14:08:18 2000 +++ ExecuteStreamHandler.java Wed Jun 07 16:45:38 2000 @@ -0,0 +1,100 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software = itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software + * Foundation" must not be used to endorse or promote products = derived + * from this software without prior written permission. For written + * permission, please contact halljames@example.net. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ + +package org.apache.tools.ant.taskdefs.optional; + +import java.io.InputStream; +import java.io.IOException; +import java.io.OutputStream; + +/** + * Used by <code>Execute</code> to handle input and output stream of + * subprocesses. + * + * @author halljames@example.net + */ +public interface ExecuteStreamHandler { + + /** + * Install a handler for the input stream of the subprocess. + * + * @param os output stream to write to the standard input stream of = the + * subprocess + */ + public void setProcessInputStream(OutputStream os) throws = IOException; + + /** + * Install a handler for the error stream of the subprocess. + * + * @param is input stream to read from the error stream from the = subprocess + */ + public void setProcessErrorStream(InputStream is) throws = IOException; + + /** + * Install a handler for the output stream of the subprocess. + * + * @param is input stream to read from the error stream from the = subprocess + */ + public void setProcessOutputStream(InputStream is) throws = IOException; + + /** + * Start handling of the streams. + */ + public void start() throws IOException; + + /** + * Stop handlin of the streams - will not be restarted. + */ + public void stop(); +} --- ExecuteWatchdog.java.orig Sun Jul 02 14:08:30 2000 +++ ExecuteWatchdog.java Tue Jun 20 16:32:36 2000 @@ -0,0 +1,136 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software = itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software + * Foundation" must not be used to endorse or promote products = derived + * from this software without prior written permission. For written + * permission, please contact halljames@example.net. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL,
{'source': 'Apache Software Foundation Public Mail Archives'}