SF.net SVN: ant-contrib: [88] trunk/ant-contrib/src/java/net/sf/antcontrib/ net/URLImportTask.java

[email protected]
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
Revision: 88
          http://svn.sourceforge.net/ant-contrib/?rev=88&view=rev
Author:   mattinger
Date:     2007-03-05 11:37:57 -0800 (Mon, 05 Mar 2007)

Log Message:
-----------
allow import of arbitrary resource (not just build.xml).

Modified Paths:
--------------
    trunk/ant-contrib/src/java/net/sf/antcontrib/net/URLImportTask.java

Modified: trunk/ant-contrib/src/java/net/sf/antcontrib/net/URLImportTask.java
===================================================================
--- trunk/ant-contrib/src/java/net/sf/antcontrib/net/URLImportTask.java	2007-03-01 23:19:57 UTC (rev 87)
+++ trunk/ant-contrib/src/java/net/sf/antcontrib/net/URLImportTask.java	2007-03-05 19:37:57 UTC (rev 88)
@@ -74,6 +74,7 @@
 	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 @@
 		this.repositoryUrl = repositoryUrl;
 	}
 
+	public void setResource(String resource) {
+		this.resource = resource;
+	}
+
 	public void execute()
 		throws BuildException {
 		
@@ -244,9 +249,9 @@
 	    	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());
 	    	}
 	    }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.