for (Iterator i = buildConfig.getAspectpath().iterator(); i.hasNext();) {
File f = (File) i.next();
- bcelWeaver.addLibraryJarFile(f);
+ if (!f.exists()) {
+ IMessage message = new Message("invalid aspectpath entry: "+f.getName(),null,true);
+ handler.handleMessage(message);
+ } else {
+ bcelWeaver.addLibraryJarFile(f);
+ }
}
// String lintMode = buildConfig.getLintMode();
public static void configureNonStandardCompileOptions(String options) {
MyBuildOptionsAdapter.setNonStandardOptions(options);
}
+
+ public static void configureAspectPath(Set aspectpath) {
+ MyProjectPropertiesAdapter.setAspectpath(aspectpath);
+ }
// End of methods for configuring the build
MyStateListener.reset();
MyBuildProgressMonitor.reset();
MyTaskListManager.reset();
+ MyProjectPropertiesAdapter.reset();
// Create a sandbox in which to work
createEmptySandbox();
return _instance;
}
+ public static void reset() {
+ _instance.aspectPath=null;
+ }
+
private String projectName = null;
private String classPath = "";
+ private Set aspectPath = null;
public static void setActiveProject(String n) {
_instance.projectName = n;
this.classPath = path;
}
+ public static void setAspectpath(Set path) {
+ _instance.aspectPath = path;
+ }
+
// interface impl below
// DOESSOMETHING
}
public Set getAspectPath() {
- log("MyProjectProperties.getAspectPath()");
- return null;
+ log("MyProjectProperties.getAspectPath("+aspectPath+")");
+ return aspectPath;
}
public static void log(String s) {
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.aspectj.ajdt.internal.core.builder.AjState;
import org.aspectj.ajdt.internal.core.builder.IncrementalStateManager;
checkWasntFullBuild();
checkCompileWeaveCount(0,0);
}
+
+ // source code doesnt matter, we are checking invalid path handling
+ public void testInvalidAspectpath_pr121395() {
+ initialiseProject("P1");
+ File f = new File("foo.jar");
+ Set s = new HashSet();
+ s.add(f);
+ configureAspectPath(s);
+ build("P1"); // This first build will be batch
+ checkForError("invalid aspectpath entry");
+ }
// Make simple changes to a project, adding a class