From cf01e99f9e236a5e394c1a8106e35668b98f579b Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Mon, 16 Oct 2000 09:41:22 +0000 Subject: [PATCH] Provide access to more ejbc options git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268093 13f79535-47bb-0310-9956-ffa450edef68 --- .../optional/ejb/WeblogicDeploymentTool.java | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java index b846c9afc..e336b386e 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java @@ -79,7 +79,14 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { private Path classpath; /** Instance variable that determines whether generic ejb jars are kept. */ + + private boolean keepgenerated = false; + + private String additionalArgs = ""; + private boolean keepGeneric = false; + + private String compiler = null; /** * Set the classpath to be used for this compilation. @@ -88,6 +95,15 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { this.classpath = classpath; } + /** + * The compiler (switch -compiler) to use + */ + public void setCompiler(String compiler) + { + this.compiler = compiler; + } + + /** * Setter used to store the suffix for the generated weblogic jar file. * @param inString the string to use as the suffix. @@ -103,6 +119,25 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { public void setKeepgeneric(boolean inValue) { this.keepGeneric = inValue; } + + /** + * Sets whether -keepgenerated is passed to ejbc (that is, + * the .java source files are kept). + * @param inValue either 'true' or 'false' + */ + public void setKeepgenerated(String inValue) + { + this.keepgenerated = Boolean.valueOf(inValue).booleanValue(); + } + + /** + * sets some additional args to send to ejbc. + */ + public void setArgs(String args) + { + this.additionalArgs = args; + } + /** * Setter used to store the location of the weblogic DTD. This can be a file on the system @@ -176,7 +211,16 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { org.apache.tools.ant.taskdefs.Java javaTask = null; try { - String args = "-noexit " + sourceJar.getPath() + " " + destJar.getPath(); + String args = additionalArgs; + if (keepgenerated) { + args += " -keepgenerated"; + } + + if (compiler != null) { + args += " -compiler " + compiler; + } + + args += " -noexit " + sourceJar.getPath() + " " + destJar.getPath(); javaTask = (Java) getTask().getProject().createTask("java"); javaTask.setClassname("weblogic.ejbc");