String fileEncoding = encoding;
if (fileEncoding == null) {
fileEncoding = DefaultToolOptions.getDefaultEncoding();
}
if (fileEncoding != null) {
JavacOption encodingOpt = getJavacOpt(OptionName.ENCODING.toString());
validateWithJavac(options, encodingOpt, OptionName.ENCODING.toString(), fileEncoding, "option.error.syntax.encoding");
arguments.add(OptionName.ENCODING.toString());
arguments.add(fileEncoding);
}
if (systemRepo != null) {
arguments.add("-sysrep");
arguments.add(systemRepo);
}
if (cacheRepo != null) {
arguments.add("-cacherep");
arguments.add(cacheRepo);
}
if (noDefRepos) {
arguments.add("-nodefreps");
}
if (repo != null) {
for (URI uri : this.repo) {
arguments.add("-rep");
arguments.add(uri.toString());
}
}
if (suppressWarnings != null) {
arguments.add("-suppress-warnings");
arguments.add(suppressWarnings);
}
addJavacArguments(arguments);
List<File> srcs = applyCwd(this.sources);
List<String> expandedModulesOrFiles = ModuleWildcardsHelper.expandWildcards(srcs , this.modulesOrFiles);
if (expandedModulesOrFiles.isEmpty()) {
throw new ToolUsageError("No modules or source files to compile");
}
JavacOption sourceFileOpt = getJavacOpt(OptionName.SOURCEFILE.toString());
if (sourceFileOpt != null) {
for (String moduleOrFile : expandedModulesOrFiles) {
validateWithJavac(options, sourceFileOpt, moduleOrFile, moduleOrFile, "argument.error");
}
}