stevel 2002/06/18 23:18:43
Modified: src/main/org/apache/tools/ant/taskdefs/optional/dotnet Tag:
ANT_15_BRANCH WsdlToDotnet.java
Log:
bug fix (NPE) and doc update
Revision Changes Path
No revision
No revision
1.5.2.2 +54 -17
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java
Index: WsdlToDotnet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -r1.5.2.1 -r1.5.2.2
--- WsdlToDotnet.java 7 May 2002 23:08:12 -0000 1.5.2.1
+++ WsdlToDotnet.java 19 Jun 2002 06:18:43 -0000 1.5.2.2
@@ -58,13 +58,13 @@
import java.io.File;
/**
- * Task to convert a WSDL file/url into a dotnet language
- * see "Creating an XML Web Service Proxy", "wsdl.exe" docs in
- * the framework SDK docos
+ * Task to convert a WSDL file/url into a dotnet language.
+ * See "Creating an XML Web Service Proxy", "wsdl.exe" docs in
+ * the framework SDK documentation
* @author Steve Loughran [EMAIL PROTECTED]
* @version 0.5
* @ant.task name="wsdltodotnet" category="dotnet"
- * @since ant 1.5
+ * @since Ant 1.5
*/
public class WsdlToDotnet extends Task {
@@ -110,38 +110,70 @@
protected String extraOptions = null;
/**
- *
- */
+ * Name of the file to generate. Required
+ * @param destFile filename
+ */
public void setDestFile(File destFile) {
this.destFile = destFile;
}
+ /**
+ * Sets the URL to fetch. Fetching is by wsdl.exe; Ant proxy settings
+ * are ignored; either url or srcFile is required.
+ * @param url url to save
+ */
+
public void setUrl(String url) {
this.url = url;
}
+ /**
+ * The local WSDL file to parse; either url or srcFile is required.
+ * @param srcFile name of WSDL file
+ */
public void setSrcFile(File srcFile) {
this.srcFile = srcFile;
}
+ /**
+ * set the language; one of "CS", "JS", or "VB"
+ * optional, default is CS for C# source
+ * @param language language to generate
+ */
public void setLanguage(String language) {
this.language = language;
}
+ /**
+ * flag to enable server side code generation;
+ * optional, default=false
+ * @param server server-side flag
+ */
+
public void setServer(boolean server) {
this.server = server;
}
+ /**
+ * namespace to place the source in.
+ * optional; default ""
+ * @param namespace new namespace
+ */
public void setNamespace(String namespace) {
this.namespace = namespace;
}
+ /**
+ * Should failure halt the build? optional, default=true
+ * @param failOnError new failure option
+ */
public void setFailOnError(boolean failOnError) {
this.failOnError = failOnError;
}
-
+
/**
- * Sets the ExtraOptions attribute
+ * Any extra WSDL.EXE options which aren't explicitly
+ * supported by the ant wrapper task; optional
*
[EMAIL PROTECTED] extraOptions The new ExtraOptions value
*/
@@ -204,16 +236,21 @@
}
command.addArgument("/namespace:", namespace);
command.addArgument(extraOptions);
- //because these args arent added when null, we can
- //set both of these and let either of them
- command.addArgument(srcFile.toString());
- command.addArgument(url);
-
- //rebuild unless the dest file is newer than the source file
+
+ //set source and rebuild options
boolean rebuild = true;
- if (srcFile.exists() && destFile.exists() &&
- srcFile.lastModified() <= destFile.lastModified()) {
- rebuild = false;
+ if(srcFile!=null) {
+ command.addArgument(srcFile.toString());
+ //rebuild unless the dest file is newer than the source file
+ if (srcFile.exists() && destFile.exists() &&
+ srcFile.lastModified() <= destFile.lastModified()) {
+ rebuild = false;
+ }
+ } else {
+ //no source file? must be a url, which has no dependency
+ //handling
+ rebuild=true;
+ command.addArgument(url);
}
if (rebuild) {
command.runCommand();
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>