{
Assembly assembly = new Assembly(String.format("'%s' JavaScript stack, for locale %s, resources=", parameters.stackName, localeName));
for (Asset library : libraries)
{
Resource resource = library.getResource();
assembly.add(resource, libraryReader);
}
for (String moduleName : moduleNames)
{
Resource resource = moduleManager.findResourceForModule(moduleName);
if (resource == null)
{
throw new IllegalArgumentException(String.format("Could not identify a resource for module name '%s'.", moduleName));
}