public abstract class ASProject extends CompilerProject implements IASProject
dependencyGraph, problems, targets
Constructor and Description |
---|
ASProject(Workspace workspace,
boolean useAS3)
Constructor
|
ASProject(Workspace workspace,
boolean useAS3,
IASDocBundleDelegate asDocBundleDelegate) |
Modifier and Type | Method and Description |
---|---|
void |
addIncludeSourceFile(File file)
Adds a new include source file to the project.
|
void |
addIncludeSourceFile(File file,
boolean overrideSourcePath)
Adds a new include source file to the project.
|
void |
addProjectDependeny(IASProject project,
String swcFilename)
Adds a new project dependency to this project.
|
boolean |
addSourcePathFile(File f)
Adds a file to the project if that file is on the project's
source path.
|
void |
attachExternalLibrarySourcePath(File library,
File sourceDir)
Attach the source directory to an external SWC library.
|
void |
attachInternalLibrarySourcePath(File library,
File sourceDir)
Attach the source directory to a SWC library.
|
void |
collectionCompilationUnitsForRootSourceFile(File rootSourceFile,
Collection<ICompilationUnit> units)
Finds all the
ICompilationUnit 's in this project whose root source file is the specified file. |
void |
collectProblems(Collection<ICompilerProblem> problems)
Gets project level
ICompilerProblem 's target are not specific to any
one target created by the project. |
IInvisibleCompilationUnit |
createInvisibleCompilationUnit(String rootSourceFile,
IFileSpecificationGetter fileSpecGetter)
Creates an
IInvisibleCompilationUnit for the specified absolute
file name. |
IInvisibleCompilationUnit |
createInvisibleCompilationUnit(String rootSourceFile,
IFileSpecificationGetter fileSpecGetter,
String qName)
Creates an
IInvisibleCompilationUnit for the specified absolute
file name, specifying a qualified name. |
IASDocBundleDelegate |
getASDocBundleDelegate() |
String |
getAttachedSourceDirectory(String libraryFilename)
Get the Directory for the specified library.
|
Integer |
getCompatibilityVersion()
Returns the compatibility version encoded as an integer.
|
String |
getCompatibilityVersionString()
Returns the compatibility version encoded as a string.
|
Set<IASProject> |
getDependingProjects() |
List<ISWC> |
getLibraries()
The libraries available to compiler source in this project.
|
SourceCompilationUnitFactory |
getSourceCompilationUnitFactory() |
ISWCFileEntry |
getSourceFileFromLibraryPath(String file)
Iterate through the library path list looking for the specified file.
|
String |
getSourceFileFromSourcePath(String file)
Iterate through the source path list looking for the specified file.
|
List<File> |
getSourcePath()
Get the list of source paths set.
|
boolean |
handleAddedFile(File addedFile)
Called by
Workspace.fileAdded(org.apache.flex.compiler.filespecs.IFileSpecification)
for each project in the workspace. |
boolean |
hasCompilationUnitForRootSourceFile(File rootSourceFile) |
boolean |
invalidateLibraries(Collection<File> swcFiles)
Removes any calculated data related to a collection of libraries.
|
void |
invalidateLibrary(ISWC swc)
Removes any calculated data related to a SWC.
|
boolean |
isAssetEmbeddingSupported()
Test whether the project supports the embedding of assets.
|
boolean |
isFileOnSourcePath(File f)
Test if a file is on the source path or not.
|
boolean |
isSupportedSourceFileType(String fileExtension)
Determines if the specified file extension ( without the dot eg:
as , not .as ) corresponds to a source file type that this
project can create ICompilationUnit s for. |
void |
removeIncludeSourceFile(File file)
Removes an include source file to the project.
|
void |
removeProjectDependeny(IASProject project)
Removes a project dependency from this project.
|
void |
removeSourceFile(File f)
Removes a source file to the project, removing any references in the various
managers - SourcePathManager, SourceListManager etc
|
void |
setCompatibilityVersion(int major,
int minor,
int revision)
Sets the SDK compatibility version.
|
void |
setDependencies(Map<IASProject,String> newIProjectsDependencies)
Resets the set of projects that this project depends on.
|
void |
setIncludeSources(File[] files)
Sets the include sources list for the project.
|
void |
setLibraries(List<File> libraries)
The libraries used to compile source files in a project.
|
void |
setSourcePath(List<File> paths)
Sets the source path for the project.
|
addCompilationUnit, addCompilationUnits, addCompilationUnitsAndUpdateDefinitions, addConfigVariable, addConfigVariables, addDependency, addDependency, addDependency, addEmbedCompilationUnit, addGlobalUsedNamespacesToNamespaceSet, addToASTCache, addUnfoundDefinitionDependency, addUnfoundReferencedSourceFileDependency, clean, clearScopeCacheForCompilationUnit, collectConfigProblems, createSWFTarget, delete, doubleCheckAmbiguousDefinition, getActualPackageName, getBuiltinType, getCacheForScope, getCompilationUnit, getCompilationUnits, getCompilationUnits, getDependencies, getDependenciesOnDefinition, getDependenciesOnUnfoundDefinition, getDependenciesOnUnfoundReferencedSourceFile, getDependencyGraph, getDirectDependencies, getDirectReverseDependencies, getFatalProblems, getIncludingCompilationUnits, getProblems, getProjectConfigVariables, getReachableCompilationUnitsInSWFOrder, getScope, getUndefinedValue, getUseParallelCodeGeneration, getWorkspace, initProjectScope, isCompatibleOverrideReturnType, isInliningEnabled, isValidTypeConversion, removeAnyUnfoundDependencies, removeCompilationUnit, removeCompilationUnits, removeDependencies, resetScopeCacheForCompilationUnit, resolveQNameToCompilationUnit, resolveQNameToDefinition, setEnableInlining, setProblems, setUseParallelCodeGeneration, unitTestingEntryPointForRemovingCompilationUnit, updatePublicAndInternalDefinitions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clean, createSWFTarget, delete, doubleCheckAmbiguousDefinition, getActualPackageName, getBuiltinType, getCompilationUnits, getCompilationUnits, getDirectDependencies, getDirectReverseDependencies, getIncludingCompilationUnits, getProblems, getReachableCompilationUnitsInSWFOrder, getScope, getUndefinedValue, getWorkspace, isCompatibleOverrideReturnType, isInliningEnabled, isValidTypeConversion, resolveQNameToCompilationUnit, resolveQNameToDefinition, setProblems, setUseParallelCodeGeneration
public ASProject(Workspace workspace, boolean useAS3)
workspace
- The Workspace in which this project lives.useAS3
- Indicate whether or not the AS3 namespace should
be opened in all compilation units in the project.public ASProject(Workspace workspace, boolean useAS3, IASDocBundleDelegate asDocBundleDelegate)
public List<ISWC> getLibraries()
IASProject
getLibraries
in interface IASProject
public void attachInternalLibrarySourcePath(File library, File sourceDir)
IASProject
attachInternalLibrarySourcePath
in interface IASProject
library
- SWC librarysourceDir
- directory that contains the source for the SWC librarypublic void attachExternalLibrarySourcePath(File library, File sourceDir)
IASProject
attachExternalLibrarySourcePath
in interface IASProject
library
- SWC librarysourceDir
- directory that contains the source for the SWC librarypublic String getAttachedSourceDirectory(String libraryFilename)
IASProject
getAttachedSourceDirectory
in interface IASProject
public void setSourcePath(List<File> paths)
IASProject
setSourcePath
in interface IASProject
paths
- List of directories that should be searched for source files.public List<File> getSourcePath()
IASProject
getSourcePath
in interface IASProject
public boolean addSourcePathFile(File f)
f
- The file to be added.ICompilationUnit
's were created
as a result of this operation, false otherwise.public boolean isFileOnSourcePath(File f)
f
- The file to test. May not be null.public void setIncludeSources(File[] files) throws InterruptedException
IASProject
setIncludeSources
in interface IASProject
InterruptedException
public void addIncludeSourceFile(File file) throws InterruptedException
IASProject
addIncludeSourceFile
in interface IASProject
file
- File to add.InterruptedException
public void addIncludeSourceFile(File file, boolean overrideSourcePath) throws InterruptedException
IASProject
addIncludeSourceFile
in interface IASProject
file
- File to add.overrideSourcePath
- Set to true to add the file to the source list
even if it exists on the source path.InterruptedException
public void removeIncludeSourceFile(File file) throws InterruptedException
IASProject
removeIncludeSourceFile
in interface IASProject
file
- File to remove.InterruptedException
IASProject.addIncludeSourceFile(File)
public void removeSourceFile(File f)
f
- File to remove.addIncludeSourceFile(File)
public SourceCompilationUnitFactory getSourceCompilationUnitFactory()
public Set<IASProject> getDependingProjects()
getDependingProjects
in interface IASProject
public void addProjectDependeny(IASProject project, String swcFilename)
IASProject
addProjectDependeny
in interface IASProject
project
- IASProject
dependency to add to this project.swcFilename
- The SWC filename the project dependency generatespublic void removeProjectDependeny(IASProject project)
IASProject
removeProjectDependeny
in interface IASProject
project
- IASProject
to remove from this projects dependencies.public void setDependencies(Map<IASProject,String> newIProjectsDependencies)
IASProject
setDependencies
in interface IASProject
newIProjectsDependencies
- The new map of IASProject
s that
this project depends on. The value to the map is the SWC filename the
IASProject generates.public void collectProblems(Collection<ICompilerProblem> problems)
CompilerProject
ICompilerProblem
's target are not specific to any
one target created by the project.collectProblems
in class CompilerProject
public void collectionCompilationUnitsForRootSourceFile(File rootSourceFile, Collection<ICompilationUnit> units)
ICompilationUnit
's in this project whose root source file is the specified file.public boolean hasCompilationUnitForRootSourceFile(File rootSourceFile)
public boolean invalidateLibraries(Collection<File> swcFiles)
IASProject
invalidateLibraries
in interface IASProject
swcFiles
- Collection of SWC files to invalidate.public void invalidateLibrary(ISWC swc)
IASProject
invalidateLibrary
in interface IASProject
swc
- ISWC to invalidatepublic boolean handleAddedFile(File addedFile)
CompilerProject
Workspace.fileAdded(org.apache.flex.compiler.filespecs.IFileSpecification)
for each project in the workspace. Each subclass of this class must
decide when an added file is interesting or should be ignored.handleAddedFile
in class CompilerProject
addedFile
- File that was added.public String getSourceFileFromSourcePath(String file)
IASProject
getSourceFileFromSourcePath
in interface IASProject
file
- filename to look forpublic ISWCFileEntry getSourceFileFromLibraryPath(String file)
file
- to look forpublic IASDocBundleDelegate getASDocBundleDelegate()
public void setLibraries(List<File> libraries)
IASProject
setLibraries
in interface IASProject
libraries
- The libraries in priority order, may not be null.public void setCompatibilityVersion(int major, int minor, int revision)
major
- The major version. For this release, this value must be 2.minor
- The minor version. For this release, this value must be 0.revision
- For this release, this value must be 1.public Integer getCompatibilityVersion()
IASProject
getCompatibilityVersion
in interface IASProject
public String getCompatibilityVersionString()
IASProject
getCompatibilityVersionString
in interface IASProject
public IInvisibleCompilationUnit createInvisibleCompilationUnit(String rootSourceFile, IFileSpecificationGetter fileSpecGetter)
IASProject
IInvisibleCompilationUnit
for the specified absolute
file name.createInvisibleCompilationUnit
in interface IASProject
rootSourceFile
- The name of the file to create an
IInvisibleCompilationUnit
for.fileSpecGetter
- A IFileSpecificationGetter
that can be used
by the new IInvisibleCompilationUnit
to open files.IInvisibleCompilationUnit
or null if the specified.
file name is not found on the current source path of this
IASProject
.public IInvisibleCompilationUnit createInvisibleCompilationUnit(String rootSourceFile, IFileSpecificationGetter fileSpecGetter, String qName)
IASProject
IInvisibleCompilationUnit
for the specified absolute
file name, specifying a qualified name.
This version of createInvisibleCompilationUnit() is called when creating a
IInvisibleCompilationUnit
for a source file which isn't contained
within the source path, as the qualified name of the IInvisibleCompilationUnit
to be created can't be computed automatically. This happens when creating a
IInvisibleCompilationUnit
for an external file.createInvisibleCompilationUnit
in interface IASProject
rootSourceFile
- The name of the file to create an
IInvisibleCompilationUnit
for.fileSpecGetter
- A IFileSpecificationGetter
that can be used
by the new IInvisibleCompilationUnit
to open files.qName
- The qualified name of the IInvisibleCompilationUnit
IInvisibleCompilationUnit
or null if the specified.
file name is not found on the current source path of this
IASProject
.public boolean isAssetEmbeddingSupported()
ICompilerProject
isAssetEmbeddingSupported
in interface ICompilerProject
public boolean isSupportedSourceFileType(String fileExtension)
IASProject
as
, not .as
) corresponds to a source file type that this
project can create ICompilationUnit
s for.isSupportedSourceFileType
in interface IASProject
fileExtension
- The file extension to check without a dot, for
example mxml
.Copyright © 2016 The Apache Software Foundation. All rights reserved.