Mxmlc.createProjector(configuration, projector, s.app, swfOut);
swfOut.flush();
swfOut.close();
ThreadLocalToolkit.log(new OutputMessage(s.outputName, Long.toString(file.length())));
}
else
{
if (benchmark != null)
{
benchmark.stopTime(Benchmark.PRECOMPILE, false);
}
List<CompilationUnit> units = CompilerAPI.compile(s.fileSpec, s.sourceList, null, s.sourcePath, s.resources, s.bundlePath,
swcContext, symbolTable, mappings, configuration, compilers,
new PreLink(), licenseMap, new ArrayList<Source>());
if (benchmark != null)
{
benchmark.startTime(Benchmark.POSTCOMPILE);
}
s.units = units;
s.sourcePath.clearCache();
s.bundlePath.clearCache();
s.resources.refresh();
// link
s.movie = LinkerAPI.link(units, postLink, configuration);
// output SWF
File file = FileUtil.openFile(s.outputName, true);
swfOut = new BufferedOutputStream(new FileOutputStream(file));
if (projector != null)
{
Mxmlc.createProjector(configuration, projector, s.movie, swfOut);
}
else
{
CompilerAPI.encode(configuration, s.movie, swfOut);
}
swfOut.flush();
swfOut.close();
ThreadLocalToolkit.log(new OutputMessage(s.outputName, Long.toString(file.length())));
}
}
catch (ConfigurationException ex)
{
Mxmlc.processConfigurationException(ex, "mxmlc");