From a349a7f732f4878c78d104d07adc485049ced450 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 11 Aug 2004 09:46:16 +0000 Subject: [PATCH] Use a different way to deal with Mono's "I don't like absolute Unix path names" feature - change into the directory that holds the WSDL file and only use the file name. (1) restores the old signature of setSrcFile (2) makes XSD include with relative URLs work (and probably WSDL import as well). git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276769 13f79535-47bb-0310-9956-ffa450edef68 --- .../optional/dotnet/WsdlToDotnet.java | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java index e566d4a16..bc7b53ddd 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java @@ -57,11 +57,6 @@ public class WsdlToDotnet extends Task { */ private File destFile = null; - /** - * name of source file - */ - private String srcFileName = null; - /** * language; defaults to C# */ @@ -154,18 +149,10 @@ public class WsdlToDotnet extends Task { /** * The local WSDL file to parse; either url or srcFile is required. - * @param srcFileName name of WSDL file + * @param srcFile WSDL file */ - public void setSrcFile(String srcFileName) { - if (new File(srcFileName).isAbsolute()) { - srcFileName = FileUtils.newFileUtils() - .removeLeadingPath(getProject().getBaseDir(), - new File(srcFileName));; - } - //save the string name of the file - this.srcFileName = srcFileName; - //and save the file - wsdl.setFile(getProject().resolveFile(srcFileName)); + public void setSrcFile(File srcFile) { + wsdl.setFile(srcFile); } /** @@ -325,10 +312,12 @@ public class WsdlToDotnet extends Task { } String path; //mark for a rebuild if the dest file is newer - path=wsdl.evaluate(); - if ( !compiler.supportsAbsoluteFiles() ) { + path = wsdl.evaluate(); + if (!compiler.supportsAbsoluteFiles() && wsdl.getFile() != null) { // Mono 1.0's wsdl doesn't deal with absolute paths - path = srcFileName; + File f = wsdl.getFile(); + command.setDirectory(f.getParentFile()); + path = f.getName(); } command.addArgument(path); //add in any extra files.