be more specific about compiler options
authoradam <adam@megacz.com>
Mon, 27 Dec 2004 07:31:14 +0000 (07:31 +0000)
committeradam <adam@megacz.com>
Mon, 27 Dec 2004 07:31:14 +0000 (07:31 +0000)
darcs-hash:20041227073114-5007d-9490d552582e0ea916490667c8b897b928d92884.gz

src/org/ibex/tool/Compiler.java

index b802c9e..382cf74 100644 (file)
@@ -168,10 +168,24 @@ public class Compiler {
     public void setSourceDirs(String[] dir) { sourcedirs = dir; }
 
     /** Pass CompilerOptions.VERSION_1_*. A String of form "1.1", ".2", etc. */
-    public void setSource(String v) { settings.put(CompilerOptions.OPTION_Source, v); }
+    public void setSource(String v) {
+       if (v.equals("1.1")) settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_1);
+       else if (v.equals("1.2")) settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_2);
+       else if (v.equals("1.3")) settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
+       else if (v.equals("1.4")) settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
+       else if (v.equals("1.5")) settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
+       else throw new RuntimeException("I have no idea what Java " + v + " is.  Ask David Crawshaw.");
+    }
 
     /** Pass CompilerOptions.VERSION_1_*. A String of form "1.1", ".2", etc. */
-    public void setTarget(String v) { settings.put(CompilerOptions.OPTION_TargetPlatform, v); }
+    public void setTarget(String v) {
+       if (v.equals("1.1")) settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_1);
+       else if (v.equals("1.2")) settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
+       else if (v.equals("1.3")) settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_3);
+       else if (v.equals("1.4")) settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4);
+       else if (v.equals("1.5")) settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
+       else throw new RuntimeException("I have no idea what Java " + v + " is.  Ask David Crawshaw.");
+    }
 
     public void setVerbose(boolean v) { verbose = v; }
     public void setVeryVerbose(boolean v) { veryverbose = v; }
@@ -604,7 +618,7 @@ public class Compiler {
     {
         settings.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE);
         settings.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE);
-        settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3);
+        settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
         settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_1);
     };