}
// Setup SWC cache
if (libraryCache != null)
{
ContextStatics contextStatics = libraryCache.getContextStatics();
if (contextStatics != null)
{
// Clear out ASC's userDefined, so definitions from a
// previous compilation don't spill over into this one.
contextStatics.userDefined.clear();
data.swcCache = libraryCache.getSwcCache();
data.perCompileData = contextStatics;
}
}
if (data.swcCache == null)
{
data.swcCache = new SwcCache();
}
// load SWCs
CompilerSwcContext swcContext = new CompilerSwcContext(true);
try
{
swcContext.load( compilerConfig.getLibraryPath(),
flex2.compiler.common.Configuration.getAllExcludedLibraries(compilerConfig, localOEMConfiguration.configuration),
compilerConfig.getThemeFiles(),
compilerConfig.getIncludeLibraries(),
mappings,
I18nUtils.getTranslationFormat(compilerConfig),
data.swcCache );
}
catch (SwcException ex)
{
clean(false /* cleanData */,
false /* cleanCache */,
false /* cleanOutput */,
true /* cleanConfig */,
false /* cleanMessages */,
false /* cleanThreadLocals */);
return FAIL;
}
// save the generated swcCache if the class has a libraryCache.
if (libraryCache != null)
{
libraryCache.setSwcCache(data.swcCache);
}
data.includes = new HashSet<String>(swcContext.getIncludes());
data.excludes = new HashSet<String>(swcContext.getExterns());
localOEMConfiguration.configuration.addExterns( swcContext.getExterns() );
localOEMConfiguration.configuration.addIncludes( swcContext.getIncludes() );
localOEMConfiguration.configuration.getCompilerConfiguration().addThemeCssFiles( swcContext.getThemeStyleSheets() );
data.cmdChecksum = localOEMConfiguration.cfgbuf.checksum_ts(); // OEMUtil.calculateChecksum(data, swcContext, c);
data.linkChecksum = localOEMConfiguration.cfgbuf.link_checksum_ts();
data.swcChecksum = swcContext.checksum();
int[] checksums = new int[] { 0, data.cmdChecksum, data.linkChecksum, data.swcChecksum };
boolean relink = false;
// C: must do loadCompilationUnits() after checksum calculation...
if (!fullRecompile)
{
if (!loadCompilationUnits(localOEMConfiguration, swcContext, checksums))
{
clean(true /* cleanData */,
false /* cleanCache */,
false /* cleanOutput */,
true /* cleanConfig */,
false /* cleanMessages */,
false /* cleanThreadLocals */);
return FAIL;
}
data.checksum = checksums[0];
if (data.units != null &&
data.units.size() > 0 &&
OEMUtil.isRecompilationNeeded(data, swcContext, localOEMConfiguration))
{
if (!setupSourceContainers(localOEMConfiguration))
{
clean(true /* cleanData */,
false /* cleanCache */,
false /* cleanOutput */,
true /* cleanConfig */,
false /* cleanMessages */,
false /* cleanThreadLocals */);
return FAIL;
}
}
if (applicationCache != null)
{
ContextStatics contextStatics = applicationCache.getContextStatics();
if (contextStatics != null)
{
// Clear out ASC's userDefined, so definitions
// from a previous compilation don't spill over