git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@805320 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -183,6 +183,7 @@ Mariusz Nowostawski | |||||
| Mark Hecker | Mark Hecker | ||||
| Mark Salter | Mark Salter | ||||
| Mark R. Diggory | Mark R. Diggory | ||||
| Mark A. Ziesemer | |||||
| Martijn Kruithof | Martijn Kruithof | ||||
| Martin Landers | Martin Landers | ||||
| Martin Poeschl | Martin Poeschl | ||||
| @@ -839,6 +839,10 @@ Other changes: | |||||
| * A new islastmodified condition can check the last modified date of | * A new islastmodified condition can check the last modified date of | ||||
| resources. | resources. | ||||
| * <rmic> has a new destDir attribute that allows generated files to | |||||
| be written to a different location than the original classes. | |||||
| Bugzilla Report 20699. | |||||
| Changes from Ant 1.7.0 TO Ant 1.7.1 | Changes from Ant 1.7.0 TO Ant 1.7.1 | ||||
| ============================================= | ============================================= | ||||
| @@ -756,6 +756,11 @@ | |||||
| <middle>R.</middle> | <middle>R.</middle> | ||||
| <last>Diggory</last> | <last>Diggory</last> | ||||
| </name> | </name> | ||||
| <name> | |||||
| <first>Mark</first> | |||||
| <middle>A.</middle> | |||||
| <last>Ziesemer</last> | |||||
| </name> | |||||
| <name> | <name> | ||||
| <first>Martijn</first> | <first>Martijn</first> | ||||
| <last>Kruithof</last> | <last>Kruithof</last> | ||||
| @@ -79,8 +79,14 @@ please consult miniRMI's documentation to learn how to use it.</p> | |||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td valign="top">base</td> | <td valign="top">base</td> | ||||
| <td valign="top">the location to store the compiled files. | |||||
| Also serves as the parent directory for any non-Fileset includes, etc. | |||||
| (This functionality has remained unchanged.)</td> | |||||
| <td valign="top" align="center" rowspan="2"><a href="#footnote-1">*1</a></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td valign="top">destdir</td> | |||||
| <td valign="top">the location to store the compiled files.</td> | <td valign="top">the location to store the compiled files.</td> | ||||
| <td valign="top" align="center">Yes</td> | |||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td valign="top">classname</td> | <td valign="top">classname</td> | ||||
| @@ -219,6 +225,21 @@ please consult miniRMI's documentation to learn how to use it.</p> | |||||
| <td align="center" valign="top">No</td> | <td align="center" valign="top">No</td> | ||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| <p><a name="footnote-1">*1</a>: | |||||
| <ul> | |||||
| <li>Maintaining compatibility, <code>base</code>, when specified by | |||||
| itself, serves as both the parent directory for any source files | |||||
| AND the output directory.</li> | |||||
| <li><code>destdir</code> can be used to specify the output | |||||
| directory, allowing for <code>base</code> to be used as the parent | |||||
| directory for any source files.</li> | |||||
| <li>At least one of either <code>base</code> or <code>destdir</code> | |||||
| must be specified and exist, or a runtime error will | |||||
| occur.</li> | |||||
| </ul> | |||||
| </p> | |||||
| <h3>Parameters specified as nested elements</h3> | <h3>Parameters specified as nested elements</h3> | ||||
| <h4>classpath and extdirs</h4> | <h4>classpath and extdirs</h4> | ||||
| <p><code>Rmic</code>'s <i>classpath</i> and <i>extdirs</i> attributes are <a | <p><code>Rmic</code>'s <i>classpath</i> and <i>extdirs</i> attributes are <a | ||||
| @@ -19,15 +19,18 @@ | |||||
| <property name="rmic.dir" location="." /> | <property name="rmic.dir" location="." /> | ||||
| <property name="src.dir" location="${rmic.dir}/src"/> | <property name="src.dir" location="${rmic.dir}/src"/> | ||||
| <property name="build.dir" location="${rmic.dir}/build"/> | |||||
| <property name="build.dir" location="${java.io.tmpdir}/build"/> | |||||
| <property name="dest.dir" location="${java.io.tmpdir}/dest"/> | |||||
| <target name="teardown"> | <target name="teardown"> | ||||
| <delete dir="${build.dir}"/> | <delete dir="${build.dir}"/> | ||||
| <delete dir="${dest.dir}"/> | |||||
| </target> | </target> | ||||
| <!-- init builds the java source --> | <!-- init builds the java source --> | ||||
| <target name="init" depends="probe-rmic"> | <target name="init" depends="probe-rmic"> | ||||
| <mkdir dir="${build.dir}"/> | <mkdir dir="${build.dir}"/> | ||||
| <mkdir dir="${dest.dir}"/> | |||||
| <javac | <javac | ||||
| destdir="${build.dir}" | destdir="${build.dir}" | ||||
| @@ -50,6 +53,14 @@ | |||||
| /> | /> | ||||
| </presetdef> | </presetdef> | ||||
| <presetdef name="dest-rmic"> | |||||
| <rmic | |||||
| base="${build.dir}" | |||||
| destdir="${dest.dir}" | |||||
| verify="true" | |||||
| includes="**/*.class"/> | |||||
| </presetdef> | |||||
| <macrodef name="assertFileCreated"> | <macrodef name="assertFileCreated"> | ||||
| <attribute name="file" /> | <attribute name="file" /> | ||||
| <sequential> | <sequential> | ||||
| @@ -61,6 +72,17 @@ | |||||
| </sequential> | </sequential> | ||||
| </macrodef> | </macrodef> | ||||
| <macrodef name="assertFileCreatedInDest"> | |||||
| <attribute name="file" /> | |||||
| <sequential> | |||||
| <fail>Not found : ${dest.dir}/@{file} | |||||
| <condition> | |||||
| <not><available file="${dest.dir}/@{file}"/></not> | |||||
| </condition> | |||||
| </fail> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| <macrodef name="assertFileAbsent"> | <macrodef name="assertFileAbsent"> | ||||
| <attribute name="file" /> | <attribute name="file" /> | ||||
| <sequential> | <sequential> | ||||
| @@ -72,6 +94,16 @@ | |||||
| </sequential> | </sequential> | ||||
| </macrodef> | </macrodef> | ||||
| <macrodef name="assertFileAbsentInDest"> | |||||
| <attribute name="file" /> | |||||
| <sequential> | |||||
| <fail>Expected to be missing : ${dest.dir}/@{file} | |||||
| <condition> | |||||
| <available file="${dest.dir}/@{file}"/> | |||||
| </condition> | |||||
| </fail> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| <macrodef name="assertStubCompiled"> | <macrodef name="assertStubCompiled"> | ||||
| <sequential> | <sequential> | ||||
| @@ -79,18 +111,36 @@ | |||||
| </sequential> | </sequential> | ||||
| </macrodef> | </macrodef> | ||||
| <macrodef name="assertStubCompiledInDest"> | |||||
| <sequential> | |||||
| <assertFileCreatedInDest file="RemoteTimestampImpl_Stub.class" /> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| <macrodef name="assertSkelCompiled"> | <macrodef name="assertSkelCompiled"> | ||||
| <sequential> | <sequential> | ||||
| <assertFileCreated file="RemoteTimestampImpl_Skel.class" /> | <assertFileCreated file="RemoteTimestampImpl_Skel.class" /> | ||||
| </sequential> | </sequential> | ||||
| </macrodef> | </macrodef> | ||||
| <macrodef name="assertSkelCompiledInDest"> | |||||
| <sequential> | |||||
| <assertFileCreatedInDest file="RemoteTimestampImpl_Skel.class" /> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| <macrodef name="assertSkelAbsent"> | <macrodef name="assertSkelAbsent"> | ||||
| <sequential> | <sequential> | ||||
| <assertFileAbsent file="RemoteTimestampImpl_Skel.class" /> | <assertFileAbsent file="RemoteTimestampImpl_Skel.class" /> | ||||
| </sequential> | </sequential> | ||||
| </macrodef> | </macrodef> | ||||
| <macrodef name="assertSkelAbsentInDest"> | |||||
| <sequential> | |||||
| <assertFileAbsentInDest file="RemoteTimestampImpl_Skel.class" /> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| <macrodef name="assertBaseCompiled"> | <macrodef name="assertBaseCompiled"> | ||||
| <sequential> | <sequential> | ||||
| <assertStubCompiled /> | <assertStubCompiled /> | ||||
| @@ -98,6 +148,12 @@ | |||||
| </sequential> | </sequential> | ||||
| </macrodef> | </macrodef> | ||||
| <macrodef name="assertBaseCompiledInDest"> | |||||
| <sequential> | |||||
| <assertStubCompiledInDest /> | |||||
| <assertSkelCompiledInDest /> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| <macrodef name="assertAntStubCompiled"> | <macrodef name="assertAntStubCompiled"> | ||||
| <sequential> | <sequential> | ||||
| @@ -105,12 +161,24 @@ | |||||
| </sequential> | </sequential> | ||||
| </macrodef> | </macrodef> | ||||
| <macrodef name="assertAntStubCompiledInDest"> | |||||
| <sequential> | |||||
| <assertFileCreatedInDest file="AntTimestamp_Stub.class"/> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| <macrodef name="assertAntSkelCompiled"> | <macrodef name="assertAntSkelCompiled"> | ||||
| <sequential> | <sequential> | ||||
| <assertFileCreated file="AntTimestamp_Skel.class"/> | <assertFileCreated file="AntTimestamp_Skel.class"/> | ||||
| </sequential> | </sequential> | ||||
| </macrodef> | </macrodef> | ||||
| <macrodef name="assertAntSkelCompiledInDest"> | |||||
| <sequential> | |||||
| <assertFileCreatedInDest file="AntTimestamp_Skel.class"/> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| <macrodef name="assertAntCompiled"> | <macrodef name="assertAntCompiled"> | ||||
| <sequential> | <sequential> | ||||
| <assertAntStubCompiled /> | <assertAntStubCompiled /> | ||||
| @@ -118,6 +186,13 @@ | |||||
| </sequential> | </sequential> | ||||
| </macrodef> | </macrodef> | ||||
| <macrodef name="assertAntCompiledInDest"> | |||||
| <sequential> | |||||
| <assertAntStubCompiledInDest /> | |||||
| <assertAntSkelCompiledInDest /> | |||||
| </sequential> | |||||
| </macrodef> | |||||
| </target> | </target> | ||||
| <target name="probe-rmic"> | <target name="probe-rmic"> | ||||
| @@ -143,32 +218,62 @@ | |||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testDefaultDest" depends="init"> | |||||
| <dest-rmic compiler="default"/> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <target name="testEmpty" depends="init"> | <target name="testEmpty" depends="init"> | ||||
| <base-rmic compiler=""/> | <base-rmic compiler=""/> | ||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testEmptyDest" depends="init"> | |||||
| <dest-rmic compiler=""/> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <target name="testVersion11" depends="init"> | <target name="testVersion11" depends="init"> | ||||
| <base-rmic compiler="default" stubversion="1.1" /> | <base-rmic compiler="default" stubversion="1.1" /> | ||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testVersion11Dest" depends="init"> | |||||
| <dest-rmic compiler="default" stubversion="1.1" /> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <target name="testVersion12" depends="init"> | <target name="testVersion12" depends="init"> | ||||
| <base-rmic compiler="default" stubversion="1.2" /> | <base-rmic compiler="default" stubversion="1.2" /> | ||||
| <assertStubCompiled/> | <assertStubCompiled/> | ||||
| <assertSkelAbsent/> | <assertSkelAbsent/> | ||||
| </target> | </target> | ||||
| <target name="testVersion12Dest" depends="init"> | |||||
| <dest-rmic compiler="default" stubversion="1.2" /> | |||||
| <assertStubCompiledInDest/> | |||||
| <assertSkelAbsentInDest/> | |||||
| </target> | |||||
| <target name="testVersionCompat" depends="init"> | <target name="testVersionCompat" depends="init"> | ||||
| <base-rmic compiler="default" stubversion="compat" /> | <base-rmic compiler="default" stubversion="compat" /> | ||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testVersionCompatDest" depends="init"> | |||||
| <dest-rmic compiler="default" stubversion="compat" /> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <target name="testRmic" if="rmic.present" depends="init"> | <target name="testRmic" if="rmic.present" depends="init"> | ||||
| <base-rmic compiler="sun"/> | <base-rmic compiler="sun"/> | ||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testRmicDest" if="rmic.present" depends="init"> | |||||
| <dest-rmic compiler="sun"/> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <target name="testRmicJArg" if="rmic.present" depends="init"> | <target name="testRmicJArg" if="rmic.present" depends="init"> | ||||
| <base-rmic compiler="sun"> | <base-rmic compiler="sun"> | ||||
| @@ -177,12 +282,26 @@ | |||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testRmicJArgDest" if="rmic.present" depends="init"> | |||||
| <dest-rmic compiler="sun"> | |||||
| <compilerarg value="-J-mx256m" /> | |||||
| </dest-rmic> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <target name="testKaffe" if="kaffe.present" depends="init"> | <target name="testKaffe" if="kaffe.present" depends="init"> | ||||
| <base-rmic | <base-rmic | ||||
| compiler="kaffe" | compiler="kaffe" | ||||
| /> | /> | ||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testKaffeDest" if="kaffe.present" depends="init"> | |||||
| <dest-rmic | |||||
| compiler="kaffe" | |||||
| /> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <!-- weblogic.rmic doesn't work without a global CLASSPATH | <!-- weblogic.rmic doesn't work without a global CLASSPATH | ||||
| <target name="testWlrmic" if="wlrmic.present" depends="init"> | <target name="testWlrmic" if="wlrmic.present" depends="init"> | ||||
| @@ -266,6 +385,13 @@ | |||||
| <assertAntCompiled/> | <assertAntCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testAntClasspathDest" depends="compileAntTimestamp"> | |||||
| <dest-rmic | |||||
| compiler="default" | |||||
| /> | |||||
| <assertAntCompiledInDest/> | |||||
| </target> | |||||
| <target name="testForkingAntClasspath" if="rmic.present" depends="compileAntTimestamp"> | <target name="testForkingAntClasspath" if="rmic.present" depends="compileAntTimestamp"> | ||||
| <base-rmic | <base-rmic | ||||
| compiler="forking" | compiler="forking" | ||||
| @@ -273,6 +399,13 @@ | |||||
| <assertAntCompiled /> | <assertAntCompiled /> | ||||
| </target> | </target> | ||||
| <target name="testForkingAntClasspathDest" if="rmic.present" depends="compileAntTimestamp"> | |||||
| <dest-rmic | |||||
| compiler="forking" | |||||
| /> | |||||
| <assertAntCompiledInDest /> | |||||
| </target> | |||||
| <target name="testDefaultBadClass" depends="init"> | <target name="testDefaultBadClass" depends="init"> | ||||
| <rmic-bad-class compiler="default"/> | <rmic-bad-class compiler="default"/> | ||||
| </target> | </target> | ||||
| @@ -305,6 +438,13 @@ | |||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testXnewDest" if="rmic5.present" unless="rmic6.present" depends="init"> | |||||
| <dest-rmic compiler="sun"> | |||||
| <compilerarg value="-Xnew"/> | |||||
| </dest-rmic> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <target name="testXnewForked" if="rmic5.present" depends="init"> | <target name="testXnewForked" if="rmic5.present" depends="init"> | ||||
| <base-rmic compiler="forking"> | <base-rmic compiler="forking"> | ||||
| <compilerarg value="-Xnew"/> | <compilerarg value="-Xnew"/> | ||||
| @@ -312,21 +452,45 @@ | |||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testXnewForkedDest" if="rmic5.present" depends="init"> | |||||
| <dest-rmic compiler="forking"> | |||||
| <compilerarg value="-Xnew"/> | |||||
| </dest-rmic> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <target name="testXnewCompiler" if="rmic5.present" depends="init"> | <target name="testXnewCompiler" if="rmic5.present" depends="init"> | ||||
| <base-rmic compiler="xnew"> | <base-rmic compiler="xnew"> | ||||
| </base-rmic> | </base-rmic> | ||||
| <assertBaseCompiled/> | <assertBaseCompiled/> | ||||
| </target> | </target> | ||||
| <target name="testXnewCompilerDest" if="rmic5.present" depends="init"> | |||||
| <dest-rmic compiler="xnew"> | |||||
| </dest-rmic> | |||||
| <assertBaseCompiledInDest/> | |||||
| </target> | |||||
| <target name="testIDL" depends="init"> | <target name="testIDL" depends="init"> | ||||
| <base-rmic compiler="default" idl="true"/> | <base-rmic compiler="default" idl="true"/> | ||||
| <assertFileCreated file="RemoteTimestamp.idl"/> | <assertFileCreated file="RemoteTimestamp.idl"/> | ||||
| </target> | </target> | ||||
| <target name="testIDLDest" depends="init"> | |||||
| <dest-rmic compiler="default" idl="true"/> | |||||
| <assertFileCreatedInDest file="RemoteTimestamp.idl"/> | |||||
| </target> | |||||
| <target name="testIIOP" depends="init"> | <target name="testIIOP" depends="init"> | ||||
| <base-rmic compiler="default" iiop="true"/> | <base-rmic compiler="default" iiop="true"/> | ||||
| <assertFileCreated file="_RemoteTimestamp_Stub.class"/> | <assertFileCreated file="_RemoteTimestamp_Stub.class"/> | ||||
| <assertFileCreated file="_RemoteTimestampImpl_Tie.class"/> | <assertFileCreated file="_RemoteTimestampImpl_Tie.class"/> | ||||
| </target> | </target> | ||||
| </project> | |||||
| <target name="testIIOPDest" depends="init"> | |||||
| <dest-rmic compiler="default" iiop="true"/> | |||||
| <assertFileCreatedInDest file="_RemoteTimestamp_Stub.class"/> | |||||
| <assertFileCreatedInDest file="_RemoteTimestampImpl_Tie.class"/> | |||||
| </target> | |||||
| </project> | |||||
| @@ -85,6 +85,7 @@ public class Rmic extends MatchingTask { | |||||
| = "Rmic failed; see the compiler error output for details."; | = "Rmic failed; see the compiler error output for details."; | ||||
| private File baseDir; | private File baseDir; | ||||
| private File destDir; | |||||
| private String classname; | private String classname; | ||||
| private File sourceBase; | private File sourceBase; | ||||
| private String stubVersion; | private String stubVersion; | ||||
| @@ -115,11 +116,11 @@ public class Rmic extends MatchingTask { | |||||
| /** loaded error message */ | /** loaded error message */ | ||||
| public static final String ERROR_LOADING_CAUSED_EXCEPTION = ". Loading caused Exception: "; | public static final String ERROR_LOADING_CAUSED_EXCEPTION = ". Loading caused Exception: "; | ||||
| /** base not exists message */ | /** base not exists message */ | ||||
| public static final String ERROR_NO_BASE_EXISTS = "base does not exist: "; | |||||
| public static final String ERROR_NO_BASE_EXISTS = "base or destdir does not exist: "; | |||||
| /** base not a directory message */ | /** base not a directory message */ | ||||
| public static final String ERROR_NOT_A_DIR = "base is not a directory:"; | |||||
| public static final String ERROR_NOT_A_DIR = "base or destdir is not a directory:"; | |||||
| /** base attribute not set message */ | /** base attribute not set message */ | ||||
| public static final String ERROR_BASE_NOT_SET = "base attribute must be set!"; | |||||
| public static final String ERROR_BASE_NOT_SET = "base or destdir attribute must be set!"; | |||||
| private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | ||||
| @@ -140,11 +141,41 @@ public class Rmic extends MatchingTask { | |||||
| this.baseDir = base; | this.baseDir = base; | ||||
| } | } | ||||
| /** | |||||
| * Sets the base directory to output the generated files. | |||||
| * @param destdir the base directory to output the generated files. | |||||
| * @since Ant 1.8.0 | |||||
| */ | |||||
| public void setDestdir(File destdir) { | |||||
| this.destDir = destdir; | |||||
| } | |||||
| /** | |||||
| * Gets the base directory to output the generated files. | |||||
| * @return the base directory to output the generated files. | |||||
| * @since Ant 1.8.0 | |||||
| */ | |||||
| public File getDestdir() { | |||||
| return this.destDir; | |||||
| } | |||||
| /** | |||||
| * Gets the base directory to output the generated files, | |||||
| * favoring destdir if set, otherwise defaulting to basedir. | |||||
| * @return the actual directory to output to (either destdir or basedir) | |||||
| * @since Ant 1.8.0 | |||||
| */ | |||||
| public File getOutputDir() { | |||||
| if (getDestdir() != null) { | |||||
| return getDestdir(); | |||||
| } | |||||
| return getBase(); | |||||
| } | |||||
| /** | /** | ||||
| * Gets the base directory to output generated class. | * Gets the base directory to output generated class. | ||||
| * @return the location of the compiled files | * @return the location of the compiled files | ||||
| */ | */ | ||||
| public File getBase() { | public File getBase() { | ||||
| return this.baseDir; | return this.baseDir; | ||||
| } | } | ||||
| @@ -526,14 +557,15 @@ public class Rmic extends MatchingTask { | |||||
| * if there's a problem with baseDir or RMIC | * if there's a problem with baseDir or RMIC | ||||
| */ | */ | ||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| if (baseDir == null) { | |||||
| File outputDir = getOutputDir(); | |||||
| if (outputDir == null) { | |||||
| throw new BuildException(ERROR_BASE_NOT_SET, getLocation()); | throw new BuildException(ERROR_BASE_NOT_SET, getLocation()); | ||||
| } | } | ||||
| if (!baseDir.exists()) { | |||||
| throw new BuildException(ERROR_NO_BASE_EXISTS + baseDir, getLocation()); | |||||
| if (!outputDir.exists()) { | |||||
| throw new BuildException(ERROR_NO_BASE_EXISTS + outputDir, getLocation()); | |||||
| } | } | ||||
| if (!baseDir.isDirectory()) { | |||||
| throw new BuildException(ERROR_NOT_A_DIR + baseDir, getLocation()); | |||||
| if (!outputDir.isDirectory()) { | |||||
| throw new BuildException(ERROR_NOT_A_DIR + outputDir, getLocation()); | |||||
| } | } | ||||
| if (verify) { | if (verify) { | ||||
| log("Verify has been turned on.", Project.MSG_VERBOSE); | log("Verify has been turned on.", Project.MSG_VERBOSE); | ||||
| @@ -569,7 +601,7 @@ public class Rmic extends MatchingTask { | |||||
| int fileCount = compileList.size(); | int fileCount = compileList.size(); | ||||
| if (fileCount > 0) { | if (fileCount > 0) { | ||||
| log("RMI Compiling " + fileCount + " class" + (fileCount > 1 ? "es" : "") + " to " | log("RMI Compiling " + fileCount + " class" + (fileCount > 1 ? "es" : "") + " to " | ||||
| + baseDir, Project.MSG_INFO); | |||||
| + outputDir, Project.MSG_INFO); | |||||
| // finally, lets execute the compiler!! | // finally, lets execute the compiler!! | ||||
| if (!adapter.execute()) { | if (!adapter.execute()) { | ||||
| throw new BuildException(ERROR_RMIC_FAILED, getLocation()); | throw new BuildException(ERROR_RMIC_FAILED, getLocation()); | ||||
| @@ -580,14 +612,14 @@ public class Rmic extends MatchingTask { | |||||
| * base directory and sourcebase are the same, the generated | * base directory and sourcebase are the same, the generated | ||||
| * sources are already in place. | * sources are already in place. | ||||
| */ | */ | ||||
| if (null != sourceBase && !baseDir.equals(sourceBase) | |||||
| if (null != sourceBase && !outputDir.equals(sourceBase) | |||||
| && fileCount > 0) { | && fileCount > 0) { | ||||
| if (idl) { | if (idl) { | ||||
| log("Cannot determine sourcefiles in idl mode, ", Project.MSG_WARN); | log("Cannot determine sourcefiles in idl mode, ", Project.MSG_WARN); | ||||
| log("sourcebase attribute will be ignored.", Project.MSG_WARN); | log("sourcebase attribute will be ignored.", Project.MSG_WARN); | ||||
| } else { | } else { | ||||
| for (int j = 0; j < fileCount; j++) { | for (int j = 0; j < fileCount; j++) { | ||||
| moveGeneratedFile(baseDir, sourceBase, (String) compileList.elementAt(j), | |||||
| moveGeneratedFile(outputDir, sourceBase, (String) compileList.elementAt(j), | |||||
| adapter); | adapter); | ||||
| } | } | ||||
| } | } | ||||
| @@ -656,7 +688,7 @@ public class Rmic extends MatchingTask { | |||||
| log("no uptodate test as -always option has been specified", Project.MSG_VERBOSE); | log("no uptodate test as -always option has been specified", Project.MSG_VERBOSE); | ||||
| } else { | } else { | ||||
| SourceFileScanner sfs = new SourceFileScanner(this); | SourceFileScanner sfs = new SourceFileScanner(this); | ||||
| newFiles = sfs.restrict(files, baseDir, baseDir, mapper); | |||||
| newFiles = sfs.restrict(files, baseDir, getOutputDir(), mapper); | |||||
| } | } | ||||
| for (int i = 0; i < newFiles.length; i++) { | for (int i = 0; i < newFiles.length; i++) { | ||||
| String name = newFiles[i].replace(File.separatorChar, '.'); | String name = newFiles[i].replace(File.separatorChar, '.'); | ||||
| @@ -200,7 +200,7 @@ public abstract class DefaultRmicAdapter implements RmicAdapter { | |||||
| Path classpath = getCompileClasspath(); | Path classpath = getCompileClasspath(); | ||||
| cmd.createArgument().setValue("-d"); | cmd.createArgument().setValue("-d"); | ||||
| cmd.createArgument().setFile(attributes.getBase()); | |||||
| cmd.createArgument().setFile(attributes.getOutputDir()); | |||||
| if (attributes.getExtdirs() != null) { | if (attributes.getExtdirs() != null) { | ||||
| cmd.createArgument().setValue("-extdirs"); | cmd.createArgument().setValue("-extdirs"); | ||||
| @@ -58,12 +58,27 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testDefault"); | executeTarget("testDefault"); | ||||
| } | } | ||||
| /** | |||||
| * verify that "default" binds us to the default compiler | |||||
| */ | |||||
| public void testDefaultDest() throws Exception { | |||||
| executeTarget("testDefaultDest"); | |||||
| } | |||||
| /** | /** | ||||
| * verify that "" binds us to the default compiler | * verify that "" binds us to the default compiler | ||||
| */ | */ | ||||
| public void testEmpty() throws Exception { | public void testEmpty() throws Exception { | ||||
| executeTarget("testEmpty"); | executeTarget("testEmpty"); | ||||
| } | } | ||||
| /** | |||||
| * verify that "" binds us to the default compiler | |||||
| */ | |||||
| public void testEmptyDest() throws Exception { | |||||
| executeTarget("testEmptyDest"); | |||||
| } | |||||
| /** | /** | ||||
| * test sun's rmic compiler | * test sun's rmic compiler | ||||
| */ | */ | ||||
| @@ -71,6 +86,13 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testRmic"); | executeTarget("testRmic"); | ||||
| } | } | ||||
| /** | |||||
| * test sun's rmic compiler | |||||
| */ | |||||
| public void testRmicDest() throws Exception { | |||||
| executeTarget("testRmicDest"); | |||||
| } | |||||
| /** | /** | ||||
| * test sun's rmic compiler strips | * test sun's rmic compiler strips | ||||
| * out -J arguments when not forking | * out -J arguments when not forking | ||||
| @@ -79,12 +101,28 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testRmicJArg"); | executeTarget("testRmicJArg"); | ||||
| } | } | ||||
| /** | |||||
| * test sun's rmic compiler strips | |||||
| * out -J arguments when not forking | |||||
| */ | |||||
| public void testRmicJArgDest() throws Exception { | |||||
| executeTarget("testRmicJArgDest"); | |||||
| } | |||||
| /** | /** | ||||
| * A unit test for JUnit | * A unit test for JUnit | ||||
| */ | */ | ||||
| public void testKaffe() throws Exception { | public void testKaffe() throws Exception { | ||||
| executeTarget("testKaffe"); | executeTarget("testKaffe"); | ||||
| } | } | ||||
| /** | |||||
| * A unit test for JUnit | |||||
| */ | |||||
| public void testKaffeDest() throws Exception { | |||||
| executeTarget("testKaffeDest"); | |||||
| } | |||||
| // WLrmic tests don't work | // WLrmic tests don't work | ||||
| /** | /** | ||||
| * test weblogic | * test weblogic | ||||
| @@ -114,6 +152,13 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testForkingAntClasspath"); | executeTarget("testForkingAntClasspath"); | ||||
| } | } | ||||
| /** | |||||
| * test the forking compiler | |||||
| */ | |||||
| public void testForkingAntClasspathDest() throws Exception { | |||||
| executeTarget("testForkingAntClasspathDest"); | |||||
| } | |||||
| /** | /** | ||||
| * test the forking compiler | * test the forking compiler | ||||
| */ | */ | ||||
| @@ -121,6 +166,13 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testAntClasspath"); | executeTarget("testAntClasspath"); | ||||
| } | } | ||||
| /** | |||||
| * test the forking compiler | |||||
| */ | |||||
| public void testAntClasspathDest() throws Exception { | |||||
| executeTarget("testAntClasspathDest"); | |||||
| } | |||||
| /** | /** | ||||
| * A unit test for JUnit | * A unit test for JUnit | ||||
| */ | */ | ||||
| @@ -201,6 +253,14 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testVersion11"); | executeTarget("testVersion11"); | ||||
| } | } | ||||
| /** | |||||
| * test that version 1.1 stubs are good | |||||
| * @throws Exception | |||||
| */ | |||||
| public void testVersion11Dest() throws Exception { | |||||
| executeTarget("testVersion11Dest"); | |||||
| } | |||||
| /** | /** | ||||
| * test that version 1.2 stubs are good | * test that version 1.2 stubs are good | ||||
| * | * | ||||
| @@ -210,6 +270,15 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testVersion12"); | executeTarget("testVersion12"); | ||||
| } | } | ||||
| /** | |||||
| * test that version 1.2 stubs are good | |||||
| * | |||||
| * @throws Exception | |||||
| */ | |||||
| public void testVersion12Dest() throws Exception { | |||||
| executeTarget("testVersion12Dest"); | |||||
| } | |||||
| /** | /** | ||||
| * test that version compat stubs are good | * test that version compat stubs are good | ||||
| * | * | ||||
| @@ -219,6 +288,15 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testVersionCompat"); | executeTarget("testVersionCompat"); | ||||
| } | } | ||||
| /** | |||||
| * test that version compat stubs are good | |||||
| * | |||||
| * @throws Exception | |||||
| */ | |||||
| public void testVersionCompatDest() throws Exception { | |||||
| executeTarget("testVersionCompatDest"); | |||||
| } | |||||
| /** | /** | ||||
| * test that passes -Xnew to sun's rmic. | * test that passes -Xnew to sun's rmic. | ||||
| * | * | ||||
| @@ -228,6 +306,15 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testXnew"); | executeTarget("testXnew"); | ||||
| } | } | ||||
| /** | |||||
| * test that passes -Xnew to sun's rmic. | |||||
| * | |||||
| * @throws Exception | |||||
| */ | |||||
| public void testXnewDest() throws Exception { | |||||
| executeTarget("testXnewDest"); | |||||
| } | |||||
| /** | /** | ||||
| * test that passes -Xnew to sun's rmic running in a different VM. | * test that passes -Xnew to sun's rmic running in a different VM. | ||||
| * | * | ||||
| @@ -237,6 +324,15 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testXnewForked"); | executeTarget("testXnewForked"); | ||||
| } | } | ||||
| /** | |||||
| * test that passes -Xnew to sun's rmic running in a different VM. | |||||
| * | |||||
| * @throws Exception | |||||
| */ | |||||
| public void testXnewForkedDest() throws Exception { | |||||
| executeTarget("testXnewForkedDest"); | |||||
| } | |||||
| /** | /** | ||||
| * test that runs the new xnew compiler adapter. | * test that runs the new xnew compiler adapter. | ||||
| * | * | ||||
| @@ -246,6 +342,15 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testXnewCompiler"); | executeTarget("testXnewCompiler"); | ||||
| } | } | ||||
| /** | |||||
| * test that runs the new xnew compiler adapter. | |||||
| * | |||||
| * @throws Exception | |||||
| */ | |||||
| public void testXnewCompilerDest() throws Exception { | |||||
| executeTarget("testXnewCompilerDest"); | |||||
| } | |||||
| /** | /** | ||||
| * test that verifies that IDL compiles. | * test that verifies that IDL compiles. | ||||
| * | * | ||||
| @@ -255,6 +360,15 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testIDL"); | executeTarget("testIDL"); | ||||
| } | } | ||||
| /** | |||||
| * test that verifies that IDL compiles. | |||||
| * | |||||
| * @throws Exception | |||||
| */ | |||||
| public void testIDLDest() throws Exception { | |||||
| executeTarget("testIDLDest"); | |||||
| } | |||||
| /** | /** | ||||
| * test that verifies that IIOP compiles. | * test that verifies that IIOP compiles. | ||||
| * | * | ||||
| @@ -264,6 +378,15 @@ public class RmicAdvancedTest extends BuildFileTest { | |||||
| executeTarget("testIIOP"); | executeTarget("testIIOP"); | ||||
| } | } | ||||
| /** | |||||
| * test that verifies that IIOP compiles. | |||||
| * | |||||
| * @throws Exception | |||||
| */ | |||||
| public void testIIOPDest() throws Exception { | |||||
| executeTarget("testIIOPDest"); | |||||
| } | |||||
| /** | /** | ||||
| * this little bunny verifies that we can load stuff, and that | * this little bunny verifies that we can load stuff, and that | ||||
| * a failure to execute is turned into a fault | * a failure to execute is turned into a fault | ||||