diff options
author | acolyer <acolyer> | 2005-03-23 16:47:55 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-03-23 16:47:55 +0000 |
commit | 68f63508828d1c1ea7076d051cc77713625f6a03 (patch) | |
tree | 40e125609a1fbfe8423f7e439d88da6b997668c4 /org.aspectj.ajdt.core | |
parent | ef3044a08dd1e5556c03e614ce8d799d61aaf041 (diff) | |
download | aspectj-68f63508828d1c1ea7076d051cc77713625f6a03.tar.gz aspectj-68f63508828d1c1ea7076d051cc77713625f6a03.zip |
fix for Bug 84122 - Allow aspectPath to contain directories
Diffstat (limited to 'org.aspectj.ajdt.core')
3 files changed, 25 insertions, 7 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java index 0c2806acc..0f8909585 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java @@ -441,7 +441,7 @@ public class BuildArgParser extends Main { while (st.hasMoreTokens()) { String filename = st.nextToken(); File jarFile = makeFile(filename); - if (jarFile.exists() && FileUtil.hasZipSuffix(filename)) { + if (jarFile.exists() && (FileUtil.hasZipSuffix(filename) || jarFile.isDirectory())) { buildConfig.getAspectpath().add(jarFile); } else { showError("bad aspectpath: " + filename); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties index 061417143..2777b867a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties @@ -22,7 +22,7 @@ AspectJ-specific options:\n\ \t-injars <jarList> use classes in <jarList> zip files as source\n\ \t (<jarList> uses classpath delimiter)\n\ \t deprecated - use inpath instead.\n\ -\t-aspectpath <list> weave aspects from <list> zip files into sources\n\ +\t-aspectpath <list> weave aspects in .class files from <list> dirs and jars/zip into sources\n\ \t (<list> uses classpath delimiter)\n\ \t-outjar <file> put output classes in zip file <file>\n\ \t-argfile <file> specify line-delimited list of source files\n\ 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 d6bb9ffda..e5668bc32 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 @@ -170,24 +170,39 @@ public class AjState { return ret; } + private boolean classFileChangedInDirSinceLastBuild(File dir) { + File[] classFiles = FileUtil.listFiles(dir, new FileFilter(){ + + public boolean accept(File pathname) { + return pathname.getName().endsWith(".class"); + } + + }); + for (int i = 0; i < classFiles.length; i++) { + long modTime = classFiles[i].lastModified(); + if (modTime + 1000 >= lastSuccessfulBuildTime) return true; + } + return false; + } + private boolean pathChange(AjBuildConfig oldConfig, AjBuildConfig newConfig) { boolean changed = false; List oldClasspath = oldConfig.getClasspath(); List newClasspath = newConfig.getClasspath(); - if (changed(oldClasspath,newClasspath)) return true; + if (changed(oldClasspath,newClasspath,true)) return true; List oldAspectpath = oldConfig.getAspectpath(); List newAspectpath = newConfig.getAspectpath(); - if (changed(oldAspectpath,newAspectpath)) return true; + if (changed(oldAspectpath,newAspectpath,true)) return true; List oldInJars = oldConfig.getInJars(); List newInJars = newConfig.getInJars(); - if (changed(oldInJars,newInJars)) return true; + if (changed(oldInJars,newInJars,false)) return true; List oldInPath = oldConfig.getInpath(); List newInPath = newConfig.getInpath(); - if (changed(oldInPath, newInPath)) return true; + if (changed(oldInPath, newInPath,false)) return true; return changed; } - private boolean changed(List oldPath, List newPath) { + private boolean changed(List oldPath, List newPath, boolean checkClassFiles) { if (oldPath == null) oldPath = new ArrayList(); if (newPath == null) newPath = new ArrayList(); if (oldPath.size() != newPath.size()) { @@ -207,6 +222,9 @@ public class AjState { if (f.exists() && !f.isDirectory() && (f.lastModified() >= lastSuccessfulBuildTime)) { return true; } + if (f.exists() && f.isDirectory() && checkClassFiles) { + return classFileChangedInDirSinceLastBuild(f); + } } return false; } |