groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: Allow TargetBytecode to be set in Ant task to all supported versions (1.8 to 1.4) as opposed to only 1.4 and 1.5 (closes #317)
Date Sat, 23 Apr 2016 03:30:50 GMT
Repository: groovy
Updated Branches:
  refs/heads/master b6d5a80b5 -> 7d6170918


Allow TargetBytecode to be set in Ant task to all supported versions (1.8 to 1.4) as opposed
to only 1.4 and 1.5 (closes #317)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/7d617091
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/7d617091
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/7d617091

Branch: refs/heads/master
Commit: 7d617091859fd84136b240ebcd6f4a28b0ae49bc
Parents: b6d5a80
Author: pavel <pavel@192.168.0.6>
Authored: Sat Apr 23 11:16:42 2016 +1000
Committer: paulk <paulk@asert.com.au>
Committed: Sat Apr 23 13:29:16 2016 +1000

----------------------------------------------------------------------
 .../main/java/org/codehaus/groovy/ant/Groovyc.java    | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/7d617091/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
index e77dfc5..7499428 100644
--- a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
+++ b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
@@ -292,20 +292,26 @@ public class Groovyc extends MatchingTask {
     }
 
     /**
-     * Sets the bytecode compatibility mode
+     * Sets the bytecode compatibility mode. The parameter can take
+     * one of the values <tt>1.8</tt>, <tt>1.7</tt>, <tt>1.6</tt>,
<tt>1.5</tt> or <tt>1.4</tt>.
      *
      * @param version the bytecode compatibility mode
      */
     public void setTargetBytecode(String version) {
-        if (CompilerConfiguration.PRE_JDK5.equals(version) || CompilerConfiguration.POST_JDK5.equals(version))
{
-            this.targetBytecode = version;
+        
+        for (String allowedJdk : CompilerConfiguration.ALLOWED_JDKS) {
+            if (allowedJdk.equals(version)) {
+                this.targetBytecode = version;
+            }
         }
     }
 
     /**
      * Retrieves the compiler bytecode compatibility mode.
      *
-     * @return bytecode compatibility mode. Can be either <tt>1.5</tt> or <tt>1.4</tt>.
+     * @return bytecode compatibility mode. Can be one of the values
+     *         <tt>1.8</tt>, <tt>1.7</tt>, <tt>1.6</tt>,
<tt>1.5</tt> or
+     *         <tt>1.4</tt>.
      */
     public String getTargetBytecode() {
         return this.targetBytecode;


Mime
View raw message