diff options
author | acolyer <acolyer> | 2004-03-19 12:28:19 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-03-19 12:28:19 +0000 |
commit | 68e346c52831d8d98263ee5e2e197ee1f868a76e (patch) | |
tree | 096470ace86f14322b734441c07bfb3c53b729c6 /org.aspectj.ajdt.core | |
parent | 0a017593dcbeab409c1634da87b3f500b848e903 (diff) | |
download | aspectj-68e346c52831d8d98263ee5e2e197ee1f868a76e.tar.gz aspectj-68e346c52831d8d98263ee5e2e197ee1f868a76e.zip |
Improvements to incremental compilation of binary source to:
1) Add dependents of changed binary source files
2) Only add changed binary source files in the first compile-loop
iteration.
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java | 8 | ||||
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java | 31 |
2 files changed, 22 insertions, 17 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index 65dad3eff..0b93dc564 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -156,7 +156,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc bcelWorld.setModel(AsmManager.getDefault().getHierarchy()); // in incremental build, only get updated model? } - binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(); + binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(true); performCompilation(buildConfig.getFiles()); if (handler.hasErrors()) { return false; @@ -167,17 +167,17 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc // bcelWorld.setModel(StructureModelManager.INSTANCE.getStructureModel()); // } // System.err.println("XXXX start inc "); + binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(true); List files = state.getFilesToCompile(true); - binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(); - boolean hereWeGoAgain = !(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty()); + boolean hereWeGoAgain = !(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty()); for (int i = 0; (i < 5) && hereWeGoAgain; i++) { // System.err.println("XXXX inc: " + files); performCompilation(files); if (handler.hasErrors() || (progressListener!=null && progressListener.isCancelledRequested())) { return false; } + binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(false); files = state.getFilesToCompile(false); - binarySourcesForTheNextCompile = state.getBinaryFilesToCompile(); hereWeGoAgain = !(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty()); } if (!files.isEmpty()) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java index 82dfe6263..9c531df4a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -228,25 +228,30 @@ public class AjState { return thisTime; } - public Map /* String -> List<ucf> */ getBinaryFilesToCompile() { + public Map /* String -> List<ucf> */ getBinaryFilesToCompile(boolean firstTime) { if (lastSuccessfulBuildTime == -1 || buildConfig == null) { return binarySourceFiles; } // else incremental... Map toWeave = new HashMap(); - List addedOrModified = new ArrayList(); - addedOrModified.addAll(addedBinaryFiles); - addedOrModified.addAll(getModifiedBinaryFiles()); - for (Iterator iter = addedOrModified.iterator(); iter.hasNext();) { - AjBuildConfig.BinarySourceFile bsf = (AjBuildConfig.BinarySourceFile) iter.next(); - UnwovenClassFile ucf = createUnwovenClassFile(bsf); - if (ucf == null) continue; - List ucfs = new ArrayList(); - ucfs.add(ucf); - binarySourceFiles.put(bsf.binSrc.getPath(),ucfs); - toWeave.put(bsf.binSrc.getPath(),ucfs); + if (firstTime) { + List addedOrModified = new ArrayList(); + addedOrModified.addAll(addedBinaryFiles); + addedOrModified.addAll(getModifiedBinaryFiles()); + for (Iterator iter = addedOrModified.iterator(); iter.hasNext();) { + AjBuildConfig.BinarySourceFile bsf = (AjBuildConfig.BinarySourceFile) iter.next(); + UnwovenClassFile ucf = createUnwovenClassFile(bsf); + if (ucf == null) continue; + List ucfs = new ArrayList(); + ucfs.add(ucf); + addDependentsOf(ucf.getClassName()); + binarySourceFiles.put(bsf.binSrc.getPath(),ucfs); + toWeave.put(bsf.binSrc.getPath(),ucfs); + } + deleteBinaryClassFiles(); + } else { + // return empty set... we've already done our bit. } - deleteBinaryClassFiles(); return toWeave; } |