Browse Source

MultiIncrementalSupport: some notes and helper stuff added.

tags/PRE_ANDY
aclement 19 years ago
parent
commit
548ff435fe
1 changed files with 41 additions and 9 deletions
  1. 41
    9
      asm/src/org/aspectj/asm/AsmManager.java

+ 41
- 9
asm/src/org/aspectj/asm/AsmManager.java View File

* @deprecated use getDefault() method instead * @deprecated use getDefault() method instead
*/ */
private static AsmManager INSTANCE = new AsmManager(); private static AsmManager INSTANCE = new AsmManager();

private IElementHandleProvider handleProvider; private IElementHandleProvider handleProvider;
private boolean shouldSaveModel = true;
protected IHierarchy hierarchy;
private List structureListeners = new ArrayList(); private List structureListeners = new ArrayList();
private boolean shouldSaveModel = true;

public void setRelationshipMap(IRelationshipMap irm) { mapper = irm;}
public void setHierarchy(IHierarchy ih) { hierarchy=ih;}
// The model is 'manipulated' by the AjBuildManager.setupModel() code which trashes all the
// fields when setting up a new model for a batch build.
// Due to the requirements of incremental compilation we need to tie some of the info
// below to the AjState for a compilation and recover it if switching between projects.
protected IHierarchy hierarchy;
private IRelationshipMap mapper; private IRelationshipMap mapper;
private static boolean creatingModel = false;

public static boolean dumpModelPostBuild = false; // Dumping the model is expensive
public static boolean attemptIncrementalModelRepairs = false;
// for debugging ...
private static boolean creatingModel = false;
public static boolean dumpModelPostBuild = false; // Dumping the model is expensive
// SECRETAPI asc pull the secret options together into a system API you lazy fool
public static boolean attemptIncrementalModelRepairs = false;


// For offline debugging, you can now ask for the AsmManager to // For offline debugging, you can now ask for the AsmManager to
// dump the model - see the method setReporting() // dump the model - see the method setReporting()
mapper = new RelationshipMap(hierarchy); mapper = new RelationshipMap(hierarchy);
handleProvider = new FullPathHandleProvider(); handleProvider = new FullPathHandleProvider();
} }
public void createNewASM() {
hierarchy = new AspectJElementHierarchy();
mapper = new RelationshipMap(hierarchy);
}


public IHierarchy getHierarchy() { public IHierarchy getHierarchy() {
return hierarchy; return hierarchy;
} }
} }


public static void setReporting(String filename,boolean dModel,boolean dRels,boolean dDeltaProcessing,boolean deletefile) {
// SECRETAPI
public static void setReporting(String filename,boolean dModel,boolean dRels,boolean dDeltaProcessing,
boolean deletefile) {
reporting = true; reporting = true;
dumpModel = dModel; dumpModel = dModel;
dumpRelationships = dRels; dumpRelationships = dRels;
} }
} }
public static void dumptree(IProgramElement node,int indent) throws IOException {
for (int i =0 ;i<indent;i++) System.out.print(" ");
String loc = "";
if (node!=null) {
if (node.getSourceLocation()!=null)
loc = node.getSourceLocation().toString();
}
System.out.println(node+" ["+(node==null?"null":node.getKind().toString())+"] "+loc);
if (node!=null)
for (Iterator i = node.getChildren().iterator();i.hasNext();) {
dumptree((IProgramElement)i.next(),indent+2);
}
}
private void dumprels(Writer w) throws IOException { private void dumprels(Writer w) throws IOException {
IRelationshipMap irm = AsmManager.getDefault().getRelationshipMap(); IRelationshipMap irm = AsmManager.getDefault().getRelationshipMap();
int ctr = 1; int ctr = 1;
*/ */
public static boolean isCreatingModel() { return creatingModel;} public static boolean isCreatingModel() { return creatingModel;}
} }



Loading…
Cancel
Save