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
+
+ <rmic base="directory"
+ sourcebase="directory"
+ classname="com.ClassFile" />
+
+ or even
+
+ <rmic base="."
+ sourcebase="."
+ classname="com.ClassFile" />
+
+ 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
|