return;
}
// SWC target will create a SWC model.
ISWCTarget swcTarget;
ITargetSettings targetSettings = projectConfigurator.getTargetSettings(TargetType.SWC);
if (targetSettings == null)
return;
swcTarget = project.createSWCTarget(targetSettings, null);
target = (SWFTarget)swcTarget.getLibrarySWFTarget();
Collection<ICompilerProblem> swcProblems = new ArrayList<ICompilerProblem>();
final ISWC swc = swcTarget.build(swcProblems);
problems.addAll(swcProblems);
// Don't create a SWC if there are errors unless a
// developer requested otherwise.
if (!config.getCreateTargetWithErrors() && problems.hasErrors())
return;
boolean useCompression = targetSettings.useCompression();
if (config.getOutputSwcAsDirectory())
{
final String path = FilenameNormalization.normalize(outputOptionValue);
final ISWCWriter swcWriter = new SWCDirectoryWriter(path, useCompression,
targetSettings.isDebugEnabled(),
SWFWriterAndSizeReporter.getSWFWriterFactory(targetSettings.getSizeReport()));
swcWriter.write(swc);
long endTime = System.nanoTime();
String seconds = String.format("%5.3f", (endTime - startTime) / 1e9);
Map<String, Object> params = new HashMap<String, Object>();
params.put("path", path);
params.put("seconds", seconds);
swcOutputMessage =
Messages.getString("COMPC.swc_written_open_directory_in_seconds_format",
params);
}
else
{
final ISWCWriter swcWriter = new SWCWriter(outputOptionValue, useCompression,
targetSettings.isDebugEnabled(),
SWFWriterAndSizeReporter.getSWFWriterFactory(targetSettings.getSizeReport()));
swcWriter.write(swc);
final File outputFile = new File(outputOptionValue);
long endTime = System.nanoTime();
String seconds = String.format("%5.3f", (endTime - startTime) / 1e9);
Map<String, Object> params = new HashMap<String, Object>();