SessionManager sessionManager = cmd.createSession();
// create bbwp.properties
Logger.logMessage(LogType.INFO, "PROGRESS_SESSION_BBWP_PROPERTIES");
String propertiesFile = sessionManager.getBBWPJarFolder() + WidgetPackager.PROPERTIES_FILE;
BBWPProperties bbwpProperties = new BBWPProperties(propertiesFile, sessionManager.getSessionHome());
// validate widget archive
Logger.logMessage(LogType.INFO, "PROGRESS_VALIDATING_WIDGET_ARCHIVE");
WidgetArchive wa = new WidgetArchive(sessionManager.getWidgetArchive());
wa.validate();
// parse/validate config.xml
Logger.logMessage(LogType.INFO, "PROGRESS_SESSION_CONFIGXML");
XMLParser xmlparser = new ConfigXMLParser();
WidgetConfig config = xmlparser.parseXML(wa); // raw data, without \
// create/clean outputs/source
// Logger.printInfoMessage("Widget packaging starts...");
FileManager fileManager = new FileManager(bbwpProperties);
Logger.logMessage(LogType.INFO, "PROGRESS_FILE_POPULATING_SOURCE");
fileManager.prepare();
//
// Copy the JS extensions.
//
Map<String, Vector<String>> entryClassTable = null;
if (SessionManager.getInstance().isPlayBook()) {
entryClassTable = copyExtensions(bbwpProperties, config);
}
// Set 3rd party extension classes
if (!SessionManager.getInstance().isPlayBook()) {
config.setExtensionClasses(fileManager.getExtensionClasses());
}
// create autogen file
WidgetConfigSerializer wcs = new WidgetConfig_v1Serializer(config, entryClassTable);
byte[] autogenFile = wcs.serialize();
fileManager.writeToSource(autogenFile, AUTOGEN_FILE);
// create jdw/jdp files
if (!SessionManager.getInstance().isPlayBook()) {
fileManager.generateProjectFiles(sessionManager.getSourceFolder(),
sessionManager.getArchiveName(), config.getName(), config
.getVersion(), config.getAuthor(),config.getContent(),config.getBackgroundSource(),config.isStartupEnabled(), config
.getIconSrc(), config.getHoverIconSrc(),
fileManager.getFiles(), bbwpProperties.getImports());
}
// run mxmlc to compile ActionScript into SWF
Logger.logMessage(LogType.INFO, "PROGRESS_COMPILING");
if (SessionManager.getInstance().isPlayBook()) {