Browse Source

Prevent <ejbjar> Borland implementation

from being blocked by java2iiop warning messages
PR: 19385
Submitted by: Benoit Moussaud (benoit dot moussaud at criltelecom dot com)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274680 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 22 years ago
parent
commit
1a12c40a4c
3 changed files with 40 additions and 13 deletions
  1. +4
    -0
      WHATSNEW
  2. +7
    -1
      docs/manual/OptionalTasks/BorlandEJBTasks.html
  3. +29
    -12
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java

+ 4
- 0
WHATSNEW View File

@@ -161,6 +161,10 @@ Fixed bugs:
of FileUtils#createTempFile instead of the destination dir of fixcrlf. of FileUtils#createTempFile instead of the destination dir of fixcrlf.
Bugzilla Report 20870. Bugzilla Report 20870.


* <ejbjar> implementation for Borland.
Prevent the task from being blocked by error messages coming from java2iiop.
Bugzilla Report 19385.

Other changes: Other changes:
-------------- --------------
* Six new Clearcase tasks added. * Six new Clearcase tasks added.


+ 7
- 1
docs/manual/OptionalTasks/BorlandEJBTasks.html View File

@@ -89,6 +89,12 @@
</td> </td>
<td align="center" valign="middle" width="62">No, defaults to 4</td> <td align="center" valign="middle" width="62">No, defaults to 4</td>
</tr> </tr>
<tr>
<td valign="top" width="63">java2iiopParams </td>
<td valign="top" width="915">If filled, the params are added to the java2iiop command (ex: -no_warn_missing_define)</td>
<td align="center" valign="middle" width="62">no</td>
</tr>

</table> </table>


<h3>Examples</h3> <h3>Examples</h3>
@@ -109,7 +115,7 @@ The verify phase is turned on and the generate client phase as well.
</pre> </pre>


<h3>&nbsp;</h3> <h3>&nbsp;</h3>
<p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
<p align="center">Copyright &copy; 2001-2003 Apache Software Foundation. All rights
Reserved.</p> Reserved.</p>


</body> </body>


+ 29
- 12
src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java View File

@@ -1,7 +1,7 @@
/* /*
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved. * reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -136,6 +136,9 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
/** Instance variable that determines whether the debug mode is on */ /** Instance variable that determines whether the debug mode is on */
private boolean java2iiopdebug = false; private boolean java2iiopdebug = false;


/** store additional param for java2iiop command used to build EJB Stubs */
private String java2iioparams = null;

/** Instance variable that determines whetger the client jar file is generated */ /** Instance variable that determines whetger the client jar file is generated */
private boolean generateclient = false; private boolean generateclient = false;


@@ -212,6 +215,16 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
this.version = version; this.version = version;
} }


/**
* If filled, the params are added to the java2iiop command.
* (ex: -no_warn_missing_define)
* @param params additional params for java2iiop
*/
public void setJava2iiopParams(String params) {
this.java2iioparams = params;
}


protected DescriptorHandler getBorlandDescriptorHandler(final File srcDir) { protected DescriptorHandler getBorlandDescriptorHandler(final File srcDir) {
DescriptorHandler handler = DescriptorHandler handler =
new DescriptorHandler(getTask(), srcDir) { new DescriptorHandler(getTask(), srcDir) {
@@ -405,7 +418,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
//debug ? //debug ?
if (java2iiopdebug) { if (java2iiopdebug) {
commandline.createArgument().setValue("-VBJdebug"); commandline.createArgument().setValue("-VBJdebug");
} // end of if ()
}
//set the classpath //set the classpath
commandline.createArgument().setValue("-VBJclasspath"); commandline.createArgument().setValue("-VBJclasspath");
commandline.createArgument().setPath(getCombinedClasspath()); commandline.createArgument().setPath(getCombinedClasspath());
@@ -413,6 +426,13 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
commandline.createArgument().setValue("-list_files"); commandline.createArgument().setValue("-list_files");
//no TIE classes //no TIE classes
commandline.createArgument().setValue("-no_tie"); commandline.createArgument().setValue("-no_tie");
if ( java2iioparams != null) {
log("additional "+java2iioparams +" to java2iiop " ,0);
commandline.createArgument().setValue(java2iioparams);
}

//root dir //root dir
commandline.createArgument().setValue("-root_dir"); commandline.createArgument().setValue("-root_dir");
commandline.createArgument().setValue(getConfig().srcDir.getAbsolutePath()); commandline.createArgument().setValue(getConfig().srcDir.getAbsolutePath());
@@ -421,7 +441,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
//add the home class //add the home class
while (ithomes.hasNext()) { while (ithomes.hasNext()) {
commandline.createArgument().setValue(ithomes.next().toString()); commandline.createArgument().setValue(ithomes.next().toString());
} // end of while ()
}


try { try {
log("Calling java2iiop", Project.MSG_VERBOSE); log("Calling java2iiop", Project.MSG_VERBOSE);
@@ -456,8 +476,8 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
String home = toClass(clazz); String home = toClass(clazz);
homes.add(home); homes.add(home);
log(" Home " + home, Project.MSG_VERBOSE); log(" Home " + home, Project.MSG_VERBOSE);
} // end of if ()
} // end of while ()
}
}


buildBorlandStubs(homes.iterator()); buildBorlandStubs(homes.iterator());


@@ -513,15 +533,12 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
BufferedReader reader = new BufferedReader(new InputStreamReader(is)); BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String javafile; String javafile;
while ((javafile = reader.readLine()) != null) { while ((javafile = reader.readLine()) != null) {
log("buffer:" + javafile, Project.MSG_DEBUG);
if (javafile.endsWith(".java")) { if (javafile.endsWith(".java")) {
String classfile = toClassFile(javafile); String classfile = toClassFile(javafile);
String key = classfile.substring(getConfig().srcDir.getAbsolutePath().length() + 1); String key = classfile.substring(getConfig().srcDir.getAbsolutePath().length() + 1);
log(" generated : " + classfile, Project.MSG_DEBUG);
log(" key : " + key, Project.MSG_DEBUG);
_genfiles.put(key, new File(classfile)); _genfiles.put(key, new File(classfile));
} // end of if ()
} // end of while ()
}
}
reader.close(); reader.close();
} catch (Exception e) { } catch (Exception e) {
String msg = "Exception while parsing java2iiop output. Details: " + e.toString(); String msg = "Exception while parsing java2iiop output. Details: " + e.toString();
@@ -533,8 +550,8 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe
BufferedReader reader = new BufferedReader(new InputStreamReader(is)); BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String s = reader.readLine(); String s = reader.readLine();
if (s != null) { if (s != null) {
log("[java2iiop] " + s, Project.MSG_DEBUG);
} // end of if ()
log("[java2iiop] " + s, Project.MSG_ERR);
}
} }
} }



Loading…
Cancel
Save