Index: drools-compiler/src/main/java/org/drools/commons/jci/compilers/EclipseJavaCompilerSettings.java =================================================================== --- drools-compiler/src/main/java/org/drools/commons/jci/compilers/EclipseJavaCompilerSettings.java (revision 31657) +++ drools-compiler/src/main/java/org/drools/commons/jci/compilers/EclipseJavaCompilerSettings.java (working copy) @@ -20,8 +20,6 @@ import java.util.HashMap; import java.util.Map; -import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; - /** * Native Eclipse compiler settings * @@ -29,13 +27,43 @@ */ public final class EclipseJavaCompilerSettings extends JavaCompilerSettings { + //copied from org.eclipse.jdt.internal.compiler.impl.CompilerOptions as we can't access it + public static final String CompilerOptions_VERSION_1_1 = "1.1"; //$NON-NLS-1$ + public static final String CompilerOptions_VERSION_1_2 = "1.2"; //$NON-NLS-1$ + public static final String CompilerOptions_VERSION_1_3 = "1.3"; //$NON-NLS-1$ + public static final String CompilerOptions_VERSION_1_4 = "1.4"; //$NON-NLS-1$ + public static final String CompilerOptions_VERSION_JSR14 = "jsr14"; //$NON-NLS-1$ + public static final String CompilerOptions_VERSION_CLDC1_1 = "cldc1.1"; //$NON-NLS-1$ + public static final String CompilerOptions_VERSION_1_5 = "1.5"; //$NON-NLS-1$ + public static final String CompilerOptions_VERSION_1_6 = "1.6"; //$NON-NLS-1$ + public static final String CompilerOptions_VERSION_1_7 = "1.7"; //$NON-NLS-1$ + + public static final String CompilerOptions_GENERATE = "generate";//$NON-NLS-1$ + public static final String CompilerOptions_DO_NOT_GENERATE = "do not generate"; //$NON-NLS-1$ + public static final String CompilerOptions_PRESERVE = "preserve"; //$NON-NLS-1$ + public static final String CompilerOptions_OPTIMIZE_OUT = "optimize out"; //$NON-NLS-1$ + public static final String CompilerOptions_ERROR = "error"; //$NON-NLS-1$ + public static final String CompilerOptions_WARNING = "warning"; //$NON-NLS-1$ + public static final String CompilerOptions_IGNORE = "ignore"; //$NON-NLS-1$ + + public static final String CompilerOptions_OPTION_LineNumberAttribute = "org.eclipse.jdt.core.compiler.debug.lineNumber"; //$NON-NLS-1$ + public static final String CompilerOptions_OPTION_SourceFileAttribute = "org.eclipse.jdt.core.compiler.debug.sourceFile"; //$NON-NLS-1$ + public static final String CompilerOptions_OPTION_LocalVariableAttribute = "org.eclipse.jdt.core.compiler.debug.localVariable"; //$NON-NLS-1$ + public static final String CompilerOptions_OPTION_ReportUnusedImport = "org.eclipse.jdt.core.compiler.problem.unusedImport"; //$NON-NLS-1$ + + public static final String CompilerOptions_OPTION_SuppressWarnings = "org.eclipse.jdt.core.compiler.problem.suppressWarnings"; //$NON-NLS-1$ + public static final String CompilerOptions_OPTION_Encoding = "org.eclipse.jdt.core.encoding"; //$NON-NLS-1$ + public static final String CompilerOptions_OPTION_Source = "org.eclipse.jdt.core.compiler.source"; //$NON-NLS-1$ + public static final String CompilerOptions_OPTION_TargetPlatform = "org.eclipse.jdt.core.compiler.codegen.targetPlatform"; //$NON-NLS-1$ + public static final String CompilerOptions_OPTION_ReportDeprecation = "org.eclipse.jdt.core.compiler.problem.deprecation"; //$NON-NLS-1$ + final private Map defaultEclipseSettings = new HashMap(); public EclipseJavaCompilerSettings() { - defaultEclipseSettings.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE); - defaultEclipseSettings.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE); - defaultEclipseSettings.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE); - defaultEclipseSettings.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE); + defaultEclipseSettings.put(CompilerOptions_OPTION_LineNumberAttribute, CompilerOptions_GENERATE); + defaultEclipseSettings.put(CompilerOptions_OPTION_SourceFileAttribute, CompilerOptions_GENERATE); + defaultEclipseSettings.put(CompilerOptions_OPTION_ReportUnusedImport, CompilerOptions_IGNORE); + defaultEclipseSettings.put(CompilerOptions_OPTION_LocalVariableAttribute, CompilerOptions_GENERATE); } public EclipseJavaCompilerSettings( final JavaCompilerSettings pSettings ) { @@ -53,12 +81,12 @@ private static Map nativeVersions = new HashMap() { private static final long serialVersionUID = 1L; { - put("1.1", CompilerOptions.VERSION_1_1); - put("1.2", CompilerOptions.VERSION_1_2); - put("1.3", CompilerOptions.VERSION_1_3); - put("1.4", CompilerOptions.VERSION_1_4); - put("1.5", CompilerOptions.VERSION_1_5); - put("1.6", CompilerOptions.VERSION_1_6); + put("1.1", CompilerOptions_VERSION_1_1); + put("1.2", CompilerOptions_VERSION_1_2); + put("1.3", CompilerOptions_VERSION_1_3); + put("1.4", CompilerOptions_VERSION_1_4); + put("1.5", CompilerOptions_VERSION_1_5); + put("1.6", CompilerOptions_VERSION_1_6); }}; private String toNativeVersion( final String pVersion ) { @@ -74,11 +102,11 @@ Map toNativeSettings() { final Map map = new HashMap(defaultEclipseSettings); - map.put(CompilerOptions.OPTION_SuppressWarnings, isWarnings()?CompilerOptions.GENERATE:CompilerOptions.DO_NOT_GENERATE); - map.put(CompilerOptions.OPTION_ReportDeprecation, isDeprecations()?CompilerOptions.GENERATE:CompilerOptions.DO_NOT_GENERATE); - map.put(CompilerOptions.OPTION_TargetPlatform, toNativeVersion(getTargetVersion())); - map.put(CompilerOptions.OPTION_Source, toNativeVersion(getSourceVersion())); - map.put(CompilerOptions.OPTION_Encoding, getSourceEncoding()); + map.put(CompilerOptions_OPTION_SuppressWarnings, isWarnings()?CompilerOptions_GENERATE:CompilerOptions_DO_NOT_GENERATE); + map.put(CompilerOptions_OPTION_ReportDeprecation, isDeprecations()?CompilerOptions_GENERATE:CompilerOptions_DO_NOT_GENERATE); + map.put(CompilerOptions_OPTION_TargetPlatform, toNativeVersion(getTargetVersion())); + map.put(CompilerOptions_OPTION_Source, toNativeVersion(getSourceVersion())); + map.put(CompilerOptions_OPTION_Encoding, getSourceEncoding()); return map; }