Browse Source

rmic's sourcebase is broken. PR 48970.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@927494 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 15 years ago
parent
commit
3d77ed2e09
3 changed files with 32 additions and 1 deletions
  1. +3
    -0
      WHATSNEW
  2. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Rmic.java
  3. +27
    -0
      src/tests/antunit/taskdefs/rmic-test.xml

+ 3
- 0
WHATSNEW View File

@@ -68,6 +68,9 @@ Fixed bugs:
target if "ant -p" failed.
Bugzilla Report 48980

* <rmic>'s sourcebase attribute was broken.
Bugzilla Report 48970

Other changes:
--------------



+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/Rmic.java View File

@@ -705,7 +705,8 @@ public class Rmic extends MatchingTask {
continue;
}
String sourceFileName = StringUtils.removeSuffix(generatedFile,
".class");
".class")
+ ".java";

File oldFile = new File(baseDir, sourceFileName);
if (!oldFile.exists()) {


+ 27
- 0
src/tests/antunit/taskdefs/rmic-test.xml View File

@@ -76,4 +76,31 @@ public class Adapter implements RmicAdapter {
</rmic>
<au:assertLogContains text="adapter called"/>
</target>

<target name="testSourceBase"
description="https://issues.apache.org/bugzilla/show_bug.cgi?id=48970">
<mkdir dir="${input}/org/example"/>
<mkdir dir="${output}"/>
<echo file="${input}/org/example/Foo.java"><![CDATA[
package org.example;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Foo extends Remote {
long bar() throws RemoteException ;
}]]></echo>
<echo file="${input}/org/example/FooImpl.java"><![CDATA[
package org.example;
import java.rmi.RemoteException;
public class FooImpl implements Foo {
public long bar() throws RemoteException {
return 0;
}
}]]></echo>
<javac srcdir="${input}" destdir="${output}"/>
<rmic sourcebase="${input}" base="${output}">
<include name="**/*Impl.class"/>
</rmic>
<au:assertFileExists file="${input}/org/example/FooImpl_Stub.java"/>
<au:assertFileDoesntExist file="${output}/org/example/FooImpl_Stub.java"/>
</target>
</project>

Loading…
Cancel
Save