X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Ftool%2FCompiler.java;h=382cf74c347218b1118b4383f9e1d43e37fc2e28;hb=040fa5af2cd00017cf3575950cdaade34a6d7f6c;hp=b802c9eff0ac656721a30d314af017647967d343;hpb=b1a76493061a40ab02bbc7a937aca450447275c4;p=org.ibex.tool.git diff --git a/src/org/ibex/tool/Compiler.java b/src/org/ibex/tool/Compiler.java index b802c9e..382cf74 100644 --- a/src/org/ibex/tool/Compiler.java +++ b/src/org/ibex/tool/Compiler.java @@ -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); };