Browse Source

245566: final config interface change

tags/V1_6_2
aclement 15 years ago
parent
commit
fd0b4cd65d

+ 5
- 0
tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java View File

@@ -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);

+ 47
- 2
tests/src/org/aspectj/systemtest/incremental/tools/IncrementalPerformanceTests.java View File

@@ -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 ---

+ 15
- 0
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestCompilerConfiguration.java View File

@@ -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;
}

}

Loading…
Cancel
Save