|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.sandev.sandbuild.SandProject
public class SandProject
A representation of a SAND project used in dependency structures and other build processing.
| Field Summary | |
|---|---|
protected org.apache.tools.ant.Project |
antProject
A reference to the Ant Project object for this SandProject |
protected java.io.File[] |
envFiles
A SandProject may require access to zero or more files at runtime. |
protected java.util.Collection |
genDecls
The SandGenDecl instances for this project. |
protected java.lang.String |
name
A SandProject has a name which is used to identify it within the overall build. |
static java.lang.String |
NODE_DECLS_FILE
Name of the NodeDecls.txt file |
protected SandDecl[] |
nodeDecls
The SandDecl objects for the nodes declared in this project |
protected SandPersistDef |
persistenceDef
A SandProject has a single persistence definition. |
protected SandProject[] |
requiredBy
A SandProject may be required by zero or more other SandProjects. |
protected SandUIDeployment[] |
sandUIDeployments
A SandProject may declare zero or more deployments of a SandUI definition. |
static java.lang.String |
STRUCT_DECLS_FILE
Name of the StructDecls.txt file |
protected SandDecl[] |
structDecls
The SandDecl objects for the structs declared in this project. |
| Constructor Summary | |
|---|---|
SandProject(java.lang.String name)
All projects must have a name, so no default ctor. |
|
| Method Summary | |
|---|---|
protected void |
addDeletedDecls(java.util.Collection curr,
java.util.Collection prev)
Given a collection of current declarations, and a collection of previous declarations, add any deleted declarations to the current collection. |
void |
addEnvFile(java.io.File file)
Add a file to the list of required files. |
void |
addGenDecl(SandGenDecl decl)
Add a generator declaration to the collection. |
void |
addRequiredBy(SandProject proj)
Add a new project to those projects that require this one. |
void |
addUIDeployment(SandUIDeployment uidep)
Add a SandUIDeployment to our list of UIs for this project. |
void |
callTarget(java.lang.String targetName)
Call the specified target in this project. |
protected boolean |
changedGeneratorFound(java.lang.String classname)
Search through all the projects which declare this generator and return true if any of them have changed. |
protected boolean |
changedGeneratorFoundInProject(SandProject proj,
java.lang.String classname)
|
void |
checkDefaultDebugFlag()
Check that the debug flag is set, and default it if nothing was specified. |
void |
checkDefaultJarPrefix()
Check that the DeploymentPrefix for jarfiles is set. |
void |
cleanCompileGenerators()
Undo the work done by compileGenerators. |
void |
cleanDocGenerators()
Undo the work done by docGenerators |
void |
cleanDocSource()
Undo work done by docSource |
void |
cleanJarGenerators()
Undo the work done by jarGenerators |
void |
compileGenerators()
Compile the generators by calling the build.compile.generators target. |
void |
copyfile(java.lang.String srcfilename,
java.lang.String targetdir)
Copy the specified file to the specified directory. |
void |
deletefile(java.lang.String filename)
Delete the specified file. |
void |
docGenerators(java.util.Collection changed)
Document the generators. |
void |
docSource(java.util.Collection dirtyFiles)
Document the main source. |
java.util.ArrayList |
findNodeDecls(java.io.File rootDir,
java.util.ArrayList coll)
Walk the directory tree downwards recursively, loading any node declarations. |
SandProject |
findProject(java.lang.String projname)
Return the project instance matching the specified name, or null if have no matching instance. |
java.util.ArrayList |
findStructDecls(java.io.File rootDir,
java.util.ArrayList coll)
If this is a structs directory, load any struct declarations. |
boolean |
genJarExists()
Return true if the generator jar file is found, false otherwise. |
org.apache.tools.ant.Project |
getAntProject()
accessor for antProject |
java.io.File[] |
getEnvFiles()
Return the files this project requires at runtime. |
java.util.Collection |
getGenDecls()
initializing accessor for genDecls |
protected java.lang.String |
getGeneratorSrcDirName()
Return the name of the generator src directory. |
java.lang.String |
getName()
accessor for name |
SandDecl[] |
getNodeDecls()
Initializing accessor for nodeDecls |
SandPersistDef |
getPersistenceDef()
accessor for persistenceDef |
SandProject[] |
getRequiredBy()
Returns an array of the projects that require this one. |
java.lang.String |
getSandName()
Return the SAND project name. |
SandUIDeployment[] |
getSandUIDeployments()
Return the SandUI deployment definitions for this project. |
SandDecl[] |
getStructAndNodeDecls()
Return all the struct and node declarations for this project. |
SandDecl[] |
getStructDecls()
Initializing accessor for structDecls |
boolean |
hasRequiredBy(java.lang.String projname)
Return true if the specified project name exists in our requiredBy array, false otherwise. |
protected void |
initDecls(java.util.Collection currDecls)
Given a collection of SandDecls, call to initialize the qualifiedName and the status for each one. |
void |
jarGenerators()
Jar the generators by calling the build.jar.generators target. |
void |
loadAntProject(java.lang.String sandDir,
SandProject proj)
Given a sand directory specification (eg "apps/basics"), load the corresponding ant project into our local references. |
void |
loadNodeDecls()
Load the node declarations for this project |
java.util.ArrayList |
loadPrevDecls(int decltype)
The last time we built, we wrote out the declarations we were dealing with so we could keep track of what happened for an incremental build. |
void |
loadStructDecls()
Load the struct declarations for this project |
void |
removeRequiredBy(java.lang.String projname)
Removes a project from our requiredBy. |
void |
setAntProject(org.apache.tools.ant.Project proj)
mutator for antProject |
protected void |
setChangedGenSrcProperty(java.util.Collection changed)
Set the changedGenSrc property for this project, so we can javadoc just these files. |
void |
setEnvFiles(java.io.File[] files)
mutator for envFiles |
void |
setGenDecls(java.util.Collection decls)
mutator for genDecls |
void |
setName(java.lang.String val)
mutator for name |
void |
setNodeDecls(SandDecl[] decls)
mutator for nodeDecls |
void |
setPersistenceDef(SandPersistDef val)
mutator for persistenceDef |
void |
setRequiredBy(SandProject[] downstream)
mutator for requiredBy |
void |
setSandUIDeployments(SandUIDeployment[] deps)
Mutator for sandUIDeployments. |
void |
setStructDecls(SandDecl[] decls)
mutator for structDecls |
boolean |
targetExists(java.lang.String targetName)
Return true if the specified target is defined in this project, false otherwise. |
java.util.Collection |
updateGenChangeStatus()
Walk our generator declarations and set the change flags if their corresponding .class files are older or nonexistent. |
void |
writeCurrDecls(java.util.Collection coll,
int decltype)
Write out our current declarations so we can keep track of deleted declarations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String STRUCT_DECLS_FILE
public static final java.lang.String NODE_DECLS_FILE
protected java.lang.String name
protected SandProject[] requiredBy
protected org.apache.tools.ant.Project antProject
protected java.io.File[] envFiles
protected SandUIDeployment[] sandUIDeployments
protected SandPersistDef persistenceDef
protected java.util.Collection genDecls
protected SandDecl[] structDecls
protected SandDecl[] nodeDecls
| Constructor Detail |
|---|
public SandProject(java.lang.String name)
| Method Detail |
|---|
public java.lang.String getName()
public void setName(java.lang.String val)
public SandProject[] getRequiredBy()
public void setRequiredBy(SandProject[] downstream)
public void addRequiredBy(SandProject proj)
public boolean hasRequiredBy(java.lang.String projname)
public void removeRequiredBy(java.lang.String projname)
public org.apache.tools.ant.Project getAntProject()
public void setAntProject(org.apache.tools.ant.Project proj)
public void loadAntProject(java.lang.String sandDir,
SandProject proj)
throws SandBuildException
Make sure that the project you are loading is available for
lookup by the SandBuildDriver before calling this method.
When RequiredProject is processing the declaration, it calls
SandBuildDriver to insert or append the required project. That in
turn calls through to here, which calls the "standby" target, which
fills in the Ant project information. The call to the project ends
quickly, but we retain a reference to it so that we can call other
targets as needed.
If this processing breaks, then we will have to do more work
to keep the project "on call" in suspended animation. This can
be forced by not returning from the "standby" target call until
we are done using the project, but that's more of a hassle and
involves threads. Keeping an active reference to the project
avoids a lot of overhead when processing across projects.
SandBuildExceptionpublic java.io.File[] getEnvFiles()
public void setEnvFiles(java.io.File[] files)
public void addEnvFile(java.io.File file)
public SandUIDeployment[] getSandUIDeployments()
public void setSandUIDeployments(SandUIDeployment[] deps)
public void addUIDeployment(SandUIDeployment uidep)
public SandPersistDef getPersistenceDef()
public void setPersistenceDef(SandPersistDef val)
public java.util.Collection getGenDecls()
public void setGenDecls(java.util.Collection decls)
public void addGenDecl(SandGenDecl decl)
public SandDecl[] getStructDecls()
public void setStructDecls(SandDecl[] decls)
public void loadStructDecls()
throws SandBuildException
SandBuildException
public java.util.ArrayList loadPrevDecls(int decltype)
throws SandBuildException
This method takes one of the SandDecl.TYPE_* constants to
determine what to load.
SandBuildException
public java.util.ArrayList findStructDecls(java.io.File rootDir,
java.util.ArrayList coll)
throws SandBuildException
SandBuildException
public void writeCurrDecls(java.util.Collection coll,
int decltype)
throws SandBuildException
SandBuildException
protected void addDeletedDecls(java.util.Collection curr,
java.util.Collection prev)
throws SandBuildException
SandBuildException
protected void initDecls(java.util.Collection currDecls)
throws SandBuildException
SandBuildExceptionpublic SandDecl[] getNodeDecls()
public void setNodeDecls(SandDecl[] decls)
public void loadNodeDecls()
throws SandBuildException
SandBuildException
public java.util.ArrayList findNodeDecls(java.io.File rootDir,
java.util.ArrayList coll)
throws SandBuildException
SandBuildExceptionpublic SandDecl[] getStructAndNodeDecls()
public SandProject findProject(java.lang.String projname)
public java.lang.String getSandName()
public void callTarget(java.lang.String targetName)
throws SandBuildException
targetExists method if you want to make sure that
a target is defined.
SandBuildException
public boolean targetExists(java.lang.String targetName)
throws SandBuildException
SandBuildException
public java.util.Collection updateGenChangeStatus()
throws SandBuildException
SandBuildException
protected boolean changedGeneratorFound(java.lang.String classname)
throws SandBuildException
SandBuildException
protected boolean changedGeneratorFoundInProject(SandProject proj,
java.lang.String classname)
public void checkDefaultDebugFlag()
throws SandBuildException
SandBuildExceptionprotected java.lang.String getGeneratorSrcDirName()
public void compileGenerators()
throws SandBuildException
SandBuildException
public void cleanCompileGenerators()
throws SandBuildException
SandBuildExceptionpublic boolean genJarExists()
public void jarGenerators()
throws SandBuildException
SandBuildException
public void cleanJarGenerators()
throws SandBuildException
SandBuildException
public void docGenerators(java.util.Collection changed)
throws SandBuildException
SandBuildException
protected void setChangedGenSrcProperty(java.util.Collection changed)
throws SandBuildException
SandBuildException
public void cleanDocGenerators()
throws SandBuildException
SandBuildException
public void checkDefaultJarPrefix()
throws SandBuildException
SandBuildException
public void copyfile(java.lang.String srcfilename,
java.lang.String targetdir)
throws SandBuildException
SandBuildException
public void deletefile(java.lang.String filename)
throws SandBuildException
SandBuildException
public void docSource(java.util.Collection dirtyFiles)
throws SandBuildException
SandBuildException
public void cleanDocSource()
throws SandBuildException
SandBuildException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||