public class FlexAppSWFTarget extends AppSWFTarget
AppSWFTarget
that builds an application SWF that uses
the flex framework.SWFTarget.FramesInformation, SWFTarget.SWFFrameInfo
Target.BuiltCompilationUnitSet, Target.DirectDependencies, Target.RootedCompilationUnits
ITarget.TargetType
metadataDonators
progressMonitor, project, targetSettings
Constructor and Description |
---|
FlexAppSWFTarget(IResolvedQualifiersReference mainApplicationClass,
FlexProject project,
ITargetSettings targetSettings,
ITargetProgressMonitor progressMonitor)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected Iterable<ICompilerProblem> |
computeFatalProblems()
|
protected SWFTarget.FramesInformation |
computeFramesInformation()
Create the
FramesInformation which contains the skeleton for the frames
of this SWF. |
protected ITargetAttributes |
computeTargetAttributes()
round-up user specified target attributes
All derived classes must provide one, but they are free to provide "do nothing" implementations
(like NilTargetAttributes)
|
protected ITargetReport |
computeTargetReport() |
protected Set<ICompilationUnit> |
findAllCompilationUnitsToLink(Collection<ICompilationUnit> compilationUnits,
Collection<ICompilerProblem> problems)
Discovers dependent compilation units from a set of root compilation
units.
|
protected Target.DirectDependencies |
getDirectDependencies(ICompilationUnit cu) |
protected ISWF |
initializeSWF(List<ICompilationUnit> reachableCompilationUnits)
Initialize SWF model with default header values from the target settings
when not overridden by the target attributes.
|
boolean |
isFlexInfo() |
addLinkedABCToFrame, getExplicitFramesInformation, getRootClassCompilationUnit, getRootClassDefinition, linkSWF, setKeepAS3MetadataLinkerSetting
addCompilationUnitsAndDependenciesToFrame, build, buildEmptySWF, computeRootedCompilationUnits, createWithClassesAndItsDependencies, doAddMetadataNamesToTarget, doPostBuildWork, getBackgroundColor, getFramesInformation, getRootedCompilationUnits, getTargetAttributes, getTargetType, reportProblem, shouldAddMetadataNamesToTarget, testCompilationUnitLinkage
addASMetadataNames, buildAllCompilationUnits, buildFinished, buildStarted, createLinkReport, getAllExternallyVisibleDefinitions, getASMetadataNames, getBuiltCompilationUnitSet, getDependentCompilationUnits, getFatalProblems, getIncludedResourceBundlesCompilationUnits, getIncludeLibrariesCompilationUnits, getIncludesCompilationUnits, getLinkageChecker, getReachableCompilationUnits, getTargetReport, getTargetSettings, isCanceled, isLinkageExternal, setLinkageChecker, updateProgress, updateProgress, waitForCompilationUnitToFinish
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getASMetadataNames, getIncludesCompilationUnits, getTargetReport, getTargetSettings
public FlexAppSWFTarget(IResolvedQualifiersReference mainApplicationClass, FlexProject project, ITargetSettings targetSettings, ITargetProgressMonitor progressMonitor) throws InterruptedException
mainApplicationClass
- IResolvedQualifiersReference
that
resolve to the main class for the flex application.project
- FlexProject
containing all the code that will be
compiled into the application.targetSettings
- ITargetSettings
with configuration
information for this target.progressMonitor
- ITargetProgressMonitor
to which status is
reported as this AppSWFTarget
is built.InterruptedException
public boolean isFlexInfo()
protected SWFTarget.FramesInformation computeFramesInformation() throws InterruptedException
AppSWFTarget
FramesInformation
which contains the skeleton for the frames
of this SWF. The actual frames will be create in doCreateFrames().computeFramesInformation
in class AppSWFTarget
InterruptedException
protected Target.DirectDependencies getDirectDependencies(ICompilationUnit cu) throws InterruptedException
getDirectDependencies
in class Target
InterruptedException
protected Set<ICompilationUnit> findAllCompilationUnitsToLink(Collection<ICompilationUnit> compilationUnits, Collection<ICompilerProblem> problems) throws InterruptedException
For each public visible definition in all the compilation units, if there's an applicable CSS rule, check if the CSS rule pulls in any dependencies. (i.e. embedded assets, skin classes) Add the dependencies to the list of compilation units, and check if they have any applicable CSS rules which could pull in more dependencies. Loop until we reach a stable set of compilation units.
CSS rules in these CSS documents can introduce class dependencies. If any candidate rule matches a class known to be linked into the target, the candidate rule's dependencies are selected for linking. Those selected dependencies will be included in the next iteration of the dependency discovery loop.
Once a CSS document is "activated", it stays in this collection and its rules are tested against all classes introduced in the "dependency discovery loop".
For example: Suppose in project P, there are "A.as" and "styles.css", and
class "A" is selected for linking.
In "styles.css", there're two rules:
A { xSkin : ClassReference("B"); } K { xSkin : ClassReference("L"); }In the 1st iteration, rule "A" is matched, which introduces dependency on "B".
B { ySkin : ClassReference("C"); } A { ySkin : ClassReference("D"); } K { ySkin : ClassReference("M"); }In the 2nd iteration, rule "A" and rule "B" in "defaults.css" are matched, which introduces dependencies on "C" and "D". However, "K" has not been selected so far, so "L" and "M" are not selected.
Now imagine, "C" is defined in "anotherSkin.swc", and there's a "defaults.css" in "anotherSkin.swc" as well.
C { zSkin : ClassReference("K"); }In the 3rd iteration, rule "C" is matched because "C" was selected in the previous iteration, which makes "K" the selected dependency.
At the beginning of the 4th iteration, the classes selected for linking are "A", "B", "C", "D" and "K". In this iteration, these classes will be tested against all the "activated style sheets" - "styles.css" and two "defaults.css" in "myskins.swc" and "anotherSkin.swc". "K" rules in "styles.css" and "myskins.swc" are now matched, which introduces new dependencies on "L" and "M".
In the 5th iteration, the classes to link are "A", "B", "C", "D", "K", "L" and "M". They are tested against all the activate CSS. No more dependencies are introduced by CSS rules, making it the last iteration of the loop.
findAllCompilationUnitsToLink
in class Target
compilationUnits
- Collection of compilation units known to be
linked in.problems
- Collection of ICompilerProblem
's that the each
found ICompilationUnit
is added to.InterruptedException
protected final ITargetReport computeTargetReport() throws InterruptedException
computeTargetReport
in class SWFTarget
InterruptedException
protected ITargetAttributes computeTargetAttributes() throws InterruptedException
SWFTarget
computeTargetAttributes
in class AppSWFTarget
InterruptedException
protected Iterable<ICompilerProblem> computeFatalProblems() throws InterruptedException
Target
Iterable
of fatal ICompilerProblem
s that
prevent this Target
from being built.
Sub-classes override this method to check for additional fatal
ICompilerProblem
s.
computeFatalProblems
in class AppSWFTarget
Iterable
of fatal ICompilerProblem
sInterruptedException
protected ISWF initializeSWF(List<ICompilationUnit> reachableCompilationUnits) throws InterruptedException
SWFTarget
initializeSWF
in class SWFTarget
InterruptedException
Copyright © 2016 The Apache Software Foundation. All rights reserved.