diff options
author | aclement <aclement> | 2008-09-02 23:24:19 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-09-02 23:24:19 +0000 |
commit | fd0b4cd65d9f3065f6a998c2bdcf5480014802c8 (patch) | |
tree | 65d24cc45e0b16cc6233c86c9ac3b434aae2d585 | |
parent | 42722c9843f42060ef892853fd5a9482072b351d (diff) | |
download | aspectj-fd0b4cd65d9f3065f6a998c2bdcf5480014802c8.tar.gz aspectj-fd0b4cd65d9f3065f6a998c2bdcf5480014802c8.zip |
245566: final config interface change
3 files changed, 67 insertions, 2 deletions
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java index cf9751915..61eff8711 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java @@ -65,6 +65,11 @@ public class AjdeInteractionTestbed extends TestCase { ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).addProjectSourceFileChanged(changedFile); } + public void addClasspathEntryChanged(String projectName, String changedDir) { + AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName); + ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).addClasspathEntryChanged(changedDir); + } + public void configureNonStandardCompileOptions(String projectName, String options) { AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName); ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setNonStandardOptions(options); diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalPerformanceTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalPerformanceTests.java index 3e4a7a5fd..05cca27c6 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalPerformanceTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalPerformanceTests.java @@ -13,6 +13,8 @@ package org.aspectj.systemtest.incremental.tools; import java.io.File; import java.io.IOException; +import org.aspectj.ajde.core.ICompilerConfiguration; + /** * Testing the performance of incremental compilation as it would be in AJDT. * @@ -90,9 +92,52 @@ public class IncrementalPerformanceTests extends AbstractMultiProjectIncremental assertTrue(whitespacechangeDoTellCompiler < fullbuildtime); assertTrue(nochangebuild < whitespacechangeDontTellCompiler); - assertTrue(nochangebuild < whitespacechangeDoTellCompiler); + // assertTrue(nochangebuild < whitespacechangeDoTellCompiler); + + // assertTrue(whitespacechangeDoTellCompiler < whitespacechangeDontTellCompiler); + } + + /** + * Project dependencies are captured by using classpath. The dependee project has the bin folder for the project upon which it + * depends on its classpath. This can make it expensive when determining whether to build the dependee project as we may need to + * analyse all the classpath entries, we don't know which are project related. However, a new API in ICompilerConfiguration + * called getClasspathElementsWithModifiedContents() can be returned by an implementor to tell us which parts of the classpath + * to check. + */ + public void testBuildingTwoProjects() { + AjdeInteractionTestbed.VERBOSE = true; + + String projA = "Proj64"; + String projB = "Dependee"; + + // A full build: + initialiseProject(projA); + initialiseProject(projB); + configureNewProjectDependency(projB, projA); + build(projA); + checkWasFullBuild(); + build(projB); + checkWasFullBuild(); + + alter(projA, "C43changeOne"); // C43 made package private + build(projA); + setNextChangeResponse(projB, ICompilerConfiguration.EVERYTHING); + build(projB); + long timeTakenWhenFullyAnalysingClasspath = getTimeTakenForBuild(projB); + checkWasntFullBuild(); + + alter(projA, "C43changeOne"); // C43 made package private + build(projA); + addClasspathEntryChanged(projB, getProjectRelativePath(projA, "bin").getPath()); + // waitForReturn(); + build(projB); + long timeTakenWhenFullyToldSpecifically = getTimeTakenForBuild(projB); + // waitFor10(); + checkWasntFullBuild(); + + System.out.println("Without: " + timeTakenWhenFullyAnalysingClasspath + "ms With: " + timeTakenWhenFullyToldSpecifically + + "ms"); -// assertTrue(whitespacechangeDoTellCompiler < whitespacechangeDontTellCompiler); } // --- helper code --- diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java index 18946cfb1..192900ae6 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java @@ -39,6 +39,7 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio private String outjar; private String nonstandardoptions; private List modifiedFiles; + private List modifiedDirs; private List projectSourceFiles = new ArrayList(); private String projectPath; @@ -182,6 +183,15 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio } } + public void addClasspathEntryChanged(String f) { + if (this.modifiedDirs == null) { + this.modifiedDirs = new ArrayList(); + } + if (f != null) { + modifiedDirs.add(f); + } + } + public void setSourcePathResources(Map sourcePathResources) { this.sourcePathResources = sourcePathResources; this.changed |= ICompilerConfiguration.PROJECTSOURCERESOURCES_CHANGED; @@ -204,6 +214,11 @@ public class MultiProjTestCompilerConfiguration implements ICompilerConfiguratio public void configurationRead() { changed = NO_CHANGES; modifiedFiles = null; + modifiedDirs = null; + } + + public List getClasspathElementsWithModifiedContents() { + return modifiedDirs; } } |