Browse Source

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
master
Stefan Bodewig 21 years ago
parent
commit
a349a7f732
1 changed files with 8 additions and 19 deletions
  1. +8
    -19
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java

+ 8
- 19
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java View File

@@ -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.


Loading…
Cancel
Save