Bug 48970 - Rmic task sourcebase attribute doesn't work as expected
Summary: Rmic task sourcebase attribute doesn't work as expected
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.8.0
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: 1.8.1
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-23 17:47 UTC by Xiang Shen
Modified: 2010-03-25 16:45 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xiang Shen 2010-03-23 17:47:19 UTC
When specified sourcebase for rmic, the generated source files are not moved to the sourcebase directory as expected. For example, /tmp/c will be empty after the following rmic task.

<rmic base="${project.java.classes}" sourcebase="/tmp/c" iiop="true" verify="true" classpathref="compile.classpath"/>

However, it works as expected with Ant 1.7.0 and 1.7.1. 

After looking at the Ant 1.8.0 source, it appears sourceFileName didn't get the suffix '.java' appended:

707     String sourceFileName = StringUtils.removeSuffix(generatedFile,
708                                                      ".class");
709 
710     File oldFile = new File(baseDir, sourceFileName);

And in the Ant 1.7.0 source, '.java' is appended to the sourceFileName at line 599 as following:

598    final int pos = generatedFile.length() - ".class".length();
599    String sourceFileName =
600          generatedFile.substring(0, pos) + ".java";
601 
602    File oldFile = new File(baseDir, sourceFileName);
Comment 1 Stefan Bodewig 2010-03-25 16:45:24 UTC
fixed with svn revision 927494

Thanks!