aboutsummaryrefslogtreecommitdiffstats
path: root/taskdefs
diff options
context:
space:
mode:
authoraclement <aclement>2006-05-04 07:14:47 +0000
committeraclement <aclement>2006-05-04 07:14:47 +0000
commit5a01932b9dbdf81fe41e029fa56ede17364a2c2e (patch)
treea2991f73f2b496670e3de21f00538fbae9da891d /taskdefs
parentcb5dfe759852d4965c692934ed7e14c41f61b715 (diff)
downloadaspectj-5a01932b9dbdf81fe41e029fa56ede17364a2c2e.tar.gz
aspectj-5a01932b9dbdf81fe41e029fa56ede17364a2c2e.zip
fixes for 137235 (contributed by Ron): more intelligent logic for determining if a path entry is a jar/zip (don't just rely on suffix, some new .bndl files seem to be becoming popular...)
Diffstat (limited to 'taskdefs')
-rw-r--r--taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java8
-rw-r--r--taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java11
2 files changed, 12 insertions, 7 deletions
diff --git a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
index 86434732f..19b440f55 100644
--- a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
+++ b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
@@ -1106,12 +1106,8 @@ public class AjcTask extends MatchingTask {
|| (null != inpathDirCopyFilter)) {
String path = outjar.getAbsolutePath();
int len = FileUtil.zipSuffixLength(path);
- if (len < 1) {
- this.logger.info("not copying resources - weird outjar: " + path);
- } else {
- path = path.substring(0, path.length()-len) + ".tmp.jar";
- tmpOutjar = new File(path);
- }
+ path = path.substring(0, path.length()-len) + ".tmp.jar";
+ tmpOutjar = new File(path);
}
if (null == tmpOutjar) {
cmd.addFlagged("-outjar", outjar.getAbsolutePath());
diff --git a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
index 1545d52b2..788422bd9 100644
--- a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
+++ b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
@@ -359,13 +359,22 @@ public class AjcTaskTest extends TestCase {
}
public void testInpathDirCopyFilterWithJar() throws IOException {
+ checkInpathCopy("testInpathDirCopyFilterWithJar-out.jar");
+ }
+
+ // test resource copying for oddball jar files that don't end in .jar
+ public void testInpathDirCopyFilterWithOddjar() throws IOException {
+ checkInpathCopy("testInpathDirCopyFilterWithJar-outJarFile");
+ }
+
+ private void checkInpathCopy(String outjarFileStr) throws IOException {
// inpathDirCopyFilter works with output jar
File destDir = getTempDir();
assertTrue(
"unable to create " + destDir,
destDir.canRead() || destDir.mkdirs());
AjcTask task = getTask(NOFILE, null);
- File destJar = new File(destDir, "testInpathDirCopyFilterWithJar-out.jar");
+ File destJar = new File(destDir, outjarFileStr);
task.setOutjar(destJar);
Project p = task.getProject();
Path indirs = new Path(p);