aboutsummaryrefslogtreecommitdiffstats
path: root/build/src/org
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-05-25 19:26:55 +0000
committerwisberg <wisberg>2003-05-25 19:26:55 +0000
commit85cd0a0f9b211f7e7239194bacd68f12aaff42bf (patch)
tree4f7976e4a936a2fe7c69be6b77c132a404ab4dec /build/src/org
parent9c8be5897d3d19564cf7401b42414e49dcc816ae (diff)
downloadaspectj-85cd0a0f9b211f7e7239194bacd68f12aaff42bf.tar.gz
aspectj-85cd0a0f9b211f7e7239194bacd68f12aaff42bf.zip
Fix for failure building with useEclipseCompiles testing-drivers initially (or any module that only indirectly depended on jdt.core, which has no sources)
- better logging - checking zip results - returns false positive for empty zips - compile(..) API change for adopting classes
Diffstat (limited to 'build/src/org')
-rw-r--r--build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java49
1 files changed, 33 insertions, 16 deletions
diff --git a/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java b/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
index 0e8b70209..004bec0c5 100644
--- a/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
+++ b/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
@@ -204,16 +204,12 @@ public class AntBuilder extends Builder {
return copy;
}
- protected boolean compile(Module module, File classesDir, List errors) {
- // XXX test whether build.compiler property takes effect automatically
- // I suspect it requires the proper adapter setup.
- Javac javac = new Javac();
- setupTask(javac, "javac");
- javac.setDestdir(classesDir);
- if (!classesDir.mkdirs()) {
- errors.add("unable to create classes directory");
- return false;
- }
+ protected boolean compile(
+ Module module,
+ File classesDir,
+ boolean useExistingClasses,
+ List errors) {
+
// -- source paths
Path path = new Path(project);
boolean hasSourceDirectories = false;
@@ -224,18 +220,36 @@ public class AntBuilder extends Builder {
hasSourceDirectories = true;
}
}
+ if (!classesDir.exists() && !classesDir.mkdirs()) {
+ errors.add("compile - unable to create " + classesDir);
+ return false;
+ }
if (!hasSourceDirectories) { // none - dump minimal file and exit
File minFile = new File(classesDir, module.name);
+ FileWriter fw = null;
try {
- FileWriter fw = new FileWriter(minFile);
+ fw = new FileWriter(minFile);
fw.write(module.name);
- fw.close();
} catch (IOException e) {
- // ignore
+ errors.add("IOException writing "
+ + module.name
+ + " to "
+ + minFile
+ + ": "
+ + Util.renderException(e));
+ } finally {
+ Util.close(fw);
}
- // XXX signal?
return true; // nothing to compile - ok
}
+ if (useExistingClasses) {
+ return true;
+ }
+ // XXX test whether build.compiler property takes effect automatically
+ // I suspect it requires the proper adapter setup.
+ Javac javac = new Javac();
+ setupTask(javac, "javac");
+ javac.setDestdir(classesDir);
javac.setSrcdir(path);
path = null;
@@ -360,7 +374,10 @@ public class AntBuilder extends Builder {
try {
handler.log("assembling " + module + " in " + module.getModuleJar());
- return executeTask(zip);
+ return executeTask(zip)
+ // zip returns true when it doesn't create zipfile
+ // because there are no entries to add, so verify done
+ && Util.canReadFile(module.getModuleJar());
} catch (BuildException e) {
errors.add("BuildException zipping " + module + ": " + e.getMessage());
return false;
@@ -622,7 +639,7 @@ class ProductBuilder extends AntBuilder {
if (!targDir.canWrite() && !targDir.mkdirs()) {
if (buildSpec.verbose) {
- handler.log("unable to create " + targDir);
+ handler.log("buildProduct unable to create " + targDir);
}
return false;
}