summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-04-26 18:09:43 +0000
committeraclement <aclement>2005-04-26 18:09:43 +0000
commit548ff435fed4b2e8ac7c10a96a885bc9b7c94f00 (patch)
tree89fb35f4767a72ae357e30e6a3f44ef333bb0d42
parent3951dea95d6a0bcca24965457f93712b5fd88d04 (diff)
downloadaspectj-548ff435fed4b2e8ac7c10a96a885bc9b7c94f00.tar.gz
aspectj-548ff435fed4b2e8ac7c10a96a885bc9b7c94f00.zip
MultiIncrementalSupport: some notes and helper stuff added.
-rw-r--r--asm/src/org/aspectj/asm/AsmManager.java50
1 files changed, 41 insertions, 9 deletions
diff --git a/asm/src/org/aspectj/asm/AsmManager.java b/asm/src/org/aspectj/asm/AsmManager.java
index 623638b79..b6f710d13 100644
--- a/asm/src/org/aspectj/asm/AsmManager.java
+++ b/asm/src/org/aspectj/asm/AsmManager.java
@@ -34,17 +34,27 @@ public class AsmManager {
* @deprecated use getDefault() method instead
*/
private static AsmManager INSTANCE = new AsmManager();
+
+
private IElementHandleProvider handleProvider;
- private boolean shouldSaveModel = true;
- protected IHierarchy hierarchy;
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 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
// dump the model - see the method setReporting()
@@ -64,6 +74,13 @@ public class AsmManager {
mapper = new RelationshipMap(hierarchy);
handleProvider = new FullPathHandleProvider();
}
+
+ public void createNewASM() {
+ hierarchy = new AspectJElementHierarchy();
+ mapper = new RelationshipMap(hierarchy);
+ }
+
+
public IHierarchy getHierarchy() {
return hierarchy;
@@ -350,7 +367,9 @@ public class AsmManager {
}
}
- 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;
dumpModel = dModel;
dumpRelationships = dRels;
@@ -411,6 +430,20 @@ public class AsmManager {
}
}
+ 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 {
IRelationshipMap irm = AsmManager.getDefault().getRelationshipMap();
int ctr = 1;
@@ -812,6 +845,5 @@ public class AsmManager {
*/
public static boolean isCreatingModel() { return creatingModel;}
-
}