From 8d45bd52391fcddf78ce7e95432043da974d4cf9 Mon Sep 17 00:00:00 2001 From: Ryan Heaton Date: Wed, 4 Dec 2013 16:53:53 -0700 Subject: [PATCH] updating enunciate task to also support java 'source' and 'target' versions --- .../enunciate/main/EnunciateTask.java | 28 +++++++++++++++++++ documentation/executables.html | 10 +++++++ 2 files changed, 38 insertions(+) diff --git a/core/src/main/java/org/codehaus/enunciate/main/EnunciateTask.java b/core/src/main/java/org/codehaus/enunciate/main/EnunciateTask.java index 253eb3fd0..84847cb77 100644 --- a/core/src/main/java/org/codehaus/enunciate/main/EnunciateTask.java +++ b/core/src/main/java/org/codehaus/enunciate/main/EnunciateTask.java @@ -57,6 +57,8 @@ public class EnunciateTask extends MatchingTask { private File scratchDir; private File gwtHome; private File flexHome; + private String javacSourceVersion = null; + private String javacTargetVersion = null; private Enunciate.Target target; private final ArrayList exports = new ArrayList(); private final ArrayList javacArguments = new ArrayList(); @@ -147,6 +149,14 @@ public void execute() throws BuildException { proxy.setTarget(this.target); } + if (this.javacSourceVersion != null) { + proxy.setJavacSourceVersion(this.javacSourceVersion); + } + + if (this.javacTargetVersion != null) { + proxy.setJavacTargetVersion(this.javacTargetVersion); + } + for (Export export : exports) { proxy.addExport(export.getArtifactId(), export.getDestination()); } @@ -305,6 +315,24 @@ public void setCompileDebugInfo(boolean compileDebugInfo) { this.compileDebugInfo = compileDebugInfo; } + /** + * javac -source version parameter + * + * @param javacSourceVersion javac -source version parameter + */ + public void setJavacSourceVersion(String javacSourceVersion) { + this.javacSourceVersion = javacSourceVersion; + } + + /** + * javac -target version parameter + * + * @param javacTargetVersion javac -target version parameter + */ + public void setJavacTargetVersion(String javacTargetVersion) { + this.javacTargetVersion = javacTargetVersion; + } + /** * The classpath to use to enunciate. * diff --git a/documentation/executables.html b/documentation/executables.html index a41594e44..db0de49bc 100644 --- a/documentation/executables.html +++ b/documentation/executables.html @@ -413,6 +413,16 @@

Enunciate Task Attributes

The reference to the classpath to use to Enunciate (used to find modules, invoke APT, and copy jars for building the war). No; Defaults to the system classpath + + javacSourceVersion + String + javac -source version parameter + + + javacTargetVersion + String + javac -target version parameter + compileDebugInfo Whether to compile with debug info.