From d5f9462fd57f94e075006e626f2102e5c7ac6ba0 Mon Sep 17 00:00:00 2001
From: Conor MacNeill
Date: Wed, 18 Jul 2001 14:03:34 +0000
Subject: [PATCH] Linked the compiler used by ejbjar to the build.compiler
property. This linking can be overidden by either supplying a value to the
compiler attribute or setting that attribute to "default", in which case
ejbc's default compiler choise will be used.
PR: 1146
Suggested by: David Ventimiglia
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269361 13f79535-47bb-0310-9956-ffa450edef68
---
docs/manual/OptionalTasks/ejb.html | 6 +++++-
.../optional/ejb/WeblogicDeploymentTool.java | 19 ++++++++++++++++---
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/docs/manual/OptionalTasks/ejb.html b/docs/manual/OptionalTasks/ejb.html
index 060b2cbb3..1346ed8f9 100644
--- a/docs/manual/OptionalTasks/ejb.html
+++ b/docs/manual/OptionalTasks/ejb.html
@@ -777,7 +777,11 @@ define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml.
This allows for the selection of a different compiler
to be used for the compilation of the generated Java
files. This could be set, for example, to Jikes to
- compile with the Jikes compiler. |
+ compile with the Jikes compiler. If this is not set
+ and the build.compiler
property is set
+ to jikes, the Jikes compiler will be used. If this
+ is not desired, the value "default
"
+ may be given to use the default compiler
No |
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 6d5451ad5..a62a8d1a7 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
@@ -90,6 +90,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
protected static final String DEFAULT_WL60_DTD_LOCATION
= "/weblogic/ejb20/dd/xml/weblogic600-ejb-jar.dtd";
+ protected static final String DEFAULT_COMPILER = "default";
+
protected static final String WL_DD = "weblogic-ejb-jar.xml";
protected static final String WL_CMP_DD = "weblogic-cmp-rdbms-jar.xml";
@@ -421,9 +423,20 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
if (keepgenerated) {
javaTask.createArg().setValue("-keepgenerated");
}
- if (compiler != null) {
- javaTask.createArg().setValue("-compiler");
- javaTask.createArg().setValue(compiler);
+ if (compiler == null) {
+ // try to use the compiler specified by build.compiler. Right now we are just going
+ // to allow Jikes
+ String buildCompiler = getTask().getProject().getProperty("build.compiler");
+ if (buildCompiler.equals("jikes")) {
+ javaTask.createArg().setValue("-compiler");
+ javaTask.createArg().setValue("jikes");
+ }
+ }
+ else {
+ if (!compiler.equals(DEFAULT_COMPILER)) {
+ javaTask.createArg().setValue("-compiler");
+ javaTask.createArg().setValue(compiler);
+ }
}
javaTask.createArg().setValue(sourceJar.getPath());
javaTask.createArg().setValue(destJar.getPath());