iceLogger.info("Invalid entry point: " + entryPointNameString);
return;
}
// Try to resolve the module name
final ModuleName unresolvedModuleName = entryPointName.getModuleName();
final ModuleName resolvedModuleName = resolveModuleNameInProgram(unresolvedModuleName.toSourceText(), true);
if (resolvedModuleName == null) {
return; // a message was already logged about this
}
// Put in the resolved module name
entryPointName = QualifiedName.make(resolvedModuleName, entryPointName.getUnqualifiedName());
try {
mainClassSpecs.add(MainClassSpec.make(mainClassName, entryPointName));
} catch (final StandaloneJarBuilder.InvalidConfigurationException e) {
iceLogger.log(Level.INFO, "Error: " + e.getMessage());
return;
}
} else if (command.equals("-lib")) {
arguments.consumeArgument();
final String moduleNameString = arguments.getAndConsumeArgument();
final String libClassScope = arguments.getAndConsumeArgument();
final String libClassName = arguments.getAndConsumeArgument();
final JavaScope scope;
try {
scope = JavaScope.valueOf(libClassScope.toUpperCase());
} catch (final IllegalArgumentException e) {
iceLogger.info("Invalid scope: " + libClassScope);
return;
}
final ModuleName moduleName = resolveModuleNameInProgram(moduleNameString, true);
if (moduleName == null) {
// the module name cannot be resolved, so we simply return (resolveModuleNameInWorkspace would have printed an error message already).
return;
}
try {
libClassSpecs.add(LibraryClassSpec.make(scope, libClassName, moduleName));
} catch (final StandaloneJarBuilder.InvalidConfigurationException e) {
iceLogger.log(Level.INFO, "Error: " + e.getMessage());
return;
}
} else if (command.equals("-XX:all")) { // unsupported internal use argument - adds all modules in the program
arguments.consumeArgument();
for (final ModuleName moduleName : getWorkspaceManager().getModuleNamesInProgram()) {
try {
libClassSpecs.add(LibraryClassSpec.make(JavaScope.PUBLIC, "cal.lib." + moduleName.toSourceText(), moduleName));
} catch (final StandaloneJarBuilder.InvalidConfigurationException e) {
iceLogger.log(Level.INFO, "Error: " + e.getMessage());
return;
}