aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/testsrc
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2017-10-20 12:46:00 -0700
committerAndy Clement <aclement@pivotal.io>2017-10-20 12:46:00 -0700
commit41a5b8077d1bfc1b7fd4fa614baabd0cd38e0873 (patch)
tree6d7216c31374ee4f168a32f8e1eb2fdee2b9c611 /org.aspectj.ajdt.core/testsrc
parent2b2dbe74aeee05f1e35341eff4685f7164464e79 (diff)
downloadaspectj-41a5b8077d1bfc1b7fd4fa614baabd0cd38e0873.tar.gz
aspectj-41a5b8077d1bfc1b7fd4fa614baabd0cd38e0873.zip
wip allowing flexibility in test infra for using modules with subdirs
Diffstat (limited to 'org.aspectj.ajdt.core/testsrc')
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java
index 53b89e3d8..eeb6136a5 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java
@@ -366,14 +366,14 @@ public class Ajc {
if (FileUtil.hasSourceSuffix(args[i])) {
File f = new File(args[i]);
// newArgs[i] = new File(baseDir,args[i]).getAbsolutePath(); // might be quicker?
- newArgs[i] = adjustFileOrDir(f, doCopy).getAbsolutePath();
+ newArgs[i] = adjustFileOrDir(f, doCopy, false).getAbsolutePath();
} else if (args[i].endsWith(".xml") && !args[i].startsWith("-")) {
if (i > 0 && args[i - 1].equals("-outxmlfile")) {
// dont adjust it
} else {
File f = new File(args[i]);
// newArgs[i] = new File(baseDir,args[i]).getAbsolutePath(); // might be quicker?
- newArgs[i] = adjustFileOrDir(f, doCopy).getAbsolutePath();
+ newArgs[i] = adjustFileOrDir(f, doCopy, false).getAbsolutePath();
}
} else {
if ((args[i].equals("-aspectpath") || args[i].equals("-inpath") || args[i].equals("-injars")
@@ -387,10 +387,11 @@ public class Ajc {
copyThisTime = false;
hasOutdir = true;
}
+ boolean isOutjar = args[i].equals("-outjar");
StringTokenizer strTok = new StringTokenizer(args[++i], File.pathSeparator);
while (strTok.hasMoreTokens()) {
File f = new File(strTok.nextToken());
- buff.append(adjustFileOrDir(f, copyThisTime).getAbsolutePath());
+ buff.append(adjustFileOrDir(f, copyThisTime, isOutjar).getAbsolutePath());
if (strTok.hasMoreTokens())
buff.append(File.pathSeparator);
}
@@ -404,7 +405,7 @@ public class Ajc {
// could be resource file
File f = new File(args[i]);
if (f.exists()) {
- newArgs[i] = adjustFileOrDir(f, doCopy).getAbsolutePath();
+ newArgs[i] = adjustFileOrDir(f, doCopy, false).getAbsolutePath();
}
}
}
@@ -426,7 +427,7 @@ public class Ajc {
return newArgs;
}
- private File adjustFileOrDir(File from, boolean doCopy) throws IOException {
+ private File adjustFileOrDir(File from, boolean doCopy, boolean ensureDirsExist) throws IOException {
File to = from;
File ret = from;
if (!from.isAbsolute()) {
@@ -435,6 +436,10 @@ public class Ajc {
String relativeToPath = (fromParent != null) ? (fromParent.getPath() + File.separator) : "";
if (baseDir != null) {
from = new File(baseDir, from.getPath());
+// if (ensureDirsExist) {
+// File toMkdir = (ret.getPath().endsWith(".jar") || ret.getPath().endsWith(".zip"))?ret.getParentFile():ret;
+// toMkdir.mkdirs();
+// }
}
if (!from.exists())
return ret;