From 6eadd8093b3a132c62d4c0863dbffa39e45993aa Mon Sep 17 00:00:00 2001 From: mattinger Date: Mon, 5 Mar 2007 19:37:57 +0000 Subject: allow import of arbitrary resource (not just build.xml). git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/trunk/ant-contrib@88 32d7a393-a5a9-423c-abd3-5d954feb1f2f --- src/java/net/sf/antcontrib/net/URLImportTask.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/net/sf/antcontrib/net/URLImportTask.java b/src/java/net/sf/antcontrib/net/URLImportTask.java index e513a8a..e95b53d 100755 --- a/src/java/net/sf/antcontrib/net/URLImportTask.java +++ b/src/java/net/sf/antcontrib/net/URLImportTask.java @@ -74,6 +74,7 @@ public class URLImportTask private String repositoryDir; private URL ivyConfUrl; private File ivyConfFile; + private String resource = "build.xml"; private String artifactPattern = "/[org]/[module]/[ext]s/[module]-[revision].[ext]"; private String ivyPattern = "/[org]/[module]/ivy-[revision].xml"; private boolean verbose = false; @@ -118,6 +119,10 @@ public class URLImportTask this.repositoryUrl = repositoryUrl; } + public void setResource(String resource) { + this.resource = resource; + } + public void execute() throws BuildException { @@ -244,9 +249,9 @@ public class URLImportTask expand.setSrc(file); expand.setDest(dir); expand.perform(); - importFile = new File(dir, "build.xml"); + importFile = new File(dir, resource); if (! importFile.exists()) { - throw new BuildException("Cannot find a 'build.xml' file in " + + throw new BuildException("Cannot find a '" + resource + "' file in " + file.getName()); } } -- cgit v1.2.3