use of com.sun.tools.javac.util.Options in project ceylon-compiler by ceylon.
the class T6838467 method createFileManager.
JavacFileManager createFileManager(boolean useOptimizedZip) {
Context ctx = new Context();
Options options = Options.instance(ctx);
options.put("useOptimizedZip", Boolean.toString(useOptimizedZip));
return new JavacFileManager(ctx, false, null);
}
use of com.sun.tools.javac.util.Options in project ceylon-compiler by ceylon.
the class T6877206 method createFileManager.
JavacFileManager createFileManager(boolean useOptimizedZip, boolean useSymbolFile) {
Context ctx = new Context();
Options options = Options.instance(ctx);
options.put("useOptimizedZip", Boolean.toString(useOptimizedZip));
if (!useSymbolFile) {
options.put("ignore.symbol.file", "true");
}
return new JavacFileManager(ctx, false, null);
}
use of com.sun.tools.javac.util.Options in project ceylon-compiler by ceylon.
the class CeylonCompileTool method addJavacArguments.
private void addJavacArguments(List<String> arguments) {
Options options = Options.instance(new Context());
for (String argument : javac) {
HELPER.lastError = null;
String value = null;
int index = argument.indexOf('=');
if (index != -1) {
value = index < argument.length() ? argument.substring(index + 1) : "";
argument = argument.substring(0, index);
}
JavacOption javacOpt = getJavacOpt(argument.replaceAll(":.*", ":"));
if (javacOpt == null) {
throw new IllegalArgumentException(CeylonCompileMessages.msg("option.error.javac", argument));
}
if (value != null) {
if (!javacOpt.hasArg()) {
throw new IllegalArgumentException(CeylonCompileMessages.msg("option.error.syntax.javac", argument, "Unexpected argument given"));
}
if (!javacOpt.matches(argument)) {
throw new IllegalArgumentException(CeylonCompileMessages.msg("option.error.javac", argument));
}
if (javacOpt.process(options, argument, value)) {
throw new IllegalArgumentException(CeylonCompileMessages.msg("option.error.syntax.javac", argument, HELPER.lastError));
}
} else {
if (javacOpt.hasArg()) {
throw new IllegalArgumentException(CeylonCompileMessages.msg("option.error.syntax.javac", argument, "Missing expected argument"));
}
if (!javacOpt.matches(argument)) {
throw new IllegalArgumentException(CeylonCompileMessages.msg("option.error.javac", argument));
}
if (javacOpt.process(options, argument)) {
throw new IllegalArgumentException(CeylonCompileMessages.msg("option.error.syntax.javac", argument, HELPER.lastError));
}
}
arguments.add(argument);
if (value != null) {
arguments.add(value);
}
}
}
use of com.sun.tools.javac.util.Options in project ceylon-compiler by ceylon.
the class CeyloncCompilerDelegate method getStatusPrinter.
private StatusPrinter getStatusPrinter() {
Options options = Options.instance(context);
boolean isProgressPrinted = options.get(OptionName.CEYLONPROGRESS) != null && StatusPrinter.canPrint();
if (isProgressPrinted) {
return LanguageCompiler.getStatusPrinterInstance(context);
} else {
return null;
}
}
use of com.sun.tools.javac.util.Options in project ceylon-compiler by ceylon.
the class CompilerConfig method instance.
public static CeylonConfig instance(Context context) {
CeylonConfig instance = context.get(CeylonConfig.class);
if (instance == null) {
Options options = Options.instance(context);
String cwd = options.get(OptionName.CEYLONCWD);
if (cwd == null) {
cwd = ".";
}
instance = CeylonConfig.createFromLocalDir(new File(cwd));
context.put(CeylonConfig.class, instance);
}
return instance;
}
Aggregations