*/
private SWCScript createScript(ICompilationUnit cu,
Collection<IDefinition> definitionsToBuild) throws InterruptedException
{
// Create a script model per compilation unit.
final SWCScript script = new SWCScript();
script.setName(cu.getSWFTagsRequest().get().getDoABCTagName());
// Add all the externally visible definitions to the script model.
final IFileScopeRequestResult fsResult = cu.getFileScopeRequest().get();
for (final IDefinition def : fsResult.getExternallyVisibleDefinitions())
{
script.addDefinition(def.getQualifiedName());
script.setLastModified(cu.getSyntaxTreeRequest().get().getLastModified());
if (definitionsToBuild != null)
definitionsToBuild.add(def);
}
final DependencyGraph dependencyGraph =
flexProject.getDependencyGraph();
Set<ICompilationUnit> directDependencies =
dependencyGraph.getDirectDependencies(cu);
for (ICompilationUnit directDependency : directDependencies)
{
final Map<String, DependencyTypeSet> dependenciesMap =
dependencyGraph.getDependencySet(cu, directDependency);
for (Map.Entry<String, DependencyTypeSet> dependencyEntry : dependenciesMap.entrySet())
{
for (DependencyType type : dependencyEntry.getValue())
script.addDependency(dependencyEntry.getKey(), type);
}
}
return script;