@Override
protected FramesInformation computeFramesInformation() throws InterruptedException
{
LinkedList<SWFFrameInfo> frames = new LinkedList<SWFFrameInfo>();
ClassDefinition rootClassDef = getRootClassDefinition();
assert rootClassDef != null : "If the root class can not be resolved, the build should be aborted before this point";
ICompilationUnit rootClassCU = getRootClassCompilationUnit();
assert rootClassCU != null :"Unable to find compilation unit for definiton!";
final SWFFrameInfo applicationFrame =
createFrameInfoForApplicationFrame(rootClassDef);
frames.addFirst(applicationFrame);
final ClassDefinition initialFactoryClass =
rootClassDef.resolveInheritedFactoryClass(flexProject);
ClassDefinition currentFrameClass = initialFactoryClass;
SWFFrameInfo systemManagerFrame = null;
final FlexDelegate delegate = getDelegate();
if (delegate.getGenerateSystemManagerAndFlexInit())
{
final SWFFrameInfo frameInfo = createFrameInfoForGeneratedSystemManager(initialFactoryClass);
systemManagerFrame = frameInfo;
frames.addFirst(frameInfo);
currentFrameClass = currentFrameClass.resolveInheritedFactoryClass(project);
}
while ((currentFrameClass != null) && (!currentFrameClass.isImplicit()))
{
ICompilationUnit currentFrameClassCompilationUnit = flexProject.getScope().getCompilationUnitForDefinition(currentFrameClass);
assert currentFrameClassCompilationUnit != null :"Unable to find compilation unit for definiton!";
final SWFFrameInfo frameInfo = new SWFFrameInfo(currentFrameClass.getQualifiedName(), SWFFrameInfo.EXTERNS_DISALLOWED,
Collections.<ICompilationUnit>singleton(currentFrameClassCompilationUnit),
Collections.<ICompilerProblem>emptyList());
frames.addFirst(frameInfo);
currentFrameClass = currentFrameClass.resolveInheritedFactoryClass(project);
}
assert frames.getLast().rootedUnits.contains(rootClassCU) :
"The main class definition for the last frame, must be the main class definition for the SWF.";
final FramesInformation explicitFrames = getExplicitFramesInformation();