You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2004/07/28 15:46:37 UTC
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet WsdlToDotnet.java
bodewig 2004/07/28 06:46:37
Modified: src/etc/testcases/taskdefs/optional WsdlToDotnet.xml
src/main/org/apache/tools/ant/taskdefs/optional/dotnet
WsdlToDotnet.java
Log:
<wsdltodotnet> should now work with Mono 1.0 as well
Revision Changes Path
1.6 +4 -4 ant/src/etc/testcases/taskdefs/optional/WsdlToDotnet.xml
Index: WsdlToDotnet.xml
===================================================================
RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/optional/WsdlToDotnet.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- WsdlToDotnet.xml 23 Sep 2003 06:29:20 -0000 1.5
+++ WsdlToDotnet.xml 28 Jul 2004 13:46:36 -0000 1.6
@@ -40,6 +40,7 @@
<echo> wsdl.found=${wsdl.found}</echo>
<condition property="csc.found">
<or>
+ <available file="mcs" filepath="${env.PATH}" />
<available file="csc" filepath="${env.PATH}" />
<available file="csc.exe" filepath="${env.PATH}" />
<available file="csc.exe" filepath="${env.Path}" />
@@ -57,7 +58,6 @@
<condition property="dotnetapps.found">
<and>
<isset property="csc.found"/>
- <isset property="vbc.found"/>
<isset property="wsdl.found"/>
</and>
</condition>
@@ -142,7 +142,7 @@
- <target name="testLocalWsdlVB" depends="init">
+ <target name="testLocalWsdlVB" depends="init" if="vbc.found">
<wsdltodotnet destFile="${out.vbc}"
language="VB"
srcFile="${local.wsdl}"
@@ -160,7 +160,7 @@
</target>
<target name="testLocalWsdlServerVB"
- depends="init" >
+ depends="init" if="vbc.found">
<wsdltodotnet destFile="${out.vbc}"
language="VB"
srcFile="${local.wsdl}"
@@ -179,7 +179,7 @@
<fail unless="app.created">No app created</fail>
</target>
- <target name="testInvalidExtraOpsVB" depends="init" if="vbc.found">
+ <target name="testInvalidExtraOpsVB" depends="init">
<wsdltodotnet destFile="${out.vbc}"
language="VB"
srcFile="${local.wsdl}"
1.22 +38 -8 ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java
Index: WsdlToDotnet.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- WsdlToDotnet.java 9 Mar 2004 16:48:18 -0000 1.21
+++ WsdlToDotnet.java 28 Jul 2004 13:46:37 -0000 1.22
@@ -19,6 +19,8 @@
import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.condition.Os;
+import org.apache.tools.ant.util.FileUtils;
/**
* Converts a WSDL file or URL resource into a .NET language.
@@ -57,7 +59,7 @@
/**
* name of source file
*/
- private File srcFile = null;
+ private String srcFileName = null;
/**
* language; defaults to C#
@@ -85,6 +87,11 @@
protected String extraOptions = null;
/**
+ * @since Ant 1.7
+ */
+ private boolean isMono = !Os.isFamily("windows");
+
+ /**
* Name of the file to generate. Required
* @param destFile filename
*/
@@ -106,8 +113,13 @@
* 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;
+ public void setSrcFile(String srcFileName) {
+ if (new File(srcFileName).isAbsolute()) {
+ srcFileName = FileUtils.newFileUtils()
+ .removeLeadingPath(getProject().getBaseDir(),
+ new File(srcFileName));;
+ }
+ this.srcFileName = srcFileName;
}
/**
@@ -158,6 +170,17 @@
}
/**
+ * Explicitly override the Mono auto-detection.
+ *
+ * <p>Defaults to false on Windows and true on any other platform.</p>
+ *
+ * @since Ant 1.7
+ */
+ public void setMono(boolean b) {
+ isMono = b;
+ }
+
+ /**
* validation code
* @throws BuildException if validation failed
*/
@@ -170,15 +193,16 @@
throw new BuildException(
"destination file is a directory");
}
- if (url != null && srcFile != null) {
+ if (url != null && srcFileName != null) {
throw new BuildException(
"you can not specify both a source file and a URL");
}
- if (url == null && srcFile == null) {
+ if (url == null && srcFileName == null) {
throw new BuildException(
"you must specify either a source file or a URL");
}
- if (srcFile != null) {
+ if (srcFileName != null) {
+ File srcFile = getProject().resolveFile(srcFileName);
if (!srcFile.exists()) {
throw new BuildException(
"source file does not exist");
@@ -213,8 +237,14 @@
//set source and rebuild options
boolean rebuild = true;
- if (srcFile != null) {
- command.addArgument(srcFile.toString());
+ if (srcFileName != null) {
+ File srcFile = getProject().resolveFile(srcFileName);
+ if (isMono) {
+ // Mono 1.0's wsdl doesn't deal with absolute paths
+ command.addArgument(srcFileName);
+ } else {
+ command.addArgument(srcFile.toString());
+ }
//rebuild unless the dest file is newer than the source file
if (srcFile.exists() && destFile.exists()
&& srcFile.lastModified() <= destFile.lastModified()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit:
ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet
WsdlToDotnet.java
Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 28 Jul 2004, Stefan Bodewig <bo...@apache.org> wrote:
> On Wed, 28 Jul 2004, Steve Loughran <st...@apache.org> wrote:
>
>> Does mono handle a list of schemas/urls to schemas after the first
>> file?
>
> wsdl [options] [path | url]
>
> looks like a single argument.
and no way to specify schemas at all.
Maybe or Mono 1.2[1] which is supposed to catch up with parts of
Whidbey and ASP.NET 2.0 in particular.
Stefan
Footnotes:
[1] http://www.mono-project.com/about/mono-roadmap.html#mono12
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit:
ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet
WsdlToDotnet.java
Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 29 Jul 2004, Steve Loughran <st...@apache.org> wrote:
> get a copy of vmware. run windows in a box.
That would be my last resort.
> you dont need vs.net if you get the .net sdk and the latest WSE
> toolkit, then use nant+nunit. the .net sdk comes with enough of
> vs.net to do debugging.
At least for the limited coding part I expect to do (I'm more on the
architecting, designing and project managing side for this project) it
seems Ant and Mono could do - I have three quarters of a working
<nunit> task ready with <dotnetexec> from our sandbox alone. My goal
is to make it 100% (at least for my needs) rather soon.
> Finally, use axis to generate JUnit test cases against your .net
> service, even you expect to have a .net client. It tests for
> interop, see.
Yes, absolutely.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet
WsdlToDotnet.java
Posted by Steve Loughran <st...@apache.org>.
Stefan Bodewig wrote:
> On Wed, 28 Jul 2004, Steve Loughran <st...@apache.org> wrote:
>
>
>>Does mono handle a list of schemas/urls to schemas after the first
>>file?
>
>
> $ man wsdl
> wsdl(1) wsdl(1)
>
> NAME
> wsdl - Mono's Web Service Proxy Generator
>
> SYNOPSIS
> wsdl [options] [path | url]
> ...
>
> looks like a single argument.
>
>
>>ps, Stefan, does this mean you are writing SOAP stuff?
>
>
> Even worse, SOAP with ASP.NET as server side and probably also .NET on
> the client end. Still trying to figure out whether I can avoid
> installing VS.NET (and Windows in the first place).
get a copy of vmware. run windows in a box. This is what we did for my
last win32 c++ project, and it was great, especially given that the
project added drivers to the SCSI stack and could write off a vm if the
build went wrong. We used ant+cruise control BTW, but not the <Cc> tasks
-instead just invoking vs.net to do a big bulk build.
you dont need vs.net if you get the .net sdk and the latest WSE toolkit,
then use nant+nunit. the .net sdk comes with enough of vs.net to do
debugging.
Finally, use axis to generate JUnit test cases against your .net
service, even you expect to have a .net client. It tests for interop, see.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit:
ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet
WsdlToDotnet.java
Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 28 Jul 2004, Steve Loughran <st...@apache.org> wrote:
> Does mono handle a list of schemas/urls to schemas after the first
> file?
$ man wsdl
wsdl(1) wsdl(1)
NAME
wsdl - Mono's Web Service Proxy Generator
SYNOPSIS
wsdl [options] [path | url]
...
looks like a single argument.
> ps, Stefan, does this mean you are writing SOAP stuff?
Even worse, SOAP with ASP.NET as server side and probably also .NET on
the client end. Still trying to figure out whether I can avoid
installing VS.NET (and Windows in the first place).
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet
WsdlToDotnet.java
Posted by Steve Loughran <st...@apache.org>.
Stefan Bodewig wrote:
> On 28 Jul 2004, <bo...@apache.org> wrote:
>
>
>> @@ -106,8 +113,13 @@
>> * 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;
>> + public void setSrcFile(String srcFileName) {
>
>
> I know this is not backwards compatible, but I think we don't
> reasonable expect anybody to use this task from Java, do we?
>
>
>> + Mono 1.0's wsdl doesn't deal with absolute paths
>
>
ahh, those slack little monkeys :)
I have some changes pending to up WSDL support to work better with
WSE2.0's version (there are some some extra options). the extraOptions
field is broken there as it only takes one option, my fault :)
What I would like to do is add fileset support to the WSDL so that I
could supply a set of files as separate schemas.
actually, an XML catalog is really what I want to generate, but WSDL.exe
just takes the list of schemas after the first WSDL file.
Does mono handle a list of schemas/urls to schemas after the first file?
-Steve
ps, Stefan, does this mean you are writing SOAP stuff?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit:
ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet
WsdlToDotnet.java
Posted by Stefan Bodewig <bo...@apache.org>.
On 28 Jul 2004, <bo...@apache.org> wrote:
> @@ -106,8 +113,13 @@
> * 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;
> + public void setSrcFile(String srcFileName) {
I know this is not backwards compatible, but I think we don't
reasonable expect anybody to use this task from Java, do we?
> + Mono 1.0's wsdl doesn't deal with absolute paths
<http://bugzilla.ximian.com/show_bug.cgi?id=62041>
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org