Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@jakarta.apache.org Received: (qmail 13077 invoked by uid 500); 1 Aug 2001 07:36:36 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: ant-dev@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 13068 invoked from network); 1 Aug 2001 07:36:36 -0000 Date: 1 Aug 2001 07:36:27 -0000 Message-ID: <20010801073627.17854.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: ant-dev@jakarta.apache.org Cc: Subject: [Bug 2943] New: - rmic core task deletes generated source if sourcebase=base X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2943 *** shadow/2943 Wed Aug 1 00:36:27 2001 --- shadow/2943.tmp.17849 Wed Aug 1 00:36:27 2001 *************** *** 0 **** --- 1,66 ---- + +============================================================================+ + | rmic core task deletes generated source if sourcebase=base | + +----------------------------------------------------------------------------+ + | Bug #: 2943 Product: Ant | + | Status: NEW Version: 1.3 | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Windows NT/2K | + | Priority: Other Component: Core tasks | + +----------------------------------------------------------------------------+ + | Assigned To: ant-dev@jakarta.apache.org | + | Reported By: jon@nohorizon.net | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + Overview Description + + The rmic core task has a 'sourcebase' option which passes + the '-keepgenerated' option to rmic. It also moves the + generated source to a directory of your choice. + + If you want to keep the generated source in the same place + as the stubs & skels (ie, sourcebase=base), Ant will + delete the generated source when rmic completes. + + Steps to reproduce + + + + or even + + + + Actual Results + + Run Ant - while rmic is executing, you can see the generated .java + files appear with the .classes. When rmic completes, the .java files + disappear. (If rmic completes quickly you may miss the .java files). + + Expected Results + + The .java generated source in the same place as the stubs & skels. + If sourcebase!=base, Ant corrently moves and preserves the generated + source. + + What appears to be happening + + The method org.apache.tools.ant.taskdefs.Rmic.moveGeneratedFile() + first copies the file to the new location, then deletes the old + copy. This strategy fails if the destination is the same as the + source directory. + + Suggested fixes + + 1) Make moveGeneratedFile() check if the baseDir and sourceBaseFile + parameters are equivalent. If they are, return without doing the + move. I'm not sure if Ant processes '../../' type relative dirs, + so it may not be a simply compare (although that would help). + + 2) Add a separate 'keepgenerated' option to the rmic core task that + doesn't try to move the files after generation. \ No newline at end of file