From: adam Date: Mon, 27 Dec 2004 07:31:14 +0000 (+0000) Subject: be more specific about compiler options X-Git-Url: http://git.megacz.com/?p=org.ibex.tool.git;a=commitdiff_plain;h=622d0e5a4b1b35b6918a516a79a0cc22272a919e be more specific about compiler options darcs-hash:20041227073114-5007d-9490d552582e0ea916490667c8b897b928d92884.gz --- 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); };