Browse Source

remove .NET tasks

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@706580 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
6a67c09afc
39 changed files with 5 additions and 8933 deletions
  1. +5
    -0
      WHATSNEW
  2. +0
    -33
      build.xml
  3. +0
    -494
      docs/manual/OptionalTasks/csc.html
  4. +0
    -326
      docs/manual/OptionalTasks/dotnet.html
  5. +0
    -278
      docs/manual/OptionalTasks/ilasm.html
  6. +0
    -338
      docs/manual/OptionalTasks/ildasm.html
  7. +0
    -206
      docs/manual/OptionalTasks/importtypelib.html
  8. +0
    -434
      docs/manual/OptionalTasks/jsharpc.html
  9. +0
    -470
      docs/manual/OptionalTasks/vbc.html
  10. +0
    -230
      docs/manual/OptionalTasks/wsdltodotnet.html
  11. +0
    -3
      docs/manual/dirtasks.html
  12. +0
    -1
      docs/manual/optionaltasklist.html
  13. +0
    -23
      docs/manual/tasksoverview.html
  14. +0
    -242
      src/etc/testcases/taskdefs/optional/WsdlToDotnet.xml
  15. +0
    -458
      src/etc/testcases/taskdefs/optional/dotnet.xml
  16. +0
    -70
      src/etc/testcases/taskdefs/optional/dotnet/HelloWorld.wsdl
  17. +0
    -27
      src/etc/testcases/taskdefs/optional/dotnet/example.cs
  18. +0
    -92
      src/etc/testcases/taskdefs/optional/dotnet/example.il
  19. +0
    -32
      src/etc/testcases/taskdefs/optional/dotnet/example2.cs
  20. +0
    -45
      src/etc/testcases/taskdefs/optional/dotnet/example2.il
  21. +0
    -30
      src/etc/testcases/taskdefs/optional/dotnet/example3.cs
  22. +0
    -29
      src/etc/testcases/taskdefs/optional/dotnet/jsharp.java
  23. BIN
      src/etc/testcases/taskdefs/optional/dotnet/res.resources
  24. +0
    -51
      src/etc/testcases/taskdefs/optional/wsdl/StockQuoteService.wsdl
  25. +0
    -8
      src/main/org/apache/tools/ant/taskdefs/defaults.properties
  26. +0
    -399
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
  27. +0
    -194
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetBaseMatchingTask.java
  28. +0
    -996
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java
  29. +0
    -102
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetDefine.java
  30. +0
    -248
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetResource.java
  31. +0
    -540
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java
  32. +0
    -474
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ildasm.java
  33. +0
    -217
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/ImportTypelib.java
  34. +0
    -141
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/JSharp.java
  35. +0
    -404
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
  36. +0
    -366
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/VisualBasicCompile.java
  37. +0
    -595
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java
  38. +0
    -136
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/DotnetTest.java
  39. +0
    -201
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/WsdlToDotnetTest.java

+ 5
- 0
WHATSNEW View File

@@ -106,6 +106,11 @@ Changes that could break older environments:
scanned and always seem empty.
Bugzilla Report 45741.

* the .NET tasks that have been deprecated since Ant 1.7.0 have been
removed, please use the stand-alone Antlib you can find at
http://ant.apache.org/antlibs/dotnet/index.html
instead.

Fixed bugs:
-----------



+ 0
- 33
build.xml View File

@@ -314,8 +314,6 @@
<!-- an unless-attribute on each exclude-element. -->
<exclude unless="run.failing.tests" name="${optional.package}/BeanShellScriptTest.java"/>
<exclude unless="run.failing.tests" name="${optional.package}/jdepend/JDependTest.java"/>
<exclude unless="run.failing.tests" name="${optional.package}/DotnetTest.java"/>
<exclude unless="run.failing.tests" name="${optional.package}/WsdlToDotnetTest.java"/>
</patternset>

<!--tests that need an XML Schema-supporting parser to work-->
@@ -510,31 +508,6 @@
</and>
</condition>

<condition property="wsdl.found">
<or>
<available file="wsdl" filepath="${env.PATH}"/>
<available file="wsdl.exe" filepath="${env.PATH}"/>
<available file="wsdl.exe" filepath="${env.Path}"/>
</or>
</condition>
<echo level="verbose"> 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}"/>
</or>
</condition>
<echo level="verbose"> csc.found=${csc.found}</echo>
<condition property="dotnetapps.found">
<and>
<isset property="csc.found"/>
<isset property="wsdl.found"/>
</and>
</condition>
<echo level="verbose"> dotnetapps.found=${dotnetapps.found}</echo>

<available property="rhino.present"
classname="org.mozilla.javascript.Scriptable"
classpathref="classpath"/>
@@ -1844,12 +1817,6 @@ see ${build.junit.reports} / ${antunit.reports}
<exclude name="${optional.package}/JspcTest.java"
unless="jasper.present"/>

<!-- misc oneoff tests -->
<exclude name="${optional.package}/WsdlToDotnetTest.java"
unless="dotnetapps.found"/>
<exclude name="${optional.package}/DotnetTest.java"
unless="dotnetapps.found"/>

<!-- These tests only passes if testcases and Ant classes have
been loaded by the same classloader - will throw
IllegalAccessExceptions otherwise. -->


+ 0
- 494
docs/manual/OptionalTasks/csc.html View File

@@ -1,494 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Csc
Task</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">

<table border="0" width="100%" cellspacing="4">

<!-- PAGE HEADER -->
<tr>
<td>
<table border="0" width="100%"><tr>
<td valign="bottom">
<font size="+3" face="arial,helvetica,sanserif"><strong>Csc
Task</strong></font>
<br><font face="arial,helvetica,sanserif">Compiles C# source into executables or modules.</font>
</td>
<td>
<!-- PROJECT LOGO -->
<a href="http://ant.apache.org/">
<img src="../../images/ant_logo_large.gif" align="right" alt="Apache Ant" border="0">
</a>
</td>
</tr></table>
</td>
</tr>

<!-- START RIGHT SIDE MAIN BODY -->
<tr>
<td valign="top" align="left">

<!-- Applying task/long-description -->
<!-- Start Description -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="description">
<strong>Description</strong></a></font>
</td></tr>

<tr><td><blockquote>
Compiles C# source into executables or modules. csc.exe on Windows or mcs on any other platform must be on the execute path, unless another executable or the full path to that executable is specified in the <tt>executable</tt> parameter <p> All parameters are optional: <code>&lt;csc/&gt;</code> should suffice to produce a debug build of all *.cs files. However, naming an <tt>destFile</tt>stops the csc compiler from choosing an output name from random, and allows the dependency checker to determine if the file is out of date. <p> The task is a directory based task, so attributes like <b>includes="*.cs" </b> and <b>excludes="broken.cs"</b> can be used to control the files pulled in. By default, all *.cs files from the project folder down are included in the command. When this happens the output file -if not specified- is taken as the first file in the list, which may be somewhat hard to control. Specifying the output file with <tt>destFile</tt> seems prudent. <p> <p> For more complex source trees, nested <tt>src</tt> elements can be supplied. When such an element is present, the implicit fileset is ignored. This makes sense, when you think about it :) <p>For historical reasons the pattern <code>**/*.cs</code> is preset as includes list and you can not override it with an explicit includes attribute. Use nested <code>&lt;src&gt;</code> elements instead of the basedir attribute if you need more control.</p> <p> References to external files can be made through the references attribute, or (since Ant1.6), via nested <code>&lt;reference&gt;</code> filesets. With the latter, the timestamps of the references are also used in the dependency checking algorithm. <p> Example <pre>&lt;csc optimize=&quot;true&quot; debug=&quot;false&quot; docFile=&quot;documentation.xml&quot; warnLevel=&quot;4&quot; unsafe=&quot;false&quot; targetType=&quot;exe&quot; incremental=&quot;false&quot; mainClass = &quot;MainApp&quot; destFile=&quot;NetApp.exe&quot; &gt; &lt;src dir="src" includes="*.cs"/&gt; &lt;reference file="${testCSC.dll}"/&gt; &lt;define name="RELEASE"/&gt; &lt;define name="DEBUG" if="debug.property"/&gt; &lt;define name="def3" unless="def3.property"/&gt; &lt;/csc&gt; </pre>
</blockquote></td></tr>

</table>
<!-- End Description -->

<!-- Start Attributes -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="attributes">
<strong>Parameters</strong></a></font>
</td></tr>
<tr><td><blockquote>
<table>
<tr>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Attribute</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Description</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Type</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Requirement</b></font>
</td>
</tr>
<!-- Attribute Group -->
<!-- Attribute Group -->
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">additionalmodules</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Semicolon separated list of modules to refer to.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left" rowspan="26">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">debug</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the debug flag on or off.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">definitions</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Semicolon separated list of defined constants.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destdir</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the destination directory of files to be compiled.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the name of exe/library to create.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">docfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">file for generated XML documentation</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">executable</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the name of the program, overriding the defaults. Can be used to set the full path to a program, or to switch to an alternate implementation of the command, such as the Mono or Rotor versions -provided they use the same command line arguments as the .NET framework edition</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">extraoptions</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Any extra options which are not explicitly supported by this task.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">failonerror</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, fail on compilation errors.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">filealign</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the file alignment. Valid values are 0,512, 1024, 2048, 4096, 8192, and 16384, 0 means 'leave to the compiler'</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">int</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">fullpaths</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, print the full path of files on errors.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">includedefaultreferences</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, automatically includes the common assemblies in dotnet, and tells the compiler to link in mscore.dll. set the automatic reference inclusion flag on or off this flag controls the /nostdlib option in CSC</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">incremental</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the incremental compilation flag on or off.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">mainclass</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets the name of main class for executables.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">noconfig</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">A flag that tells the compiler not to read in the compiler settings files 'csc.rsp' in its bin directory and then the local directory</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">optimize</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, enables optimization flag.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">outputfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">The output file. This is identical to the destFile attribute.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">referencefiles</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Path of references to include. Wildcards should work.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Path</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">references</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Semicolon separated list of DLLs to refer to.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">srcdir</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the source directory of the files to be compiled.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">targettype</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the target type to one of exe|library|module|winexe</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">"exe", "library", "module", "winexe"</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">unsafe</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, enables the unsafe keyword.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">utf8output</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, require all compiler output to be in UTF8 format.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">warnlevel</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Level of warning currently between 1 and 4 with 4 being the strictest.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">int</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">win32icon</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the filename of icon to include.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">win32res</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets the filename of a win32 resource (.RES) file to include. This is not a .NET resource, but what Windows is used to.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>


</table>
</blockquote></td></tr>

</table>
<!-- End Attributes -->

<!-- Start Elements -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="elements">
<strong>Parameters as nested elements</strong></a></font>
</td></tr>

<tr><td><blockquote>
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>define</strong> (org.apache.tools.ant.taskdefs.optional.dotnet.DotnetDefine)</font>
</td></tr>
<tr><td><blockquote>
add a define to the list of definitions
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>reference</strong> (org.apache.tools.ant.types.FileSet)</font>
</td></tr>
<tr><td><blockquote>
add a new reference fileset to the compilation
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>resource</strong> (org.apache.tools.ant.taskdefs.optional.dotnet.DotnetResource)</font>
</td></tr>
<tr><td><blockquote>
link or embed a resource
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>src</strong> (org.apache.tools.ant.types.FileSet)</font>
</td></tr>
<tr><td><blockquote>
add a new source directory to the compile
</blockquote></td></tr>
</table>
<!-- End Element -->

</blockquote></td></tr>

</table>
<!-- End Elements -->


</td>
</tr>
<!-- END RIGHT SIDE MAIN BODY -->

</table>

</body>
</html>

+ 0
- 326
docs/manual/OptionalTasks/dotnet.html View File

@@ -1,326 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>.NET Tasks</title>
</head>

<h1>.NET tasks</h1>
<h2>Introduction</h2>


<p><strong>These tasks are deprecated and will be removed in a future
release of Ant. They are now part of the <a
href="http://ant.apache.org/antlibs/dotnet/index.html">.NET
Antlib</a>.</strong></p>

Ant support for .NET goes back to before .NET was released, and
continues to be expanded based on user demand. Users writing nothing but
a .NET application, may want to look at the .NET-based
<A href="http://nant.sourceforge.net/">NAnt</A> project, that supports
both the Microsoft and the Ximian managed <A
href="http://go-mono.com/">Mono</A> project's implementation of the
.NET framework.
<p>

Over time, the .NET tasks in Ant have tended to evolve to meet a few
limited needs. Firstly, developers working with complex deployment problems may
want to use ant to use the fairly advanced deployment tasks Ant ships
with. Secondly, anyone who has a cross-platform project can use these
tasks to cover the .NET side of the problem. Here, cross-platform can
mean more than just Java and .NET: the C++ tasks in the ant-contrib
project on sourceforge can be used with Ant to do native C++ and .NET
cross development if that is your need. Finally, Ant support for .NET
lets one automate .NET development under an automated build process,
such as AntHill or Cruise Control.

<p>

What this means is that the Ant tasks for .NET support do not get as
much rigorous use as the Java tools, and are evolving more slowly -that
includes the time for support calls to change. But as a consequence,
developers working on .NET support have more freedom to play around with
the code. It also means that the fairly unusual set of tasks supported
by ant enable a few interesting operations that can not be performed any
other way:
<ol>

<li>Integrating with a Java based SOAP Service -generating C# code from
the server's WSDL and running it against the server.
</li>
<li>Building and deploying a C#-based Web Service, then using the Apache
Axis tasks to create JUnit tests to call the endpoints.

<li>Patching .NET type libraries to work with more complex IDL than the
basic <code>&lt;importtypelib&gt;</code> wrapper around tlbimport supports. Hence the
disassembler and the reassembler.
</li>

</ol>
Needless to say, possible does not mean easy.
<A href="http://www.manning.com/hatcher/chap15.pdf">Chapter 15</A> of
Java Development with Ant covers the first of these, using the Ant1.5
version of the tasks. Going the other way -generating Java client
code and JUnit testcases is covered in
<A href="http://www.iseran.com/Steve/papers/interop/">The Wondrous curse
of Interop</A>. The final trick, IDL and Typelib abuse, is not
documented as we do not want to encourage such an ugly practise. It,
can, however, be done if absolutely necessary.

<h3>Task List</h3>

<table border="0" >
<tr>
<td><b>Task</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td><a href="csc.html">csc</a></td>
<td>Compiles C# code</td>
</tr>

<tr>
<td><a href="vbc.html">vbc</a></td>
<td>Compiles VB.NET code</td>
</tr>

<tr>
<td><a href="jsharpc.html">jsharpc</a></td>
<td>Compiles J# files</td>
</tr>

<tr>
<td><a href="ildasm.html">ildasm</a></td>
<td>Disassembles .NET executables and libraries</td>
</tr>

<tr>
<td><a href="ilasm.html">ilasm</a></td>
<td>Assembles .il files</td>
</tr>

<tr>
<td><a href="wsdltodotnet.html">wsdltodotnet</a></td>
<td>Generates .NET code (C# or VB) from a WSDL file</td>
</tr>

<tr>
<td><a href="importtypelib.html">importtypelib</a></td>
<td>Imports a COM type library into .NET</td>
</tr>

</table>

<hr>
<h3>Common .NET Datatypes </h3>

There are some datatypes that are common to the core compiler classes:
csc, vbc and jsharpc

<h4>Resource</h4>

This is a resource that is included in the build. Ant uses this for
dependency checking -if resources included this way have changed, the
executable or library will be rebuilt.
<p>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">File</td>
<td valign="top">the resource to include</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">the name of the resource.
Optional unless the resource is
marked as public or private</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">embed</td>
<td valign="top">flag to control whether the resource
is embedded in the assembly, or just linked to it</td>
<td align="center" valign="top">No -default is true</td>
</tr>
<tr>
<td valign="top">public</td>
<td valign="top">VB only: flag to control if a resource should be
public or private. Set to true for public, false for private
and leave undefined for for neither. </td>
<td align="center" valign="top">No</td>
</tr>
</table>

<h5>Examples</h5>

<pre>
&lt;resource file="app.ico" name="icon"/&gt;
&lt;resource file="splash.jpg"/&gt;
&lt;resource name="splash" file="splash.jpg" public="false"/&gt;
</pre>

<h4>Define</h4>

This is a definition; in .NET these can either be defined or undefined,
unlike C++ #defines, which can be either undefined or arbitrary text.
The Ant compilation tasks can unconditionally add definitions, or
conditionally set a compile-time definition if an ant property is
defined or not.
<p>

Dependency Logic: the tasks are not (yet) clever enough to remember what
the last definitions were and trigger a rebuild when they change. Clean
build the code when the defines are likely to be different.
<p>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">the name of the definition</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top">if</td>
<td valign="top">name of a ant property to test for;
the definition is only set if this property is defined.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">unless</td>
<td valign="top">name of a ant property to test for;
the definition is only set if this property is undefined.</td>
<td align="center" valign="top">No</td>
</tr>
</table>

<h5>Examples</h5>

<pre>
&lt;define name="unsafe"/&gt;
&lt;define name="debug" if="build.debug"/&gt;
&lt;define name="dotnet" unless="build.mono"/&gt;
</pre>

<hr>
<h3> Change Log </h3>

<h4>Ant1.6</h4>
This revision goes along with NET 1.1, though there is no reason why
it should not work on other versions.
<p>

<ol>
<li>vbc task</li>
<li>jsharpc task</li>
<li>mono support</li>
<li>ilasm</li>
<li>tlbimport</li>
<li>Reference filesets in the compiler tasks</li>
<li>definitions in the compiler tasks</li>
<li>multiple source filesets in the compiler tasks. If these are used, the
implicit fileset is disabled</li>
</ol>

The compile tasks: vbc, jsharpc, and csc, all contain lots of common code
in a shared base class: if you can use one you should be able to use
another.

<h4>Ant 1.5</h4>
This revision goes along with NET 1.0 (SP1)
<ol>
<li>CSC: added filealign</li>
<li>CSC: added reference to office.dll</li>
<li>CSC: dependency checking! only if destFile is set!
<li>WsdlToDotnet written
</ol>

<h4>Version 0.5</h4>
This revision goes along with NET 1.0 (SP1)
<ol>
<li>CSC: added filealign</li>
<li>CSC: added reference to office.dll</li>
<li>CSC: dependency checking! only if destFile is set!
<li>WsdlToDotnet written
</ol>

<h4>Version 0.4</h4>
This is the beta-2 revision of the tasks.
<ol>
<li>ILASM: pulled the owner attribute, added keyfile for giving binaries a strong name
(MD5 hash of the checksum)</li>
<li>CSC: added win32res , noConfig, utf8output, fullpaths</li>
<li>CSC: </li>
</ol>

<h4>Version 0.3</h4>

The changes here reflect Beta-1 of the dotnet SDK and experience of use in
more complex projects. This build does not work with the older SDK,
primarily because the automatic reference feature references libraries
only found in the new SDK version.
<p>
External changes</p>
<ul>
<li>Recursive inclusion of .cs and .il files</li>

<li>Documentation enhanced, includes examples and details of all parameters</li>

<li>The csc task automatically includes the common dotnet assemblies, so
there is no need to remember to refer to 'System.dll', 'System.Web.Services',
etc. This feature can be disabled by setting the 'includeDefaultReferences'
flag to false. </li>

<li> References can also be referred to using the ReferenceFiles parameter, which
is an ant path specification. The old 'references' string is still retained.</li>
<li> An 'extraoptions' attribute enables the build file to include any CSC options
which are not explicitly supported in the CSC task. </li>
</ul>

Internal changes
<ul>
<li>Some minor refactoring (move common code a method)</li>
<li>Application of Jedits JavaStyle task resulted in a major reshaping of
the codebase and the insertion of a blank line every second line. Significant
effort was required to revert some (but not all) changes.</li>
<li>Removed throws clause from methods which can't throw exception
</ul>

The test harness has been expanded to include unicode source file
(the build works but the rest of the system has 'issues' with high unicode
package and method names)

<h4>Version 0.2</h4>
First public edition, added to the ant cvs tree. Tested on the PDC build of
the dotnet SDK only, and still immature. The command execution code was
refactored out into a 'NetCommand' class for re-use. The Ilasm task was added
at this time.

<h4>Version 0.1</h4>
Initial proof of concept; very rudimentary support for CSC only.

</body>
</html>

+ 0
- 278
docs/manual/OptionalTasks/ilasm.html View File

@@ -1,278 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Ilasm
Task</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">

<table border="0" width="100%" cellspacing="4">

<!-- PAGE HEADER -->
<tr>
<td>
<table border="0" width="100%"><tr>
<td valign="bottom">
<font size="+3" face="arial,helvetica,sanserif"><strong>Ilasm
Task</strong></font>
<br><font face="arial,helvetica,sanserif">Assembles .NET Intermediate Language files.</font>
</td>
<td>
<!-- PROJECT LOGO -->
<a href="http://ant.apache.org/">
<img src="../../images/ant_logo_large.gif" align="right" alt="Apache Ant" border="0">
</a>
</td>
</tr></table>
</td>
</tr>

<!-- START RIGHT SIDE MAIN BODY -->
<tr>
<td valign="top" align="left">

<!-- Applying task/long-description -->
<!-- Start Description -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="description">
<strong>Description</strong></a></font>
</td></tr>

<tr><td><blockquote>
Assembles .NET Intermediate Language files. ilasm.exe must be on the execute path, unless another executable or the full path to that executable is specified in the <tt>executable</tt> parameter <p> <p> All parameters are optional: <code>&lt;il/&gt;</code> should suffice to produce a debug build of all *.il files. The option set is roughly compatible with the CSharp class; even though the command line options are only vaguely equivalent. [The low level commands take things like /OUT=file, csc wants /out:file ... /verbose is used some places; /quiet here in ildasm... etc.] It would be nice if someone made all the command line tools consistent (and not as brittle as the java cmdline tools) <p> <p> The task is a directory based task, so attributes like <b>includes="*.il" </b> and <b>excludes="broken.il"</b> can be used to control the files pulled in. You can also use nested &lt;src&gt filesets to refer to source. <p>
</blockquote></td></tr>

</table>
<!-- End Description -->

<!-- Start Attributes -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="attributes">
<strong>Parameters</strong></a></font>
</td></tr>
<tr><td><blockquote>
<table>
<tr>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Attribute</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Description</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Type</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Requirement</b></font>
</td>
</tr>
<!-- Attribute Group -->
<!-- Attribute Group -->
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">debug</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the debug flag on or off.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left" rowspan="10">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the name of exe/library to create.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">extraoptions</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Any extra options which are not explicitly supported by this task.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">failonerror</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, fails if ilasm tool fails.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">keyfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">the name of a file containing a private key.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">listing</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, produce a listing (off by default).</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">outputfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the output file; identical to setDestFile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">resourcefile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">name of resource file to include.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">srcdir</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the source directory of the files to be compiled.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">verbose</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, enable verbose ILASM output.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>


</table>
</blockquote></td></tr>

</table>
<!-- End Attributes -->

<!-- Start Elements -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="elements">
<strong>Parameters as nested elements</strong></a></font>
</td></tr>

<tr><td><blockquote>
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>reference</strong> (org.apache.tools.ant.types.FileSet)</font>
</td></tr>
<tr><td><blockquote>
add a new reference fileset to the compilation
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>src</strong> (org.apache.tools.ant.types.FileSet)</font>
</td></tr>
<tr><td><blockquote>
add a new source directory to the compile
</blockquote></td></tr>
</table>
<!-- End Element -->

</blockquote></td></tr>

</table>
<!-- End Elements -->


</td>
</tr>
<!-- END RIGHT SIDE MAIN BODY -->

</table>

</body>
</html>

+ 0
- 338
docs/manual/OptionalTasks/ildasm.html View File

@@ -1,338 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Ildasm
Task</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">

<table border="0" width="100%" cellspacing="4">

<!-- PAGE HEADER -->
<tr>
<td>
<table border="0" width="100%"><tr>
<td valign="bottom">
<font size="+3" face="arial,helvetica,sanserif"><strong>Ildasm
Task</strong></font>
<br><font face="arial,helvetica,sanserif">Task to take a .NET or Mono -generated managed executable and turn it into ILASM assembly code.</font>
</td>
<td>
<!-- PROJECT LOGO -->
<a href="http://ant.apache.org/">
<img src="../../images/ant_logo_large.gif" align="right" alt="Apache Ant" border="0">
</a>
</td>
</tr></table>
</td>
</tr>

<!-- START RIGHT SIDE MAIN BODY -->
<tr>
<td valign="top" align="left">

<!-- Applying task/long-description -->
<!-- Start Description -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="description">
<strong>Description</strong></a></font>
</td></tr>

<tr><td><blockquote>
Task to take a .NET or Mono -generated managed executable and turn it into ILASM assembly code. Useful when converting imported typelibs into assembler before patching and recompiling, as one has to do when doing advanced typelib work. <p> As well as generating the named output file, the ildasm program will also generate resource files <code>Icons.resources</code> <code>Message.resources</code> and a .res file whose filename stub is derived from the source in ways to obscure to determine. There is no way to control whether or not these files are created, or where they are created (they are created in the current directory; their names come from inside the executable and may be those used by the original developer). This task creates the resources in the directory specified by <code>resourceDir</code> if set, else in the same directory as the <code>destFile</code>. <p> This task requires the .NET SDK installed and ildasm on the path. To disassemble using alternate CLR systems, set the executable attribute to the name/path of the alternate implementation -one that must support all the classic ildasm commands. <p> Dependency logic: the task executes the command if the output file is missing or older than the source file. It does not take into account changes in the options of the task, or timestamp differences in resource files. When the underlying ildasm executable fails for some reason, it leaves the .il file in place with some error message. To prevent this from confusing the dependency logic, the file specified by the <code>dest</code> attribute is <i>always</i> deleted after an unsuccessful build.
</blockquote></td></tr>

</table>
<!-- End Description -->

<!-- Start Attributes -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="attributes">
<strong>Parameters</strong></a></font>
</td></tr>
<tr><td><blockquote>
<table>
<tr>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Attribute</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Description</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Type</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Requirement</b></font>
</td>
</tr>
<!-- Attribute Group -->
<!-- Attribute Group -->
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">assembler</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">enable (default) or disable assembly language in the output</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left" rowspan="17">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">bytes</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">enable or disable (default) the original bytes as comments</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">the output file (required)</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">encoding</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Select the output encoding: ascii, utf8 or unicode</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">"ascii", "utf8", "unicode"</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">executable</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">override the name of the executable (normally ildasm) or set its full path. Do not set a relative path, as the ugly hacks needed to create resource files in the dest directory force us to change to this directory before running the application. i.e use &lt;property location&gt to create an absolute path from a relative one before setting this value.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">header</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">include header information; default false.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">item</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">name a single item to decode; a class or a method e.g item="Myclass::method" or item="namespace1::namespace2::Myclass:method(void(int32))</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">linenumbers</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">include line number information; default=false</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">metadata</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">include metadata information</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">progressbar</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">show a graphical progress bar in a window during the process; off by default</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">quoteallnames</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">quote all names.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">rawexceptionhandling</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">enable raw exception handling (default = false)</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">resourcedir</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the name of the directory for resources to be created. We cannot control their names, but we can say where they get created. If not set, the directory of the dest file is used</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">showsource</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">include the source as comments (default=false)</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">sourcefile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">the file to disassemble -required</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">srcfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">alternate name for sourceFile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">visibility</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">visibility options: one or more of the following, with + signs to concatenate them: <pre> pub : Public pri : Private fam : Family asm : Assembly faa : Family and Assembly foa : Family or Assembly psc : Private Scope </pre> e.g. visibility="pub+pri". Family means <code>protected</code> in C#;</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>


</table>
</blockquote></td></tr>

</table>
<!-- End Attributes -->

<!-- Start Elements -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="elements">
<strong>Parameters as nested elements</strong></a></font>
</td></tr>

<tr><td><blockquote>

</blockquote></td></tr>

</table>
<!-- End Elements -->


</td>
</tr>
<!-- END RIGHT SIDE MAIN BODY -->

</table>

</body>
</html>

+ 0
- 206
docs/manual/OptionalTasks/importtypelib.html View File

@@ -1,206 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Importtypelib
Task</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">

<table border="0" width="100%" cellspacing="4">

<!-- PAGE HEADER -->
<tr>
<td>
<table border="0" width="100%"><tr>
<td valign="bottom">
<font size="+3" face="arial,helvetica,sanserif"><strong>Importtypelib
Task</strong></font>
<br><font face="arial,helvetica,sanserif">Import a COM type library into the .NET framework.</font>
</td>
<td>
<!-- PROJECT LOGO -->
<a href="http://ant.apache.org/">
<img src="../../images/ant_logo_large.gif" align="right" alt="Apache Ant" border="0">
</a>
</td>
</tr></table>
</td>
</tr>

<!-- START RIGHT SIDE MAIN BODY -->
<tr>
<td valign="top" align="left">

<!-- Applying task/long-description -->
<!-- Start Description -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="description">
<strong>Description</strong></a></font>
</td></tr>

<tr><td><blockquote>
Import a COM type library into the .NET framework. <p> This task is a wrapper to .NET's tlbimport; it imports a tlb file to a NET assembly by generating a binary assembly (.dll) that contains all the binding metadata. It uses date timestamps to minimise rebuilds. <p> Example <pre> &lt;importtypelib srcfile="xerces.tlb" destfile="xerces.dll" namespace="Apache.Xerces"/&gt; </pre>
</blockquote></td></tr>

</table>
<!-- End Description -->

<!-- Start Attributes -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="attributes">
<strong>Parameters</strong></a></font>
</td></tr>
<tr><td><blockquote>
<table>
<tr>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Attribute</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Description</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Type</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Requirement</b></font>
</td>
</tr>
<!-- Attribute Group -->
<!-- Attribute Group -->
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">name the output file. required</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left" rowspan="6">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">extraoptions</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set any extra options that are not yet supported by this task.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">namespace</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">what namespace is the typelib to be in. required</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">srcfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">what is the source .tlb file? required.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">unsafe</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">do you want unsafe code.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">usesysarray</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set this to map a COM SafeArray to the System.Array class</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>


</table>
</blockquote></td></tr>

</table>
<!-- End Attributes -->

<!-- Start Elements -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="elements">
<strong>Parameters as nested elements</strong></a></font>
</td></tr>

<tr><td><blockquote>

</blockquote></td></tr>

</table>
<!-- End Elements -->


</td>
</tr>
<!-- END RIGHT SIDE MAIN BODY -->

</table>

</body>
</html>

+ 0
- 434
docs/manual/OptionalTasks/jsharpc.html View File

@@ -1,434 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Jsharpc
Task</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">

<table border="0" width="100%" cellspacing="4">

<!-- PAGE HEADER -->
<tr>
<td>
<table border="0" width="100%"><tr>
<td valign="bottom">
<font size="+3" face="arial,helvetica,sanserif"><strong>Jsharpc
Task</strong></font>
<br><font face="arial,helvetica,sanserif">Compile J# source down to a managed .NET application. <p>For historical reasons the pattern <code>**/*.java</code> is preset as includes list and you can not override it with an explicit includes attribute. Use nested <code>&lt;src&gt;</code> elements instead of the basedir attribute if you need more control.</p></font>
</td>
<td>
<!-- PROJECT LOGO -->
<a href="http://ant.apache.org/">
<img src="../../images/ant_logo_large.gif" align="right" alt="Apache Ant" border="0">
</a>
</td>
</tr></table>
</td>
</tr>

<!-- START RIGHT SIDE MAIN BODY -->
<tr>
<td valign="top" align="left">

<!-- Applying task/long-description -->
<!-- Start Description -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="description">
<strong>Description</strong></a></font>
</td></tr>

<tr><td><blockquote>
Compile J# source down to a managed .NET application. <p> J# is not Java. But it is the language closest to Java in the .NET framework. This task compiles jsharp source (.java files), and generates a .NET managed exe or dll. <p>
</blockquote></td></tr>

</table>
<!-- End Description -->

<!-- Start Attributes -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="attributes">
<strong>Parameters</strong></a></font>
</td></tr>
<tr><td><blockquote>
<table>
<tr>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Attribute</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Description</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Type</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Requirement</b></font>
</td>
</tr>
<!-- Attribute Group -->
<!-- Attribute Group -->
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">additionalmodules - note that your version of vjc may not support this option.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Semicolon separated list of modules to refer to.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left" rowspan="21">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">baseaddress</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"></font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">debug</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the debug flag on or off.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destdir</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the destination directory of files to be compiled.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the name of exe/library to create.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">executable</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the name of the program, overriding the defaults. Can be used to set the full path to a program, or to switch to an alternate implementation of the command, such as the Mono or Rotor versions -provided they use the same command line arguments as the .NET framework edition</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">extraoptions</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Any extra options which are not explicitly supported by this task.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">failonerror</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, fail on compilation errors.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">includedefaultreferences</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, automatically includes the common assemblies in dotnet, and tells the compiler to link in mscore.dll. set the automatic reference inclusion flag on or off this flag controls the /nostdlib option in CSC</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">mainclass</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets the name of main class for executables.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">optimize</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, enables optimization flag.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">purejava</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">do we want pure java (default, true) or corrupted J#?</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">referencefiles</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Path of references to include. Wildcards should work.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Path</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">references</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Semicolon separated list of DLLs to refer to.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">securescoping</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Make package scoped code visible to the current assembly only (default: false) .NET does not have package scoping. Instead it has assembly, private and public. By default, package content is public to all.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">srcdir</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the source directory of the files to be compiled.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">targettype</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the target type to one of exe|library|module|winexe</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">"exe", "library", "module", "winexe"</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">utf8output</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, require all compiler output to be in UTF8 format.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">warnlevel</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Level of warning currently between 1 and 4 with 4 being the strictest.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">int</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">win32icon</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the filename of icon to include.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">win32res</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets the filename of a win32 resource (.RES) file to include. This is not a .NET resource, but what Windows is used to.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>


</table>
</blockquote></td></tr>

</table>
<!-- End Attributes -->

<!-- Start Elements -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="elements">
<strong>Parameters as nested elements</strong></a></font>
</td></tr>

<tr><td><blockquote>
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>define</strong> (org.apache.tools.ant.taskdefs.optional.dotnet.DotnetDefine)</font>
</td></tr>
<tr><td><blockquote>
add a define to the list of definitions
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>reference</strong> (org.apache.tools.ant.types.FileSet)</font>
</td></tr>
<tr><td><blockquote>
add a new reference fileset to the compilation
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>resource</strong> (org.apache.tools.ant.taskdefs.optional.dotnet.DotnetResource)</font>
</td></tr>
<tr><td><blockquote>
link or embed a resource
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>src</strong> (org.apache.tools.ant.types.FileSet)</font>
</td></tr>
<tr><td><blockquote>
add a new source directory to the compile
</blockquote></td></tr>
</table>
<!-- End Element -->

</blockquote></td></tr>

</table>
<!-- End Elements -->


</td>
</tr>
<!-- END RIGHT SIDE MAIN BODY -->

</table>

</body>
</html>

+ 0
- 470
docs/manual/OptionalTasks/vbc.html View File

@@ -1,470 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Vbc
Task</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">

<table border="0" width="100%" cellspacing="4">

<!-- PAGE HEADER -->
<tr>
<td>
<table border="0" width="100%"><tr>
<td valign="bottom">
<font size="+3" face="arial,helvetica,sanserif"><strong>Vbc
Task</strong></font>
<br><font face="arial,helvetica,sanserif">This task compiles Visual Basic.NET source into executables or modules. <p>For historical reasons the pattern <code>**/*.vb</code> is preset as includes list and you can not override it with an explicit includes attribute. Use nested <code>&lt;src&gt;</code> elements instead of the basedir attribute if you need more control.</p></font>
</td>
<td>
<!-- PROJECT LOGO -->
<a href="http://ant.apache.org/">
<img src="../../images/ant_logo_large.gif" align="right" alt="Apache Ant" border="0">
</a>
</td>
</tr></table>
</td>
</tr>

<!-- START RIGHT SIDE MAIN BODY -->
<tr>
<td valign="top" align="left">

<!-- Applying task/long-description -->
<!-- Start Description -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="description">
<strong>Description</strong></a></font>
</td></tr>

<tr><td><blockquote>
This task compiles Visual Basic.NET source into executables or modules. The task requires vbc.exe on the execute path, unless it or an equivalent program is specified in the <tt>executable</tt> parameter <p> All parameters are optional: <code>&lt;vbc/&gt;</code> should suffice to produce a debug build of all *.vb files. <p> The task is a directory based task, so attributes like <tt>includes=&quot;**\/*.vb&quot;</tt> and <tt>excludes=&quot;broken.vb&quot;</tt> can be used to control the files pulled in. By default, all *.vb files from the project folder down are included in the command. When this happens the destFile -if not specified- is taken as the first file in the list, which may be somewhat hard to control. Specifying the output file with <tt>destfile</tt> is prudent. </p> <p> Also, dependency checking only works if destfile is set. As with <code>&lt;csc&gt;</code> nested <tt>src</tt> filesets of source, reference filesets, definitions and resources can be provided. <p> Example </p> <pre>&lt;vbc optimize=&quot;true&quot; debug=&quot;false&quot; warnLevel=&quot;4&quot; targetType=&quot;exe&quot; definitions=&quot;RELEASE&quot; excludes=&quot;src/unicode_class.vb&quot; mainClass = &quot;MainApp&quot; destFile=&quot;NetApp.exe&quot; optionExplicit=&quot;true&quot; optionCompare=&quot;text&quot; references="System.Xml,System.Web.Xml" &gt; &lt;reference file="${testCSC.dll}"/&gt; &lt;define name="RELEASE"/&gt; &lt;define name="DEBUG" if="debug.property"/&gt; &lt;define name="def3" unless="def2.property"/&gt; &lt;/vbc&gt; </pre>
</blockquote></td></tr>

</table>
<!-- End Description -->

<!-- Start Attributes -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="attributes">
<strong>Parameters</strong></a></font>
</td></tr>
<tr><td><blockquote>
<table>
<tr>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Attribute</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Description</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Type</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Requirement</b></font>
</td>
</tr>
<!-- Attribute Group -->
<!-- Attribute Group -->
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">additionalmodules</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Semicolon separated list of modules to refer to.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left" rowspan="24">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">debug</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the debug flag on or off.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destdir</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the destination directory of files to be compiled.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the name of exe/library to create.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">executable</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the name of the program, overriding the defaults. Can be used to set the full path to a program, or to switch to an alternate implementation of the command, such as the Mono or Rotor versions -provided they use the same command line arguments as the .NET framework edition</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">extraoptions</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Any extra options which are not explicitly supported by this task.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">failonerror</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, fail on compilation errors.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">imports</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Declare global imports for namespaces in referenced metadata files.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">includedefaultreferences</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, automatically includes the common assemblies in dotnet, and tells the compiler to link in mscore.dll. set the automatic reference inclusion flag on or off this flag controls the /nostdlib option in CSC</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">mainclass</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets the name of main class for executables.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">optimize</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, enables optimization flag.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">optioncompare</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Specify binary- or text-style string comparisons. Defaults to "binary"</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">optionexplicit</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Whether to require explicit declaration of variables.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">optionstrict</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Enforce strict language semantics.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">referencefiles</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Path of references to include. Wildcards should work.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Path</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">references</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Semicolon separated list of DLLs to refer to.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">removeintchecks</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Whether to remove integer checks. Default false.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">rootnamespace</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Specifies the root namespace for all type declarations.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">srcdir</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the source directory of the files to be compiled.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">targettype</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the target type to one of exe|library|module|winexe</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">"exe", "library", "module", "winexe"</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">utf8output</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">If true, require all compiler output to be in UTF8 format.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">warnlevel</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Level of warning currently between 1 and 4 with 4 being the strictest.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">int</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">win32icon</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Set the filename of icon to include.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">win32res</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets the filename of a win32 resource (.RES) file to include. This is not a .NET resource, but what Windows is used to.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>


</table>
</blockquote></td></tr>

</table>
<!-- End Attributes -->

<!-- Start Elements -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="elements">
<strong>Parameters as nested elements</strong></a></font>
</td></tr>

<tr><td><blockquote>
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>define</strong> (org.apache.tools.ant.taskdefs.optional.dotnet.DotnetDefine)</font>
</td></tr>
<tr><td><blockquote>
add a define to the list of definitions
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>reference</strong> (org.apache.tools.ant.types.FileSet)</font>
</td></tr>
<tr><td><blockquote>
add a new reference fileset to the compilation
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>resource</strong> (org.apache.tools.ant.taskdefs.optional.dotnet.DotnetResource)</font>
</td></tr>
<tr><td><blockquote>
link or embed a resource
</blockquote></td></tr>
</table>
<!-- End Element -->
<!-- Start Element -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica.sanserif" size="-1">
<strong>src</strong> (org.apache.tools.ant.types.FileSet)</font>
</td></tr>
<tr><td><blockquote>
add a new source directory to the compile
</blockquote></td></tr>
</table>
<!-- End Element -->

</blockquote></td></tr>

</table>
<!-- End Elements -->


</td>
</tr>
<!-- END RIGHT SIDE MAIN BODY -->

</table>

</body>
</html>

+ 0
- 230
docs/manual/OptionalTasks/wsdltodotnet.html View File

@@ -1,230 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Wsdltodotnet
Task</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">

<table border="0" width="100%" cellspacing="4">

<!-- PAGE HEADER -->
<tr>
<td>
<table border="0" width="100%"><tr>
<td valign="bottom">
<font size="+3" face="arial,helvetica,sanserif"><strong>Wsdltodotnet
Task</strong></font>
<br><font face="arial,helvetica,sanserif">Converts a WSDL file or URL resource into a .NET language.</font>
</td>
<td>
<!-- PROJECT LOGO -->
<a href="http://ant.apache.org/">
<img src="../../images/ant_logo_large.gif" align="right" alt="Apache Ant" border="0">
</a>
</td>
</tr></table>
</td>
</tr>

<!-- START RIGHT SIDE MAIN BODY -->
<tr>
<td valign="top" align="left">

<!-- Applying task/long-description -->
<!-- Start Description -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="description">
<strong>Description</strong></a></font>
</td></tr>

<tr><td><blockquote>
Converts a WSDL file or URL resource into a .NET language. Why add a wrapper to the MS WSDL tool? So that you can verify that your web services, be they written with Axis or anyone else's SOAP toolkit, work with .NET clients. This task is dependency aware when using a file as a source and destination; so if you <code>&lt;get&gt;</code> the file (with <code>usetimestamp="true"</code>) then you only rebuild stuff when the WSDL file is changed. Of course, if the server generates a new timestamp every time you ask for the WSDL, this is not enough...use the <code>&lt;filesmatch&gt;</code> <code>&lt;condition&gt;</code> to to byte for byte comparison against a cached WSDL file then make the target conditional on that test failing. See "Creating an XML Web Service Proxy", "wsdl.exe" docs in the framework SDK documentation
</blockquote></td></tr>

</table>
<!-- End Description -->

<!-- Start Attributes -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="attributes">
<strong>Parameters</strong></a></font>
</td></tr>
<tr><td><blockquote>
<table>
<tr>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Attribute</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Description</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Type</b></font>
</td>
<td bgcolor="#cccccc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif"><b>Requirement</b></font>
</td>
</tr>
<!-- Attribute Group -->
<!-- Attribute Group -->
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">destfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Name of the file to generate. Required</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left" rowspan="8">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">extraoptions</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Any extra WSDL.EXE options which aren't explicitly supported by the ant wrapper task; optional</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">failonerror</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Whether or not a failure should halt the build. Optional - default is <code>true</code>.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">language</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">set the language; one of "CS", "JS", or "VB" optional, default is CS for C# source</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">namespace</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">namespace to place the source in. optional; default ""</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">server</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">flag to enable server side code generation; optional, default=false</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">srcfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">The local WSDL file to parse; either url or srcFile is required.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">File</font>
</td>
</tr>
<!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">url</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets the URL to fetch. Fetching is by wsdl.exe; Ant proxy settings are ignored; either url or srcFile is required.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
</tr>


</table>
</blockquote></td></tr>

</table>
<!-- End Attributes -->

<!-- Start Elements -->
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td>&nbsp;</td></tr>

<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="elements">
<strong>Parameters as nested elements</strong></a></font>
</td></tr>

<tr><td><blockquote>

</blockquote></td></tr>

</table>
<!-- End Elements -->


</td>
</tr>
<!-- END RIGHT SIDE MAIN BODY -->

</table>

</body>
</html>

+ 0
- 3
docs/manual/dirtasks.html View File

@@ -225,9 +225,6 @@ tasks that can act as an implicit fileset:</p>
<a href="OptionalTasks/renameextensions.html"><code>&lt;renameextensions&gt;</code></a>
</li>
<li><a href="OptionalTasks/depend.html"><code>&lt;depend&gt;</code></a></li>
<li><a href="OptionalTasks/dotnet.html"><code>&lt;ilasm&gt;</code></a></li>
<li><a href="OptionalTasks/dotnet.html"><code>&lt;csc&gt;</code></a></li>
<li><a href="OptionalTasks/dotnet.html"><code>&lt;vbc&gt;</code></a></li>
<li><a href="OptionalTasks/translate.html"><code>&lt;translate&gt;</code></a></li>
<li><a href="OptionalTasks/image.html"><code>&lt;image&gt;</code></a></li>
<li><a href="OptionalTasks/jlink.html"><code>&lt;jlink&gt;</code></a> (deprecated)</li>


+ 0
- 1
docs/manual/optionaltasklist.html View File

@@ -32,7 +32,6 @@
<a href="conceptstypeslist.html" target="navFrame">Concepts and Types</a><br/>

<h3>Optional Tasks</h3>
<a href="OptionalTasks/dotnet.html"><i>.NET Tasks</i></a><br/>
<a href="OptionalTasks/antlr.html">ANTLR</a><br/>
<a href="OptionalTasks/attrib.html">Attrib</a><br/>
<a href="OptionalTasks/cab.html">Cab</a><br/>


+ 0
- 23
docs/manual/tasksoverview.html View File

@@ -42,7 +42,6 @@ documentation.</p>
<a href="#log">Logging Tasks</a><br>
<a href="#mail">Mail Tasks</a><br>
<a href="#misc">Miscellaneous Tasks</a><br>
<a href="#net">.NET Tasks</a><br>
<a href="#preproc">Pre-process Tasks</a><br>
<a href="#prop">Property Tasks</a><br>
<a href="#remote">Remote Tasks</a><br>
@@ -810,28 +809,6 @@ documentation.</p>
</tr>
</table>

<p></p>
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<th align="left">
<font size="+0" face="arial,helvetica,sanserif">
<a name="net">.NET Tasks</a>
</font></th>
<font size="-1" face="arial,helvetica,sanserif">
<th align="right"><a href="#top">[Back to top]</a></th>
</font>
</table>
<table width="100%" border="1" cellpadding="4" cellspacing="0">
<tr valign="top">
<th nowrap>Task Name</th>
<th>Description</th>
</tr>

<tr valign="top">
<td nowrap><a href="OptionalTasks/dotnet.html">.NET Tasks</a></td>
<td><p>(See the documentation describing the .NET tasks.)</p></td>
</tr>
</table>

<p></p>
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<th align="left">


+ 0
- 242
src/etc/testcases/taskdefs/optional/WsdlToDotnet.xml View File

@@ -1,242 +0,0 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<project name="wsdl-to-java-jtest" basedir="." default="init">


<property environment="env"/>
<property name="build.dir" location="wsdl/build"/>
<property name="cache.dir" location="${build.dir}/cache"/>
<property name="src.dir" location="${build.dir}/src"/>
<property name="classes.dir" location="${build.dir}/classes"/>
<property name="local.wsdl"
location="wsdl/StockQuoteService.wsdl" />
<property name="out.csc" location="${src.dir}/out.cs"/>
<property name="out.app" location="${classes.dir}/out.dll"/>
<property name="out.type" value="module"/>
<property name="out.vbc" location="${src.dir}/out.vb"/>
<property name="endpoint"
value="http://nagoya.apache.org:5049/Axis/StockQuoteService.jws" />
<property name="endpoint.wsdl"
value="http://nagoya.apache.org:5049/Axis/StockQuoteService.jws?wsdl" />
<property name="vb.references"
value="System.Web.dll,System.xml.dll,System.dll,System.Web.Services.dll"/>
<target name="init" depends="validate">
<mkdir dir="${build.dir}"/>
<mkdir dir="${cache.dir}"/>
<mkdir dir="${src.dir}"/>
<mkdir dir="${classes.dir}"/>
</target>
<target name="probe_for_apps" >
<condition property="wsdl.found">
<or>
<available file="wsdl" filepath="${env.PATH}" />
<available file="wsdl.exe" filepath="${env.PATH}" />
<available file="wsdl.exe" filepath="${env.Path}" />
</or>
</condition>
<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}" />
</or>
</condition>
<echo> csc.found=${csc.found}</echo>
<condition property="vbc.found">
<or>
<available file="vbc" filepath="${env.PATH}" />
<available file="vbc.exe" filepath="${env.PATH}" />
<available file="vbc.exe" filepath="${env.Path}" />
</or>
</condition>
<echo> vbc.found=${vbc.found}</echo>
<condition property="dotnetapps.found">
<and>
<isset property="csc.found"/>
<isset property="wsdl.found"/>
</and>
</condition>
<echo> dotnetapps.found=${dotnetapps.found}</echo>
</target>
<target name="teardown">
<delete dir="${build.dir}"/>
</target>

<target name="validate" depends="probe_for_apps" >
<fail unless="dotnetapps.found">Needed .net apps are missing</fail>
</target>
<target name="testNoParams">
<wsdltodotnet/>
</target>

<target name="testNoSrc">
<wsdltodotnet destFile="${out.csc}"/>
</target>

<target name="testDestIsDir" depends="init">
<wsdltodotnet destFile="${build.dir}"
srcFile="${local.wsdl}"/>
</target>
<target name="testBothSrc" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${local.wsdl}"
url="${endpoint.wsdl}"
/>
</target>

<target name="testSrcIsDir" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${build.dir}"
/>
</target>

<target name="testSrcIsMissing" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${build.dir}/invalidfile.wsdl"
/>
</target>
<target name="testLocalWsdl" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${local.wsdl}"
/>
<csc
srcDir="${src.dir}"
destFile="${out.app}"
targetType="${out.type}"
references="System.Web.Services.dll"
/>
<available property="app.created" file="${out.app}"/>
<fail unless="app.created">No app created</fail>
</target>
<target name="testLocalWsdlServer" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${local.wsdl}"
server="true"
/>
<csc
srcDir="${src.dir}"
destFile="${out.app}"
targetType="${out.type}"
fileAlign="512"
references="System.Web.Services.dll"
/>
<available property="app.created" file="${out.app}"/>
<fail unless="app.created">No app created</fail>
</target>
<target name="testInvalidExtraOps" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${local.wsdl}"
extraOptions="/newOption:not-one-known-of"
/>
</target>


<target name="testLocalWsdlVB" depends="init" if="vbc.found">
<wsdltodotnet destFile="${out.vbc}"
language="VB"
srcFile="${local.wsdl}"
/>
<vbc
srcDir="${src.dir}"
destFile="${out.app}"
targetType="${out.type}"
references="${vb.references}"
>
</vbc>
<available property="app.created" file="${out.app}"/>
<fail unless="app.created">No app created</fail>
</target>
<target name="testLocalWsdlServerVB"
depends="init" if="vbc.found">
<wsdltodotnet destFile="${out.vbc}"
language="VB"
srcFile="${local.wsdl}"
server="true"
/>
<vbc
srcDir="${src.dir}"
destFile="${out.app}"
targetType="${out.type}"
optionExplicit="true"
optionStrict="false"
optionCompare="text"
references="${vb.references}"
/>
<available property="app.created" file="${out.app}"/>
<fail unless="app.created">No app created</fail>
</target>
<target name="testInvalidExtraOpsVB" depends="init">
<wsdltodotnet destFile="${out.vbc}"
language="VB"
srcFile="${local.wsdl}"
extraOptions="/newOption:not-one-known-of"
/>
</target>


<target name="testideErrorsIgnoredWhenFalse" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${local.wsdl}"
ideErrors="false"
>
</wsdltodotnet>
</target>

<target name="testSchemaMustBeSet" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${local.wsdl}"
>
<schema/>
</wsdltodotnet>
</target>

<target name="testSchemaFileMustExist" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${local.wsdl}"
>
<schema file="this-file-does-not-exist.xsd"/>
</wsdltodotnet>
</target>

<target name="testSchemaFileMustHaveOneOptionOnly" depends="init">
<wsdltodotnet destFile="${out.csc}"
srcFile="${local.wsdl}"
>
<schema file="WsdlToDotnet.xml"
url="http://ant.apache.org/xml/AntSchema.xsd"/>
</wsdltodotnet>
</target>

</project>

+ 0
- 458
src/etc/testcases/taskdefs/optional/dotnet.xml View File

@@ -1,458 +0,0 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<project name="dotnet" basedir="." default="init">
<property environment="env"/>
<property name="build.dir" location="dotnet/build"/>
<property name="src.dir" location="dotnet"/>

<property name="out.csc" location="${src.dir}/out.cs"/>
<property name="out.app" location="${build.dir}/out.exe"/>
<property name="out.type" value="exe"/>

<target name="probe_for_apps" >
<condition property="ilasm.found">
<or>
<available file="ilasm" filepath="${env.PATH}" />
<available file="ilasm.exe" filepath="${env.PATH}" />
<available file="ilasm.exe" filepath="${env.Path}" />
</or>
</condition>
<echo> ilasm.found=${ilasm.found}</echo>
<condition property="csc.found">
<or>
<available file="csc" filepath="${env.PATH}" />
<available file="csc.exe" filepath="${env.PATH}" />
<available file="csc.exe" filepath="${env.Path}" />
</or>
</condition>
<echo> csc.found=${csc.found}</echo>
<!-- visual basic compiler -->
<condition property="vbc.found">
<or>
<available file="vbc" filepath="${env.PATH}" />
<available file="vbc.exe" filepath="${env.PATH}" />
<available file="vbc.exe" filepath="${env.Path}" />
</or>
</condition>
<echo> vbc.found=${vbc.found}</echo>
<!-- visual J# compiler -->
<condition property="jsharp.found">
<or>
<available file="vjc" filepath="${env.PATH}" />
<available file="vjc.exe" filepath="${env.PATH}" />
<available file="vjc.exe" filepath="${env.Path}" />
</or>
</condition>
<echo> jsharp.found=${jsharp.found}</echo>

<!-- Mono C# compiler -->
<condition property="mcs.found">
<available file="mcs" filepath="${env.PATH}" />
</condition>
<echo> mcs.found=${mcs.found}</echo>

<!-- any C# compiler -->
<condition property="c#.found">
<or>
<isset property="csc.found"/>
<isset property="mcs.found"/>
</or>
</condition>

<!-- Mono's ilasm -->
<condition property="mono.ilasm.found">
<available file="ilasm" filepath="${env.PATH}" />
</condition>
<echo> mono.ilasm.found=${mono.ilasm.found}</echo>

<condition property="ildasm.found">
<or>
<available file="ildasm" filepath="${env.PATH}" />
<available file="ildasm.exe" filepath="${env.PATH}" />
<available file="ildasm.exe" filepath="${env.Path}" />
</or>
</condition>
<echo> ildasm.found=${ildasm.found}</echo>

<condition property="dotnetapps.found">
<or>
<and>
<isset property="mcs.found"/>
<isset property="mono.ilasm.found"/>
</and>
<and>
<isset property="csc.found"/>
<!-- <isset property="vbc.found"/> -->
<isset property="ilasm.found"/>
</and>
</or>
</condition>
<echo> dotnetapps.found=${dotnetapps.found}</echo>

<condition property="mono.executable" value="mono">
<or>
<available file="mono" filepath="${env.PATH}" />
<available file="mono.exe" filepath="${env.PATH}" />
</or>
</condition>
<property name="mono.executable" value="mint"/>

<!-- now set a prop of the compiler name to whatever we found -->
<condition property="cs.compiler" value="csc">
<isset property="csc.found"/>
</condition>

<condition property="cs.compiler" value="mcs">
<isset property="mcs.found"/>
</condition>

</target>

<target name="init" depends="probe_for_apps">
<mkdir dir="${build.dir}"/>
</target>

<target name="teardown">
<delete dir="${build.dir}"/>
</target>

<target name="validate_csc" depends="init">
<fail unless="c#.found">Needed C# compiler is missing</fail>
</target>

<target name="validate_ilasm" depends="init">
<fail unless="ilasm.found">Needed ilasm is missing</fail>
</target>

<target name="validate_jsharp" depends="init">
<fail unless="jsharp.found">No vjc on the path</fail>
</target>


<target name="testCSC" depends="testCSC-Mono,testCSC-MS"/>

<target name="testCSC-MS" depends="validate_csc" if="csc.found">
<property name="testCSC.exe"
location="${build.dir}/ExampleCsc.exe" />
<csc
destFile="${testCSC.exe}"
targetType="exe"
srcDir="${src.dir}"
>
</csc>
<available property="app.created" file="${testCSC.exe}"/>
<fail unless="app.created">No app ${testCSC.exe} created</fail>
<exec executable="${testCSC.exe}" failonerror="true" />
<delete file="${testCSC.exe}"/>
</target>

<target name="testCSC-Mono" depends="validate_csc" if="mcs.found">
<property name="testCSC.exe"
location="${build.dir}/ExampleCsc.exe" />
<csc
destFile="${testCSC.exe}"
targetType="exe"
includedefaultreferences="true"
srcDir="${src.dir}"
>
</csc>
<available property="app.created" file="${testCSC.exe}"/>
<fail unless="app.created">No app ${testCSC.exe} created</fail>
<exec executable="${mono.executable}" failonerror="true">
<arg value="${testCSC.exe}"/>
</exec>
<delete file="${testCSC.exe}"/>
</target>

<target name="testCSCResources" depends="testCSCResources-Mono,testCSCResources-MS"/>

<target name="testCSCResources-MS" depends="validate_csc" if="csc.found">
<property name="testCSCRes.exe"
location="${build.dir}/ExampleCscRes.exe" />
<csc
destFile="${testCSCRes.exe}"
targetType="exe"
srcDir="${src.dir}"
>
<resource file="${src.dir}/res.resources"/>
</csc>
<available property="app-res.created" file="${testCSCRes.exe}"/>
<fail unless="app-res.created">No app ${testCSC.exe} created</fail>
<exec executable="${testCSCRes.exe}" failonerror="true" />
<delete file="${testCSCRes.exe}"/>
<csc
destFile="${testCSCRes.exe}"
targetType="exe"
srcDir="${src.dir}"
>
<resource namespace="some.namespace" embed="true">
<fileset file="${src.dir}/res.resources"/>
</resource>
</csc>
<available property="app-res-2.created" file="${testCSCRes.exe}"/>
<fail unless="app-res-2.created">No app ${testCSC.exe} created</fail>
<exec executable="${testCSCRes.exe}" failonerror="true" />
<delete file="${testCSCRes.exe}"/>
</target>

<target name="testCSCResources-Mono" depends="validate_csc" if="mcs.found">
<property name="testCSCRes.exe"
location="${build.dir}/ExampleCscRes.exe" />
<csc
destFile="${testCSCRes.exe}"
targetType="exe"
includedefaultreferences="true"
srcDir="${src.dir}"
>
<resource file="${src.dir}/res.resources"/>
</csc>
<available property="app-res.created" file="${testCSCRes.exe}"/>
<fail unless="app-res.created">No app ${testCSC.exe} created</fail>
<exec executable="${mono.executable}" failonerror="true">
<arg value="${testCSCRes.exe}"/>
</exec>
<delete file="${testCSCRes.exe}"/>
</target>

<target name="testCSCintrinsicFileset"
depends="testCSCintrinsicFileset-MS,testCSCintrinsicFileset-Mono"/>

<target name="testCSCintrinsicFileset-MS" depends="validate_csc" if="csc.found">
<property name="testCSC.exe"
location="${build.dir}/ExampleCsc.exe"/>
<csc
destFile="${testCSC.exe}"
targetType="exe"
srcDir="${src.dir}"
includes="**/*.cs"
>
</csc>
<available property="app.created" file="${testCSC.exe}"/>
<fail unless="app.created">No app ${testCSC.exe} created</fail>
<exec executable="${testCSC.exe}" failonerror="true" />
<delete file="${testCSC.exe}"/>
</target>

<target name="testCSCintrinsicFileset-Mono" depends="validate_csc" if="mcs.found">
<property name="testCSC.exe"
location="${build.dir}/ExampleCsc.exe"/>
<csc
destFile="${testCSC.exe}"
targetType="exe"
srcDir="${src.dir}"
includes="**/*.cs"
includedefaultreferences="true"
>
</csc>
<available property="app.created" file="${testCSC.exe}"/>
<fail unless="app.created">No app ${testCSC.exe} created</fail>
<exec executable="${mono.executable}" failonerror="true">
<arg value="${testCSC.exe}"/>
</exec>
<delete file="${testCSC.exe}"/>
</target>

<target name="testCSCdll" depends="testCSCdll-MS,testCSCdll-Mono"/>

<target name="testCSCdll-MS" depends="validate_csc" if="csc.found">
<property name="testCSC.dll"
location="${build.dir}/Example2.dll" />
<csc
destFile="${testCSC.dll}"
targetType="library"
executable="csc"
>
<src dir="${src.dir}" includes="example2.cs"/>
</csc>
<available property="dll.created" file="${testCSC.dll}"/>
<fail unless="dll.created">No file ${testCSC.dll} created</fail>
<property name="testCSC2.dll"
location="${build.dir}/folder with dir/Example3.dll" />
<mkdir dir="${build.dir}/folder with dir"/>
<csc
destFile="${testCSC2.dll}"
targetType="library"
executable="csc"
>
<src dir="${src.dir}" includes="example3.cs"/>
</csc>
<available property="dll2.created" file="${testCSC2.dll}"/>
<fail unless="dll2.created">No file ${testCSC2.dll} created</fail>
</target>

<target name="testCSCdll-Mono" depends="validate_csc" if="mcs.found">
<property name="testCSC.dll"
location="${build.dir}/Example2.dll" />
<csc
destFile="${testCSC.dll}"
targetType="library"
includedefaultreferences="true"
>
<src dir="${src.dir}" includes="example2.cs"/>
</csc>
<available property="dll.created" file="${testCSC.dll}"/>
<fail unless="dll.created">No file ${testCSC.dll} created</fail>
</target>

<target name="testCscReferences"
depends="testCscReferences-MS,testCscReferences-Mono"/>

<target name="testCscReferences-MS" depends="validate_csc,testCSCdll-MS"
if="csc.found">
<property name="testCscReferences.exe"
location="${build.dir}/ExampleCsc2.exe" />
<csc
destFile="${testCscReferences.exe}"
targetType="exe"
>
<src file="${src.dir}/example.cs"/>
<reference file="${testCSC.dll}" />
<reference file="${testCSC2.dll}" />
<define name="RELEASE" />
<define name="DEBUG" if="undefined.property"/>
<define name="def3" unless="undefined.property"/>
</csc>
<available property="refapp.created" file="${testCscReferences.exe}"/>
<fail unless="refapp.created">No app ${testCscReferences.exe} created</fail>
<copy file="${testCSC2.dll}" todir="${build.dir}"/>
<exec executable="${testCscReferences.exe}" failonerror="true" />
</target>

<target name="testCscReferences-Mono" depends="validate_csc,testCSCdll-Mono"
if="mcs.found">
<property name="testCscReferences.exe"
location="${build.dir}/ExampleCsc2.exe" />
<csc
destFile="${testCscReferences.exe}"
targetType="exe"
includedefaultreferences="true"
>
<src file="${src.dir}/example.cs"/>
<reference file="${testCSC.dll}" />
<define name="RELEASE" />
<define name="DEBUG" if="undefined.property"/>
<define name="def3" unless="undefined.property"/>
</csc>
<available property="refapp.created" file="${testCscReferences.exe}"/>
<fail unless="refapp.created">No app ${testCscReferences.exe} created</fail>
<exec executable="${mono.executable}" failonerror="true">
<arg value="${testCscReferences.exe}"/>
</exec>
</target>

<target name="testILASM"
depends="testILASM-Mono,testILASM-MS"
if="ilasm.found"/>

<target name="ilasm" depends="validate_ilasm"
if="ilasm.found">
<property name="testILASM.exe"
location="${build.dir}/ExampleIlasm.exe" />
<ilasm
destFile="${testILASM.exe}"
targetType="exe"
>
<src dir="${src.dir}" includes="*.il"/>
</ilasm>
<available property="ilasm.created" file="${testILASM.exe}"/>
<fail unless="ilasm.created">No app ${testILASM.exe} created</fail>
</target>

<target name="testILASM-MS" depends="ilasm"
if="ilasm.found" unless="mono.ilasm.found">
<exec executable="${testILASM.exe}"
failonerror="true"/>
</target>

<target name="testILASM-Mono" depends="ilasm"
if="mono.ilasm.found">
<exec executable="${mono.executable}"
failonerror="true">
<arg value="${testILASM.exe}"/>
</exec>
</target>

<!-- not including this in the test as it creates an exe in the src dir -->

<target name="testIlasmNoDestFile" depends="validate_ilasm">
<ilasm
targetType="exe"
>
<src dir="${src.dir}" includes="**/*.il"/>
</ilasm>
</target>

<!-- just here to look at fileset refid conversion by hand -->
<target name="echoFileset">
<fileset id="ilasm" dir="${src.dir}" includes="**/*.il" />
<property name="ilasm.string" refid="ilasm"/>
<echo>${ilasm.string}</echo>
</target>

<target name="testILDASM" depends="testILASM" if="ildasm.found">
<property name="testILDASM.il"
location="${build.dir}/ExampleIldasm.il" />
<ildasm
srcFile="${testILASM.exe}"
destFile="${testILDASM.il}"
metadata="true"
header="true"
linenumbers="true"
encoding="ascii"
/>
<available property="ildasm.created" file="${testILDASM.il}"/>
<fail unless="ildasm.created">No file ${testILDASM.il} created</fail>
</target>

<!-- this is an error -->
<target name="testILDASM_empty" depends="validate_ilasm" >
<ildasm/>
</target>

<target name="jsharp" depends="init" if="jsharp.found" >
<property name="jsharp.exe"
location="${build.dir}/jsharp.exe" />
<jsharpc
destFile="${jsharp.exe}"
targetType="exe"
>
<src dir="${src.dir}" includes="*.java"/>
</jsharpc>
<exec executable="${jsharp.exe}" failonerror="true" />
</target>

<target name="testCSCresponseFile" depends="validate_csc" >
<property name="testCSCresponseFile.exe"
location="${build.dir}/testCSCresponseFile.exe" />
<csc
destFile="${testCSCresponseFile.exe}"
targetType="exe"
executable="${cs.compiler}"
useResponseFile="true"
srcDir="${src.dir}"
>
</csc>
<available property="app.created" file="${testCSCresponseFile.exe}"/>
<fail unless="app.created">No app ${testCSCresponseFile.exe} created</fail>
<delete file="${testCSCresponseFile.exe}"/>
</target>


</project>


+ 0
- 70
src/etc/testcases/taskdefs/optional/dotnet/HelloWorld.wsdl View File

@@ -1,70 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<definitions name="HelloWorld"
targetNamespace="http://hello.jaxrpc.samples/"
xmlns:tns="http://hello.jaxrpc.samples/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types />

<message name="sayHello">
<part name="String_1" type="xsd:string" />
</message>

<message name="sayHelloResponse">
<part name="result" type="xsd:string" />
</message>

<portType name="Hello">
<operation name="sayHello" parameterOrder="String_1">
<input message="tns:sayHello" />

<output message="tns:sayHelloResponse" />
</operation>
</portType>

<binding name="HelloBinding" type="tns:Hello">
<operation name="sayHello">
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="encoded" namespace="http://hello.jaxrpc.samples/" />
</input>

<output>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="encoded" namespace="http://hello.jaxrpc.samples/" />
</output>

<soap:operation soapAction="" />
</operation>

<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
</binding>

<service name="HelloWorld">
<port name="HelloPort" binding="tns:HelloBinding">
<soap:address
location="http://localhost:8080/axis/Hello" />
</port>
</service>
</definitions>


+ 0
- 27
src/etc/testcases/taskdefs/optional/dotnet/example.cs View File

@@ -1,27 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using System;

public class Example {

public static void Main(String[] args) {
Example2.echo();
Example3.echo();
}
}

+ 0
- 92
src/etc/testcases/taskdefs/optional/dotnet/example.il View File

@@ -1,92 +0,0 @@
//created from ildasm of example.cs
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.



.assembly extern /*23000001*/ mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 1:0:3300:0
}
.assembly /*20000001*/ example
{
// --- The following custom attribute is added automatically, do not uncomment -------
// .custom /*0C000001:0A000001*/ instance void [mscorlib/* 23000001 */]System.Diagnostics.DebuggableAttribute/* 01000002 */::.ctor(bool,
// bool) /* 0A000001 */ = ( 01 00 00 01 00 00 )
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module example.exe
// MVID: {641E4709-F7B6-4BB0-BC5D-49C2CF1F1CF8}
.imagebase 0x00400000
.subsystem 0x00000003
.file alignment 512
.corflags 0x00000001
// Image base: 0x03180000
//
// ============== CLASS STRUCTURE DECLARATION ==================
//
.class /*02000002*/ public auto ansi beforefieldinit Example
extends [mscorlib/* 23000001 */]System.Object/* 01000001 */
{
} // end of class Example


// =============================================================


// =============== GLOBAL FIELDS AND METHODS ===================


// =============================================================


// =============== CLASS MEMBERS DECLARATION ===================
// note that class flags, 'extends' and 'implements' clauses
// are provided here for information only

.class /*02000002*/ public auto ansi beforefieldinit Example
extends [mscorlib/* 23000001 */]System.Object/* 01000001 */
{
.method /*06000001*/ public hidebysig static
void Main(string[] args) cil managed
// SIG: 00 01 01 1D 0E
{
.entrypoint
// Method begins at RVA 0x2050
// Code size 11 (0xb)
.maxstack 1
IL_0000: /* 72 | (70)000001 */ ldstr "hello, I look like Java, but I'm really .NET" /* 70000001 */
IL_0005: /* 28 | (0A)000002 */ call void [mscorlib/* 23000001 */]System.Console/* 01000003 */::WriteLine(string) /* 0A000002 */
IL_000a: /* 2A | */ ret
} // end of method Example::Main

.method /*06000002*/ public hidebysig specialname rtspecialname
instance void .ctor() cil managed
// SIG: 20 00 01
{
// Method begins at RVA 0x2068
// Code size 7 (0x7)
.maxstack 1
IL_0000: /* 02 | */ ldarg.0
IL_0001: /* 28 | (0A)000003 */ call instance void [mscorlib/* 23000001 */]System.Object/* 01000001 */::.ctor() /* 0A000003 */
IL_0006: /* 2A | */ ret
} // end of method Example::.ctor

} // end of class Example




+ 0
- 32
src/etc/testcases/taskdefs/optional/dotnet/example2.cs View File

@@ -1,32 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;

/**
* this is just here to create confusion
*/
public class Example2 {

public int some_variable=3;
public static void echo() {
Console.WriteLine("hello, I look like Java, but I'm really .NET");
}
}

+ 0
- 45
src/etc/testcases/taskdefs/optional/dotnet/example2.il View File

@@ -1,45 +0,0 @@
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

.class public auto ansi beforefieldinit Example2
extends [mscorlib]System.Object
{
} // end of class Example2

// =============== CLASS MEMBERS DECLARATION ===================
// note that class flags, 'extends' and 'implements' clauses
// are provided here for information only

.class public auto ansi beforefieldinit Example2
extends [mscorlib]System.Object
{
.field public int32 some_variable
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 14 (0xe)
.maxstack 2
IL_0000: ldarg.0
IL_0001: ldc.i4.3
IL_0002: stfld int32 Example2::some_variable
IL_0007: ldarg.0
IL_0008: call instance void [mscorlib]System.Object::.ctor()
IL_000d: ret
} // end of method Example2::.ctor

} // end of class Example2




+ 0
- 30
src/etc/testcases/taskdefs/optional/dotnet/example3.cs View File

@@ -1,30 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

using System;

/**
* this is just here to create confusion
*/
public class Example3 {

public static void echo() {
Console.WriteLine("hello, I look like Java, but I'm really .NET");
}

}

+ 0
- 29
src/etc/testcases/taskdefs/optional/dotnet/jsharp.java View File

@@ -1,29 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

/**
* this is a j# class, not a java one.
*/
public class jsharp {
public static void main(String args[]) {
System.out.println("hello, I look like Java, but I'm really J#");
}
}

BIN
src/etc/testcases/taskdefs/optional/dotnet/res.resources View File


+ 0
- 51
src/etc/testcases/taskdefs/optional/wsdl/StockQuoteService.wsdl View File

@@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<wsdl:definitions targetNamespace="http://localhost:8080/axis/StockQuoteService.jws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:impl="http://localhost:8080/axis/StockQuoteService.jws-impl" xmlns:intf="http://localhost:8080/axis/StockQuoteService.jws" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="getQuoteResponse">
<wsdl:part name="return" type="xsd:float"/>
</wsdl:message>
<wsdl:message name="getQuoteRequest">
<wsdl:part name="symbol" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="Exception">
</wsdl:message>
<wsdl:portType name="StockQuoteService">
<wsdl:operation name="getQuote" parameterOrder="symbol">
<wsdl:input message="intf:getQuoteRequest"/>
<wsdl:output message="intf:getQuoteResponse"/>
<wsdl:fault message="intf:Exception" name="Exception"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="StockQuoteServiceSoapBinding" type="intf:StockQuoteService">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getQuote">
<wsdlsoap:operation soapAction=""/>
<wsdl:input>
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/StockQuoteService.jws" use="encoded"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/StockQuoteService.jws" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="StockQuoteServiceService">
<wsdl:port binding="intf:StockQuoteServiceSoapBinding" name="StockQuoteService">
<wsdlsoap:address location="http://localhost:8080/axis/StockQuoteService.jws"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

+ 0
- 8
src/main/org/apache/tools/ant/taskdefs/defaults.properties View File

@@ -130,7 +130,6 @@ ccunlock=org.apache.tools.ant.taskdefs.optional.clearcase.CCUnlock
ccupdate=org.apache.tools.ant.taskdefs.optional.clearcase.CCUpdate
chgrp=org.apache.tools.ant.taskdefs.optional.unix.Chgrp
chown=org.apache.tools.ant.taskdefs.optional.unix.Chown
csc=org.apache.tools.ant.taskdefs.optional.dotnet.CSharp
ddcreator=org.apache.tools.ant.taskdefs.optional.ejb.DDCreator
depend=org.apache.tools.ant.taskdefs.optional.depend.Depend
echoproperties=org.apache.tools.ant.taskdefs.optional.EchoProperties
@@ -139,10 +138,7 @@ ejbc=org.apache.tools.ant.taskdefs.optional.ejb.Ejbc
ejbjar=org.apache.tools.ant.taskdefs.optional.ejb.EjbJar
ftp=org.apache.tools.ant.taskdefs.optional.net.FTP
funtest=org.apache.tools.ant.taskdefs.optional.testing.Funtest
ilasm=org.apache.tools.ant.taskdefs.optional.dotnet.Ilasm
ildasm=org.apache.tools.ant.taskdefs.optional.dotnet.Ildasm
image=org.apache.tools.ant.taskdefs.optional.image.Image
importtypelib=org.apache.tools.ant.taskdefs.optional.dotnet.ImportTypelib
iplanet-ejbc=org.apache.tools.ant.taskdefs.optional.ejb.IPlanetEjbcTask
jarlib-available=org.apache.tools.ant.taskdefs.optional.extension.JarLibAvailableTask
jarlib-display=org.apache.tools.ant.taskdefs.optional.extension.JarLibDisplayTask
@@ -153,7 +149,6 @@ javah=org.apache.tools.ant.taskdefs.optional.Javah
jdepend=org.apache.tools.ant.taskdefs.optional.jdepend.JDependTask
jjdoc=org.apache.tools.ant.taskdefs.optional.javacc.JJDoc
jjtree=org.apache.tools.ant.taskdefs.optional.javacc.JJTree
jsharpc=org.apache.tools.ant.taskdefs.optional.dotnet.JSharp
junit=org.apache.tools.ant.taskdefs.optional.junit.JUnitTask
junitreport=org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator
makeurl=org.apache.tools.ant.taskdefs.MakeUrl
@@ -202,7 +197,6 @@ stylebook=org.apache.tools.ant.taskdefs.optional.StyleBook
symlink=org.apache.tools.ant.taskdefs.optional.unix.Symlink
telnet=org.apache.tools.ant.taskdefs.optional.net.TelnetTask
translate=org.apache.tools.ant.taskdefs.optional.i18n.Translate
vbc=org.apache.tools.ant.taskdefs.optional.dotnet.VisualBasicCompile
verifyjar=org.apache.tools.ant.taskdefs.VerifyJar
vssadd=org.apache.tools.ant.taskdefs.optional.vss.MSVSSADD
vsscheckin=org.apache.tools.ant.taskdefs.optional.vss.MSVSSCHECKIN
@@ -215,7 +209,6 @@ vsslabel=org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABEL
wljspc=org.apache.tools.ant.taskdefs.optional.jsp.WLJspc
wlrun=org.apache.tools.ant.taskdefs.optional.ejb.WLRun
wlstop=org.apache.tools.ant.taskdefs.optional.ejb.WLStop
wsdltodotnet=org.apache.tools.ant.taskdefs.optional.dotnet.WsdlToDotnet
xmlvalidate=org.apache.tools.ant.taskdefs.optional.XMLValidateTask


@@ -233,4 +226,3 @@ rename=org.apache.tools.ant.taskdefs.Rename
renameext=org.apache.tools.ant.taskdefs.optional.RenameExtensions
starteam=org.apache.tools.ant.taskdefs.optional.scm.AntStarTeamCheckOut
style=org.apache.tools.ant.taskdefs.XSLTProcess
WsdlToDotnet=org.apache.tools.ant.taskdefs.optional.dotnet.WsdlToDotnet

+ 0
- 399
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java View File

@@ -1,399 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

/*
* build notes
* -The reference CD to listen to while editing this file is
* nap: Underworld - Everything, Everything
*/
// ====================================================================
// place in the optional ant tasks package
// but in its own dotnet group
// ====================================================================

package org.apache.tools.ant.taskdefs.optional.dotnet;

// ====================================================================
// imports
// ====================================================================

import java.io.File;

// ====================================================================

/**
* Compiles C# source into executables or modules.
*
* csc.exe on Windows or mcs on other platforms must be on the execute
* path, unless another executable or the full path to that executable
* is specified in the <tt>executable</tt> parameter
* <p>
* All parameters are optional: &lt;csc/&gt; should suffice to produce a debug
* build of all *.cs files. However, naming an <tt>destFile</tt>stops the
* csc compiler from choosing an output name from random, and
* allows the dependency checker to determine if the file is out of date.
* <p>
* The task is a directory based task, so attributes like <b>includes="*.cs"
* </b> and <b>excludes="broken.cs"</b> can be used to control the files pulled
* in. By default, all *.cs files from the project folder down are included in
* the command. When this happens the output file -if not specified- is taken
* as the first file in the list, which may be somewhat hard to control.
* Specifying the output file with <tt>destFile</tt> seems prudent. <p>
*
* <p>
* For more complex source trees, nested <tt>src</tt> elemements can be
* supplied. When such an element is present, the implicit fileset is ignored.
* This makes sense, when you think about it :)
*
* <p>For historical reasons the pattern
* <code>**</code><code>/*.cs</code> is preset as includes list and
* you can not override it with an explicit includes attribute. Use
* nested <code>&lt;src&gt;</code> elements instead of the basedir
* attribute if you need more control.</p>
*
* <p>
* References to external files can be made through the references attribute,
* or (since Ant1.6), via nested &lt;reference&gt; filesets. With the latter,
* the timestamps of the references are also used in the dependency
* checking algorithm.
* <p>
*
* Example
*
* <pre>&lt;csc
* optimize=&quot;true&quot;
* debug=&quot;false&quot;
* docFile=&quot;documentation.xml&quot;
* warnLevel=&quot;4&quot;
* unsafe=&quot;false&quot;
* targetType=&quot;exe&quot;
* incremental=&quot;false&quot;
* mainClass = &quot;MainApp&quot;
* destFile=&quot;NetApp.exe&quot;
* &gt;
* &lt;src dir="src" includes="*.cs" /&gt;
* &lt;reference file="${testCSC.dll}" /&gt;
* &lt;define name="RELEASE" /&gt;
* &lt;define name="DEBUG" if="debug.property"/&gt;
* &lt;define name="def3" unless="def3.property"/&gt;
* &lt;/csc&gt;
* </pre>
*
*
* @ant.task name="csc" category="dotnet"
* @since Ant 1.3
*/

public class CSharp extends DotnetCompile {

// CheckStyle:VisibilityModifier OFF - bc
/**
* defines list: RELEASE;WIN32;NO_SANITY_CHECKS;;SOMETHING_ELSE'
*/
String definitions;


/**
* output XML documentation flag
*/
private File docFile;

/**
* file alignment; 0 means let the compiler decide
*/
private int fileAlign = 0;

/**
* use full paths to things
*/
private boolean fullpaths = false;

/**
* incremental build flag
*/
private boolean incremental;

/**
* enable unsafe code flag. Clearly set to false by default
*/
protected boolean unsafe;

/**
* A flag that tells the compiler not to read in the compiler
* settings files 'csc.rsp' in its bin directory and then the local directory
*/
private boolean noconfig = false;
// CheckStyle:VisibilityModifier ON


/**
* constructor inits everything and set up the search pattern
*/

public CSharp() {
clear();
}

/**
* full cleanup
*/
public void clear() {
super.clear();
docFile = null;
fileAlign = 0;
fullpaths = true;
incremental = false;
unsafe = false;
noconfig = false;
definitions = null;
setExecutable(isWindows ? "csc" : "mcs");
}



/**
* file for generated XML documentation
*
*@param f output file
*/
public void setDocFile(File f) {
docFile = f;
}


/**
* get the argument or null for no argument needed
*
*@return The DocFile Parameter to CSC
*/
protected String getDocFileParameter() {
if (docFile != null) {
return "/doc:" + docFile.toString();
} else {
return null;
}
}

/**
* Set the file alignment.
* Valid values are 0,512, 1024, 2048, 4096, 8192,
* and 16384, 0 means 'leave to the compiler'
* @param fileAlign the value to use.
*/
public void setFileAlign(int fileAlign) {
this.fileAlign = fileAlign;
}

/**
* get the argument or null for no argument needed
*
*@return The OutputFile Parameter to CSC
*/
protected String getFileAlignParameter() {
if (fileAlign != 0 && !"mcs".equals(getExecutable())) {
return "/filealign:" + fileAlign;
} else {
return null;
}
}


/**
* If true, print the full path of files on errors.
*
*@param enabled The new fullPaths value
*/
public void setFullPaths(boolean enabled) {
fullpaths = enabled;
}


/**
* Gets the fullPathsParameter attribute of the CSharp object
*
*@return The fullPathsParameter value or null if unset
*/
protected String getFullPathsParameter() {
return fullpaths ? "/fullpaths" : null;
}


/**
* set the incremental compilation flag on or off.
*
*@param incremental on/off flag
*/
public void setIncremental(boolean incremental) {
this.incremental = incremental;
}


/**
* query the incrementalflag
*
*@return true if incremental compilation is turned on
*/
public boolean getIncremental() {
return incremental;
}


/**
* get the incremental build argument
*
*@return The Incremental Parameter to CSC
*/
protected String getIncrementalParameter() {
return "/incremental" + (incremental ? "+" : "-");
}

/**
* The output file. This is identical to the destFile attribute.
*
*@param params The new outputFile value
*/
public void setOutputFile(File params) {
setDestFile(params);
}


/**
* If true, enables the unsafe keyword.
*
*@param unsafe The new Unsafe value
*/
public void setUnsafe(boolean unsafe) {
this.unsafe = unsafe;
}


/**
* query the Unsafe attribute
*
*@return The Unsafe value
*/
public boolean getUnsafe() {
return this.unsafe;
}


/**
* get the argument or null for no argument needed
*
*@return The Unsafe Parameter to CSC
*/
protected String getUnsafeParameter() {
return unsafe ? "/unsafe" : null;
}


/**
* A flag that tells the compiler not to read in the compiler
* settings files 'csc.rsp' in its bin directory and then the local directory
*
*@param enabled The new noConfig value
*/
public void setNoConfig(boolean enabled) {
noconfig = enabled;
}


/**
* Gets the noConfigParameter attribute of the CSharp object
*
*@return The noConfigParameter value
*/
protected String getNoConfigParameter() {
return noconfig ? "/noconfig" : null;
}


/**
* Semicolon separated list of defined constants.
*
*@param params The new definitions value
*/
public void setDefinitions(String params) {
definitions = params;
}

/**
* override the superclasses version of this method (which we call)
* with a check for a definitions attribute, the contents of which
* are appended to the list.
*@return The Definitions Parameter to CSC
*/
protected String getDefinitionsParameter() {
String predecessors = super.getDefinitionsParameter();
if (notEmpty(definitions)) {
if (predecessors == null) {
predecessors = "/define:";
}
return predecessors + definitions;
} else {
return predecessors;
}
}


/**
* add Commands unique to C#.
* @param command ongoing command
*/
public void addCompilerSpecificOptions(NetCommand command) {
command.addArgument(getIncludeDefaultReferencesParameter());
command.addArgument(getWarnLevelParameter());
command.addArgument(getDocFileParameter());
command.addArgument(getFullPathsParameter());
command.addArgument(getFileAlignParameter());
command.addArgument(getIncrementalParameter());
command.addArgument(getNoConfigParameter());
command.addArgument(getUnsafeParameter());
}

// end execute

/**
* Returns the delimiter which C# uses to separate references, i.e., a semi colon.
* @return the delimiter.
*/
public String getReferenceDelimiter() {
return ";";
}


/**
* This method indicates the filename extension for C# files.
* @return the file extension for C#, i.e., "cs" (without the dot).
*/
public String getFileExtension() {
return "cs";
}

/**
* Build a C# style parameter.
* @param command the command.
* @param resource the resource.
*/
protected void createResourceParameter(
NetCommand command, DotnetResource resource) {
resource.getParameters(getProject(), command, true);
}

}


+ 0
- 194
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetBaseMatchingTask.java View File

@@ -1,194 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.tools.ant.taskdefs.optional.dotnet;

import org.apache.tools.ant.taskdefs.MatchingTask;
import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.DirectoryScanner;

import java.io.File;
import java.util.Vector;
import java.util.Hashtable;
import java.util.Enumeration;

/**
* refactoring of some stuff so that different things (like ILASM)
* can use shared code.
*/
public class DotnetBaseMatchingTask extends MatchingTask {
// CheckStyle:VisibilityModifier OFF - bc
/**
* output file. If not supplied this is derived from the source file
*/
protected File outputFile;
/**
* filesets of file to compile
*/
protected Vector filesets = new Vector();

/**
* source directory upon which the search pattern is applied
*/
protected File srcDir;

/**
* Are we running on Windows?
*
* @since Ant 1.6.3
*/
// CheckStyle:ConstantNameCheck OFF - bc
protected static final boolean isWindows = Os.isFamily("windows");

// CheckStyle:ConstantNameCheck ON
// CheckStyle:VisibilityModifier ON

/**
* Overridden because we need to be able to set the srcDir.
* @return the source directory.
*/
public File getSrcDir() {
return this.srcDir;
}

/**
* Set the source directory of the files to be compiled.
*
*@param srcDirName The new SrcDir value
*/
public void setSrcDir(File srcDirName) {
this.srcDir = srcDirName;
}

/**
* Set the name of exe/library to create.
*
*@param file The new outputFile value
*/
public void setDestFile(File file) {
outputFile = file;
}

/**
* add a new source directory to the compile
* @param src a fileset.
*/
public void addSrc(FileSet src) {
filesets.add(src);
}

/**
* get the destination file
* @return the dest file or null for not assigned
*/
public File getDestFile() {
return outputFile;
}

/**
* create the list of files
* @param command the command to create the files for.
* @param filesToBuild vector to add files to
* @param outputTimestamp timestamp to compare against
* @return number of files out of date
*/
protected int buildFileList(NetCommand command, Hashtable filesToBuild, long outputTimestamp) {
int filesOutOfDate = 0;
boolean scanImplicitFileset
= getSrcDir() != null || filesets.size() == 0;
if (scanImplicitFileset) {
//scan for an implicit fileset if there was a srcdir set
//or there was no srcDir set but there was no contained classes
if (getSrcDir() == null) {
//if there is no src dir here, set it
setSrcDir(getProject().resolveFile("."));
}
log("working from source directory " + getSrcDir(),
Project.MSG_VERBOSE);
//get dependencies list.
DirectoryScanner scanner = getDirectoryScanner(getSrcDir());
filesOutOfDate = command.scanOneFileset(scanner,
filesToBuild, outputTimestamp);
}
//get any included source directories
for (int i = 0; i < filesets.size(); i++) {
FileSet fs = (FileSet) filesets.elementAt(i);
filesOutOfDate += command.scanOneFileset(
fs.getDirectoryScanner(getProject()),
filesToBuild,
outputTimestamp);
}

return filesOutOfDate;
}

/**
* add the list of files to a command
* @param filesToBuild vector of files
* @param command the command to append to
*/
protected void addFilesToCommand(Hashtable filesToBuild, NetCommand command) {
int count = filesToBuild.size();
log("compiling " + count + " file" + ((count == 1) ? "" : "s"),
Project.MSG_VERBOSE);
Enumeration files = filesToBuild.elements();
while (files.hasMoreElements()) {
File file = (File) files.nextElement();
command.addArgument(file.toString());
}
}

/**
* determine the timestamp of the output file
* @return a timestamp or 0 for no output file known/exists
*/
protected long getOutputFileTimestamp() {
long outputTimestamp;
if (getDestFile() != null && getDestFile().exists()) {
outputTimestamp = getDestFile().lastModified();
} else {
outputTimestamp = 0;
}
return outputTimestamp;
}

/**
* finish off the command by adding all dependent files, execute
* @param command the command to update.
* @param ignoreTimestamps not used.
*/
protected void addFilesAndExecute(NetCommand command, boolean ignoreTimestamps) {
long outputTimestamp = getOutputFileTimestamp();
Hashtable filesToBuild = new Hashtable();
int filesOutOfDate = buildFileList(command, filesToBuild, outputTimestamp);

//now run the command of exe + settings + files
if (filesOutOfDate > 0) {
//add the files to the command
addFilesToCommand(filesToBuild, command);
command.runCommand();
} else {
log("output file is up to date", Project.MSG_VERBOSE);
}
}



}

+ 0
- 996
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java View File

@@ -1,996 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

/*
* build notes
* -The reference CD to listen to while editing this file is
* nap:Cream+Live+2001+CD+2
*/

// place in the optional ant tasks package
// but in its own dotnet group

package org.apache.tools.ant.taskdefs.optional.dotnet;

// imports

import java.io.File;
import java.util.Vector;
import java.util.Enumeration;
import java.util.Hashtable;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.EnumeratedAttribute;


/**
* Abstract superclass for dotnet compiler tasks.
*
* History
* <table>
* <tr>
* <td>
* 0.1
* </td>
* <td>
* First creation
* </td>
* <td>
* Most of the code here was copied verbatim from v0.3 of
* Steve Loughran's CSharp optional task. Abstracted functionality
* to allow subclassing of other dotnet compiler types.
* </td>
* </tr>
*
* </table>
*
*
* @version 0.1
*/

public abstract class DotnetCompile
extends DotnetBaseMatchingTask {

private static final int DEFAULT_WARN_LEVEL = 3;

/**
* list of reference classes. (pretty much a classpath equivalent)
*/
private String references;

/**
* flag to enable automatic reference inclusion
*/
private boolean includeDefaultReferences = true;

/**
* icon for incorporation into apps
*/
private File win32icon;

/**
* icon for incorporation into apps
*/
private File win32res;

/**
* flag to control action on execution trouble
*/
private boolean failOnError;

/**
* using the path approach didn't work as it could not handle the implicit
* execution path. Perhaps that could be extracted from the runtime and
* then the path approach would be viable
*/
private Path referenceFiles;

/**
* optimise flag
*/
private boolean optimize;

// CheckStyle:VisibilityModifier OFF - bc
/**
* a list of definitions to support;
*/
protected Vector definitionList = new Vector();

/**
* our resources
*/
protected Vector resources = new Vector();

/**
* executable
*/

protected String executable;

protected static final String REFERENCE_OPTION = "/reference:";

/**
* debug flag. Controls generation of debug information.
*/
protected boolean debug;

/**
* warning level: 0-4, with 4 being most verbose
*/
private int warnLevel;

/**
* main class (or null for automatic choice)
*/
protected String mainClass;

/**
* any extra command options?
*/
protected String extraOptions;

/**
* type of target. Should be one of exe|library|module|winexe|(null)
* default is exe; the actual value (if not null) is fed to the command
* line. <br>
* See /target
*/
protected String targetType;

/**
* utf out flag
*/

protected boolean utf8output = false;

/**
* list of extra modules to refer to
*/
protected String additionalModules;
/**
* filesets of references
*/
protected Vector referenceFilesets = new Vector();

/**
* flag to set to to use @file based command cache
*/
private boolean useResponseFile = false;
private static final int AUTOMATIC_RESPONSE_FILE_THRESHOLD = 64;

// CheckStyle:VisibilityModifier ON

/**
* constructor inits everything and set up the search pattern
*/

public DotnetCompile() {
clear();
setIncludes(getFilePattern());
}

/**
* reset all contents.
*/
public void clear() {
targetType = null;
win32icon = null;
srcDir = null;
mainClass = null;
warnLevel = DEFAULT_WARN_LEVEL;
optimize = false;
debug = true;
references = null;
failOnError = true;
additionalModules = null;
includeDefaultReferences = true;
extraOptions = null;
}


/**
* Semicolon separated list of DLLs to refer to.
*
*@param s The new References value
*/
public void setReferences(String s) {
references = s;
}


/**
* get the reference string or null for no argument needed
*
*@return The References Parameter to CSC
*/
protected String getReferencesParameter() {
//bail on no references
if (notEmpty(references)) {
if (isWindows) {
return '\"' + REFERENCE_OPTION + references + '\"';
} else {
return REFERENCE_OPTION + references;
}
} else {
return null;
}
}

/**
* Path of references to include.
* Wildcards should work.
*
*@param path another path to append
*/
public void setReferenceFiles(Path path) {
//demand create pathlist
if (referenceFiles == null) {
referenceFiles = new Path(this.getProject());
}
referenceFiles.append(path);
}

/**
* add a new reference fileset to the compilation
* @param reference the files to use.
*/
public void addReference(FileSet reference) {
referenceFilesets.add(reference);
}



/**
* turn the path list into a list of files and a /references argument
*
*@return null or a string of references.
*/
protected String getReferenceFilesParameter() {
//bail on no references
if (references == null) {
return null;
}
//iterate through the ref list & generate an entry for each
//or just rely on the fact that the toString operator does this, but
//noting that the separator is ';' on windows, ':' on unix

//bail on no references listed
if (references.length() == 0) {
return null;
}

StringBuffer s = new StringBuffer(REFERENCE_OPTION);
if (isWindows) {
s.append('\"');
}
s.append(references);
if (isWindows) {
s.append('\"');
}
return s.toString();
}


/**
* If true, automatically includes the common assemblies
* in dotnet, and tells the compiler to link in mscore.dll.
*
* set the automatic reference inclusion flag on or off this flag controls
* the /nostdlib option in CSC
*
*@param f on/off flag
*/
public void setIncludeDefaultReferences(boolean f) {
includeDefaultReferences = f;
}


/**
* query automatic reference inclusion flag
*
*@return true if flag is turned on
*/
public boolean getIncludeDefaultReferences() {
return includeDefaultReferences;
}


/**
* get the include default references flag or null for no argument needed
*
*@return The Parameter to CSC
*/
protected String getIncludeDefaultReferencesParameter() {
return "/nostdlib" + (includeDefaultReferences ? "-" : "+");
}



/**
* If true, enables optimization flag.
*
*@param f on/off flag
*/
public void setOptimize(boolean f) {
optimize = f;
}


/**
* query the optimise flag
*
*@return true if optimise is turned on
*/
public boolean getOptimize() {
return optimize;
}


/**
* get the optimise flag or null for no argument needed
*
*@return The Optimize Parameter to CSC
*/
protected String getOptimizeParameter() {
return "/optimize" + (optimize ? "+" : "-");
}


/**
* set the debug flag on or off.
*
*@param f on/off flag
*/
public void setDebug(boolean f) {
debug = f;
}


/**
* query the debug flag
*
*@return true if debug is turned on
*/
public boolean getDebug() {
return debug;
}


/**
* get the debug switch argument
*
*@return The Debug Parameter to CSC
*/
protected String getDebugParameter() {
return "/debug" + (debug ? "+" : "-");
}


/**
* Level of warning currently between 1 and 4
* with 4 being the strictest.
*
*@param warnLevel warn level -see .net docs for valid range (probably
* 0-4)
*/
public void setWarnLevel(int warnLevel) {
this.warnLevel = warnLevel;
}


/**
* query warn level
*
*@return current value
*/
public int getWarnLevel() {
return warnLevel;
}


/**
* get the warn level switch
*
*@return The WarnLevel Parameter to CSC
*/
protected String getWarnLevelParameter() {
return "/warn:" + warnLevel;
}


/**
* Sets the name of main class for executables.
*
*@param mainClass The new MainClass value
*/
public void setMainClass(String mainClass) {
this.mainClass = mainClass;
}


/**
* Gets the MainClass attribute
*
*@return The MainClass value
*/
public String getMainClass() {
return this.mainClass;
}


/**
* get the /main argument or null for no argument needed
*
*@return The MainClass Parameter to CSC
*/
protected String getMainClassParameter() {
if (mainClass != null && mainClass.length() != 0) {
return "/main:" + mainClass;
} else {
return null;
}
}


/**
* Any extra options which are not explicitly supported
* by this task.
*
*@param extraOptions The new ExtraOptions value
*/
public void setExtraOptions(String extraOptions) {
this.extraOptions = extraOptions;
}


/**
* Gets the ExtraOptions attribute
*
*@return The ExtraOptions value
*/
public String getExtraOptions() {
return this.extraOptions;
}


/**
* get any extra options or null for no argument needed
*
*@return The ExtraOptions Parameter to CSC
*/
protected String getExtraOptionsParameter() {
if (extraOptions != null && extraOptions.length() != 0) {
return extraOptions;
} else {
return null;
}
}

/**
* get any extra options or null for no argument needed, split
* them if they represent multiple options.
*
* @return The ExtraOptions Parameter to CSC
*/
protected String[] getExtraOptionsParameters() {
String extra = getExtraOptionsParameter();
return extra == null ? null : Commandline.translateCommandline(extra);
}

/**
* Set the destination directory of files to be compiled.
*
*@param dirName The new DestDir value
*/
public void setDestDir(File dirName) {
log("DestDir currently unused", Project.MSG_WARN);
}


/**
* set the target type to one of exe|library|module|winexe
* @param targetType the enumerated value.
*/
public void setTargetType(TargetTypes targetType) {
this.targetType = targetType.getValue();
}
/**
* Set the type of target.
*
*@param ttype The new TargetType value
*@exception BuildException if target is not one of
* exe|library|module|winexe
*/
public void setTargetType(String ttype)
throws BuildException {
ttype = ttype.toLowerCase();
if (ttype.equals("exe") || ttype.equals("library")
|| ttype.equals("module") || ttype.equals("winexe")) {
targetType = ttype;
} else {
throw new BuildException("targetType " + ttype
+ " is not one of 'exe', 'module', 'winexe' or 'library'");
}
}


/**
* Gets the TargetType attribute
*
*@return The TargetType value
*/
public String getTargetType() {
return targetType;
}


/**
* get the argument or null for no argument needed
*
*@return The TargetType Parameter to CSC
*/
protected String getTargetTypeParameter() {
if (notEmpty(targetType)) {
return "/target:" + targetType;
} else {
return null;
}
}


/**
* Set the filename of icon to include.
*
*@param fileName path to the file. Can be relative, absolute, whatever.
*/
public void setWin32Icon(File fileName) {
win32icon = fileName;
}


/**
* get the argument or null for no argument needed
*
*@return The Win32Icon Parameter to CSC
*/
protected String getWin32IconParameter() {
if (win32icon != null) {
return "/win32icon:" + win32icon.toString();
} else {
return null;
}
}


/**
* Sets the filename of a win32 resource (.RES) file to include.
* This is not a .NET resource, but what Windows is used to.
*
*@param fileName path to the file. Can be relative, absolute, whatever.
*/
public void setWin32Res(File fileName) {
win32res = fileName;
}

/**
* Gets the file of the win32 .res file to include.
* @return path to the file.
*/
public File getWin32Res() {
return win32res;
}


/**
* get the argument or null for no argument needed
*
*@return The Win32Res Parameter to CSC
*/
protected String getWin32ResParameter() {
if (win32res != null) {
return "/win32res:" + win32res.toString();
} else {
return null;
}
}


/**
* If true, require all compiler output to be in UTF8 format.
*
*@param enabled The new utf8Output value
*/
public void setUtf8Output(boolean enabled) {
utf8output = enabled;
}


/**
* Gets the utf8OutpuParameter attribute of the CSharp object
*
*@return The utf8OutpuParameter value
*/
protected String getUtf8OutputParameter() {
return utf8output ? "/utf8output" : null;
}


/**
* add a define to the list of definitions
* @param define the define value.
*/
public void addDefine(DotnetDefine define) {
definitionList.addElement(define);
}


/**
* get a list of definitions or null
* @return a string beginning /D: or null for no definitions
* @throws BuildException if there is an error.
*/
protected String getDefinitionsParameter() throws BuildException {
StringBuffer defines = new StringBuffer();
Enumeration defEnum = definitionList.elements();
boolean firstDefinition = true;
while (defEnum.hasMoreElements()) {
//loop through all definitions
DotnetDefine define = (DotnetDefine) defEnum.nextElement();
if (define.isSet(this)) {
//add those that are set, and a delimiter
if (!firstDefinition) {
defines.append(getDefinitionsDelimiter());
}
defines.append(define.getValue(this));
firstDefinition = false;
}
}
if (defines.length() == 0) {
return null;
} else {
return "/d:" + defines;
}
}


/**
* Semicolon separated list of modules to refer to.
*
*@param params The new additionalModules value
*/
public void setAdditionalModules(String params) {
additionalModules = params;
}


/**
* get the argument or null for no argument needed
*
*@return The AdditionalModules Parameter to CSC
*/
protected String getAdditionalModulesParameter() {
if (notEmpty(additionalModules)) {
return "/addmodule:" + additionalModules;
} else {
return null;
}
}


/**
* get the argument or null for no argument needed
*
*@return The OutputFile Parameter to CSC
*/
protected String getDestFileParameter() {
if (outputFile != null) {
return "/out:" + outputFile.toString();
} else {
return null;
}
}


/**
* If true, fail on compilation errors.
*
*@param b The new FailOnError value
*/
public void setFailOnError(boolean b) {
failOnError = b;
}


/**
* query fail on error flag
*
*@return The FailFailOnError value
*/
public boolean getFailOnError() {
return failOnError;
}

/**
* link or embed a resource
* @param resource the resource to use.
*/
public void addResource(DotnetResource resource) {
resources.add(resource);
}

/**
* This method gets the name of the executable.
* @return the name of the executable
*/
protected String getExecutable() {
return executable;
}

/**
* set the name of the program, overriding the defaults.
* Can be used to set the full path to a program, or to switch
* to an alternate implementation of the command, such as the Mono or Rotor
* versions -provided they use the same command line arguments as the
* .NET framework edition
* @param executable the name of the program.
*/
public void setExecutable(String executable) {
this.executable = executable;
}

/**
* test for a string containing something useful
*
*@param s string in
*@return true if the argument is not null or empty
*/
protected boolean notEmpty(String s) {
return s != null && s.length() != 0;
}

/**
* validation code
* @throws BuildException if validation failed
*/
protected void validate()
throws BuildException {
if (outputFile != null && outputFile.isDirectory()) {
throw new BuildException("destFile cannot be a directory");
}
if (getExecutable() == null) {
throw new BuildException("There is no executable defined for this task");
}
}

/**
* Get the pattern for files to compile.
* @return The compilation file pattern.
*/
public String getFilePattern() {
return "**/*." + getFileExtension();
}

/**
* getter for flag
* @return The flag indicating whether the compilation is using a response file.
*/
public boolean isUseResponseFile() {
return useResponseFile;
}

/**
* Flag to turn on response file use; default=false.
* When set the command params are saved to a file and
* this is passed in with @file. The task automatically switches
* to this mode with big commands; this option is here for
* testing and emergencies
* @param useResponseFile a <code>boolean</code> value.
*/
public void setUseResponseFile(boolean useResponseFile) {
this.useResponseFile = useResponseFile;
}

/**
* do the work by building the command line and then calling it
*
*@throws BuildException if validation or execution failed
*/
public void execute()
throws BuildException {
log("This task is deprecated and will be removed in a future version\n"
+ "of Ant. It is now part of the .NET Antlib:\n"
+ "http://ant.apache.org/antlibs/dotnet/index.html",
Project.MSG_WARN);

validate();
NetCommand command = createNetCommand();
//set up response file options
command.setAutomaticResponseFileThreshold(AUTOMATIC_RESPONSE_FILE_THRESHOLD);
command.setUseResponseFile(useResponseFile);
//fill in args
fillInSharedParameters(command);
addResources(command);
addCompilerSpecificOptions(command);
int referencesOutOfDate
= addReferenceFilesets(command, getOutputFileTimestamp());
//if the refs are out of date, force a build.
boolean forceBuild = referencesOutOfDate > 0;
addFilesAndExecute(command, forceBuild);

}

/**
* Get the delimiter that the compiler uses between references.
* For example, c# will return ";"; VB.NET will return ","
* @return The string delimiter for the reference string.
*/
public abstract String getReferenceDelimiter();

/**
* Get the extension of filenames to compile.
* @return The string extension of files to compile.
*/
public abstract String getFileExtension();


/**
* fill in the common information
* @param command the net command.
*/
protected void fillInSharedParameters(NetCommand command) {
command.setFailOnError(getFailOnError());
//fill in args
command.addArgument("/nologo");
command.addArgument(getAdditionalModulesParameter());
command.addArgument(getDebugParameter());
command.addArgument(getDefinitionsParameter());
command.addArguments(getExtraOptionsParameters());
command.addArgument(getMainClassParameter());
command.addArgument(getOptimizeParameter());
command.addArgument(getDestFileParameter());
command.addArgument(getReferencesParameter());
command.addArgument(getTargetTypeParameter());
command.addArgument(getUtf8OutputParameter());
command.addArgument(getWin32IconParameter());
command.addArgument(getWin32ResParameter());
}

/**
* for every resource declared, we get the (language specific)
* resource setting
* @param command the net command.
*/
protected void addResources(NetCommand command) {
Enumeration e = resources.elements();
while (e.hasMoreElements()) {
DotnetResource resource = (DotnetResource) e.nextElement();
createResourceParameter(command, resource);
}
}

/**
* Build a C# style parameter.
* @param command the command.
* @param resource the resource.
*/
protected abstract void createResourceParameter(NetCommand command, DotnetResource resource);


/**
* run through the list of reference files and add them to the command
* @param command the command to use.
* @param outputTimestamp timestamp to compare against
* @return number of files out of date
*/

protected int addReferenceFilesets(NetCommand command, long outputTimestamp) {
int filesOutOfDate = 0;
Hashtable filesToBuild = new Hashtable();
for (int i = 0; i < referenceFilesets.size(); i++) {
FileSet fs = (FileSet) referenceFilesets.elementAt(i);
filesOutOfDate += command.scanOneFileset(
fs.getDirectoryScanner(getProject()),
filesToBuild,
outputTimestamp);
}
//bail out early if there were no files
if (filesToBuild.size() == 0) {
return 0;
}
//now scan the hashtable and add the files
Enumeration files = filesToBuild.elements();
while (files.hasMoreElements()) {
File file = (File) files.nextElement();
if (isFileManagedBinary(file)) {
if (isWindows) {
command.addArgument(
'"' + REFERENCE_OPTION + file.toString() + '"');
} else {
command.addArgument(REFERENCE_OPTION + file.toString());
}
} else {
log("ignoring " + file + " as it is not a managed executable",
Project.MSG_VERBOSE);
}

}

return filesOutOfDate;
}

/**
* create our helper command
* @return a command prefilled with the exe name and task name
*/
protected NetCommand createNetCommand() {
NetCommand command = new NetCommand(this, getTaskName(), getExecutable());
return command;
}

/**
* add any compiler specifics
* @param command the command to use.
*/
protected abstract void addCompilerSpecificOptions(NetCommand command);

/**
* override point for delimiting definitions.
* @return The definitions limiter, i.e., ";"
*/
public String getDefinitionsDelimiter() {
return ";";
}


/**
* test for a file being managed or not
* @param file the file to test.
* @return true if we think this is a managed executable, and thus OK
* for linking
* @todo look at the PE header of the exe and see if it is managed or not.
*/
protected static boolean isFileManagedBinary(File file) {
String filename = file.toString().toLowerCase();
return filename.endsWith(".exe") || filename.endsWith(".dll")
|| filename.endsWith(".netmodule");
}

/**
* Target types to build.
* valid build types are exe|library|module|winexe
*/
public static class TargetTypes extends EnumeratedAttribute {
/** {@inheritDoc}. */
public String[] getValues() {
return new String[] {
"exe",
"library",
"module",
"winexe"
};
}
}


}



+ 0
- 102
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetDefine.java View File

@@ -1,102 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.taskdefs.optional.dotnet;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.Project;

/**
* definitions can be conditional. What .NET conditions can not be
* is in any state other than defined and undefined; you cannot give
* a definition a value.
*/
public class DotnetDefine {
private String name;
private String ifCond;
private String unlessCond;


/**
* the name of a property which must be defined for
* the definition to be set. Optional.
* @param condition the name of the property
*/
public void setIf(String condition) {
this.ifCond = condition;
}

/**
* the name of a property which must be undefined for
* the definition to be set. Optional.
* @param condition the name of the property
*/
public void setUnless(String condition) {
this.unlessCond = condition;
}

/**
* Get the name of the definition.
* @return the name.
*/
public String getName() {
return name;
}

/**
* the name of the definition. Required.
* @param name the name value.
*/
public void setName(String name) {
this.name = name;
}

/**
* This method gets the value of this definition. Will be null if a condition
* was declared and not met
* @param owner owning task
* @return The value of the definition.
* @throws BuildException if there is an error.
*/
public String getValue(Task owner) throws BuildException {
if (name == null) {
throw new BuildException("No name provided for the define element",
owner.getLocation());
}
if (!isSet(owner)) {
return null;
}
return name;
}


/**
* logic taken from patternset
* @param owner the owning task.
* @return true if the condition is valid
*/
public boolean isSet(Task owner) {
Project p = owner.getProject();
if (ifCond != null && p.getProperty(ifCond) == null) {
return false;
} else if (unlessCond != null && p.getProperty(unlessCond) != null) {
return false;
}
return true;
}
}

+ 0
- 248
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetResource.java View File

@@ -1,248 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.taskdefs.optional.dotnet;

import org.apache.tools.ant.BuildException;

import java.io.File;
import java.util.ArrayList;
import org.apache.tools.ant.types.FileSet;
import java.util.Iterator;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.DirectoryScanner;

/**
* Used by {@link DotnetCompile} to name resources.
* Could be upgraded to a datatype in the distant future.
* A resource maps to /res:file,name
*/
public class DotnetResource {

/**
* name of resource
*/
private File file;

/**
* embed (default) or link the resource
*/
private boolean embed = true;

/**
* this is used in VBC and JSC
*/
private Boolean isPublic = null;

/**
* name of the object
*/
private String name = null;

/**
* A list of filesets with resources.
*/
private ArrayList fileSets = new ArrayList();

/**
* a namespace to be used with <filesets>
*/
private String namespace = null;

/**
* Return the embed attribute.
* @return the embed value.
*/
public boolean isEmbed() {
return embed;
}

/**
* embed the resource in the assembly (default, true) or just link to it.
*
* @param embed a <code>boolean</code> value.
*/
public void setEmbed(boolean embed) {
this.embed = embed;
}

/**
* The file resource.
* @return the file resource.
*/
public File getFile() {
return file;
}

/**
* name the resource
*
* @param file the file.
*/
public void setFile(File file) {
this.file = file;
}

/**
* Get the public attribute.
* @return the public attribute.
*/
public Boolean getPublic() {
return isPublic;
}

/**
* VB and J# only: is a resource public or not?
*
* @param aPublic a <code>boolean</code> value.
*/
public void setPublic(Boolean aPublic) {
isPublic = aPublic;
}

/**
* The name of the resource.
* @return the name of the resource.
*/
public String getName() {
return name;
}

/**
* should the resource have a name?
*
* @param name the name of the resource.
*/
public void setName(String name) {
this.name = name;
}

/**
* Filesets root namespace. The value always ends with '.' .
*
* @return String namespace name
*/
public String getNamespace() {
return namespace;
}

/**
* Sets filesets root namespace.
*
* @param namespace
* String root namespace
*/
public void setNamespace(String namespace) {
if (namespace == null) {
this.namespace = null;
} else {
this.namespace = (namespace.length() == 0 || namespace.endsWith(".") ? namespace
: namespace + '.');
}
}

private void checkParameters() {
if (hasFilesets()) {
if (getName() != null) {
throw new BuildException(
"Cannot use <resource name=\"...\"> attribute with filesets");
}
if (getFile() != null) {
throw new BuildException(
"Cannot use <resource file=\"...\"> attribute with filesets");
}
} else {
if (getNamespace() != null) {
throw new BuildException(
"Cannot use <resource namespace=\"...\"> attribute without filesets");
}
}
}

/**
* build the C# style parameter (which has no public/private option)
* @param p the current project.
* @param command the command.
* @param csharpStyle a <code>boolean</code> attribute.
*/
public void getParameters(Project p, NetCommand command, boolean csharpStyle) {
checkParameters();
if (hasFilesets()) {
for (Iterator listIter = fileSets.iterator(); listIter.hasNext();) {
FileSet fs = (FileSet) listIter.next();
String baseDirectory = fs.getDir(p).toString();
String namespace = getNamespace(); // ends with '.' or null
DirectoryScanner ds = fs.getDirectoryScanner(p);
String[] files = ds.getIncludedFiles();
for (int i = 0; i < files.length; i++) {
String file = files[i];
command.addArgument(getParameter(baseDirectory + File.separatorChar + file,
(namespace == null ? null : namespace
+ file.replace(File.separatorChar, '.')), csharpStyle));
}
}
} else {
command.addArgument(getParameter(getFile().toString(), getName(), csharpStyle));
}
}

private String getParameter(String fileName, String name, boolean csharpStyle) {
StringBuffer buffer = new StringBuffer();
buffer.append(isEmbed() ? "/resource" : "/linkresource");
buffer.append(':');
buffer.append(fileName);
if (name != null) {
buffer.append(',');
buffer.append(name);
if (csharpStyle) {
if (getPublic() != null) {
throw new BuildException("This compiler does not support the "
+ "public/private option.");
} else {
if (getPublic() != null) {
buffer.append(',');
buffer.append(getPublic().booleanValue() ? "public" : "private");

}
}
} else if (getPublic() != null) {
throw new BuildException("You cannot have a public or private "
+ "option without naming the resource");
}
}
return buffer.toString();
}

/**
* Adds a resource file set.
*
* @param fileset
* FileSet
*/
public void addFileset(FileSet fileset) {
fileSets.add(fileset);
}

/**
* Checks that <resource> node has embedded <filesets>
*
* @return boolean
*/
public boolean hasFilesets() {
return fileSets.size() > 0;
}
}

+ 0
- 540
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java View File

@@ -1,540 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
* build notes
* -The reference CD to listen to while editing this file is
* nap: Underworld - Everything, Everything
*/

package org.apache.tools.ant.taskdefs.optional.dotnet;


import java.io.File;
import java.util.Vector;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.types.FileSet;

/**
* Assembles .NET Intermediate Language files.
* ilasm.exe must be on the execute path, unless another executable
* or the full path to that executable is specified in the <tt>executable</tt>
* parameter
* <p>
*
* <p>
*
* All parameters are optional: &lt;il/&gt; should suffice to produce a debug
* build of all *.il files. The option set is roughly compatible with the
* CSharp class; even though the command line options are only vaguely
* equivalent. [The low level commands take things like /OUT=file, csc wants
* /out:file ... /verbose is used some places; /quiet here in ildasm... etc.]
* It would be nice if someone made all the command line tools consistent (and
* not as brittle as the java cmdline tools) <p>
* <p>
* The task is a directory based task, so attributes like <b>includes="*.il"
* </b> and <b>excludes="broken.il"</b> can be used to control the files pulled
* in. You can also use nested &lt;src&gt filesets to refer to source.
* <p>
*
* @ant.task name="ilasm" category="dotnet"
*/

public class Ilasm
extends DotnetBaseMatchingTask {

// CheckStyle:VisibilityModifier OFF - bc
// CheckStyle:ConstantNameCheck OFF - bc
/**
* Name of the executable. The .exe suffix is deliberately not included in
* anticipation of the unix version
*/
protected static final String exe_name = "ilasm";

/**
* what is the file extension we search on?
*/
protected static final String file_ext = "il";

/**
* and now derive the search pattern from the extension
*/
protected static final String file_pattern = "**/*." + file_ext;

/**
* title of task for external presentation
*/
protected static final String exe_title = "ilasm";

/**
* type of target. Should be one of exe|library|module|winexe|(null)
* default is exe; the actual value (if not null) is fed to the command
* line. <br>
* See /target
*/
protected String targetType;

/**
* verbose flag
*/
protected boolean verbose;

/**
* listing flag
*/

protected boolean listing;

/**
* resource file (.res format) to include in the app.
*/
protected File resourceFile;

/**
* flag to control action on execution trouble
*/
protected boolean failOnError;

/**
* debug flag. Controls generation of debug information.
*/
protected boolean debug;

/**
* file containing private key
*/

private File keyfile;

/**
* any extra command options?
*/
protected String extraOptions;

/**
* filesets of references
*/
protected Vector referenceFilesets = new Vector();

// CheckStyle:ConstantNameCheck ON
// CheckStyle:VisibilityModifier ON

/**
* @since Ant 1.7
*/
private boolean isMono = !Os.isFamily("windows");

/**
* constructor inits everything and set up the search pattern
*/
public Ilasm() {
Clear();
setIncludes(file_pattern);
}

// CheckStyle:MethodNameCheck OFF - bc
/**
* reset all contents.
*/
public void Clear() {
targetType = null;
srcDir = null;
listing = false;
verbose = false;
debug = true;
outputFile = null;
failOnError = true;
resourceFile = null;
extraOptions = null;
}
// CheckStyle:MethodNameCheck ON



/**
* Sets the type of target, either "exe" or "library".
*
*@param targetType one of exe|library|
*@exception BuildException if target is not one of
* exe|library
*/
public void setTargetType(String targetType)
throws BuildException {
this.targetType = targetType.toLowerCase();
if (!targetType.equals("exe") && !targetType.equals("library")) {
throw new BuildException("targetType " + targetType + " is not a valid type");
}
}


/**
* accessor method for target type
*
*@return the current target option
*/
public String getTargetType() {
return targetType;
}


/**
* g get the target type or null for no argument needed
*
*@return The TargetTypeParameter value
*/

protected String getTargetTypeParameter() {
if (!notEmpty(targetType)) {
return null;
}
if (targetType.equals("exe")) {
return "/exe";
} else if (targetType.equals("library")) {
return "/dll";
} else {
return null;
}
}


/**
* Sets the Owner attribute.
*
* @param s The new Owner value
* @ant.attribute ignore="true"
*/
public void setOwner(String s) {
log("This option is not supported by ILASM as of Beta-2, "
+ "and will be ignored", Project.MSG_WARN);
}


/**
* test for a string containing something useful
*
*@param s any string
*@return true if the argument is not null or empty
*/
protected boolean notEmpty(String s) {
return s != null && s.length() != 0;
}


/**
* If true, enable verbose ILASM output.
*
*@param b flag set to true for verbose on
*/
public void setVerbose(boolean b) {
verbose = b;
}


/**
* turn the verbose flag into a parameter for ILASM
*
*@return null or the appropriate command line string
*/
protected String getVerboseParameter() {
return verbose ? null : "/quiet";
}


/**
* If true, produce a listing (off by default).
*
*@param b flag set to true for listing on
*/
public void setListing(boolean b) {
listing = b;
}


/**
* turn the listing flag into a parameter for ILASM
*
*@return the appropriate string from the state of the listing flag
*/
protected String getListingParameter() {
if (!isMono) {
return listing ? "/listing" : "/nolisting";
}
return null;
}


/**
* Set the output file; identical to setDestFile
* @see DotnetBaseMatchingTask#setDestFile
*@param params The new outputFile value
*/
public void setOutputFile(File params) {
outputFile = params;
}


/**
* get the output file
*
*@return the argument string or null for no argument
*/
protected String getOutputFileParameter() {
if (outputFile == null) {
return null;
}
return "/output=" + outputFile.toString();
}


/**
* name of resource file to include.
*
* @param fileName path to the file. Can be relative, absolute, whatever.
*/
public void setResourceFile(File fileName) {
resourceFile = fileName;
}


/**
* Gets the resourceFileParameter attribute of the Ilasm task
*
*@return The resourceFileParameter value
*/
protected String getResourceFileParameter() {
if (resourceFile != null) {
return "/resource=" + resourceFile.toString();
} else {
return null;
}
}


/**
* If true, fails if ilasm tool fails.
*
*@param b The new failOnError value
*/
public void setFailOnError(boolean b) {
failOnError = b;
}


/**
* query fail on error flag
*
*@return The failFailOnError value
*/
public boolean getFailOnError() {
return failOnError;
}


/**
* set the debug flag on or off.
*
*@param f on/off flag
*/
public void setDebug(boolean f) {
debug = f;
}


/**
* query the debug flag
*
*@return true if debug is turned on
*/
public boolean getDebug() {
return debug;
}


/**
* get the argument or null for no argument needed
*
*@return The debugParameter value
*/
protected String getDebugParameter() {
return debug ? "/debug" : null;
}


/**
* the name of a file containing a private key.
*
*@param keyfile The new keyfile value
*/
public void setKeyfile(File keyfile) {
this.keyfile = keyfile;
}


/**
* get the argument or null for no argument needed
*
*@return The keyfileParameter value
*/
protected String getKeyfileParameter() {
if (keyfile != null) {
return "/keyfile:" + keyfile.toString();
} else {
return null;
}
}


/**
* Any extra options which are not explicitly
* supported by this task.
*
*@param extraOptions The new ExtraOptions value
*/
public void setExtraOptions(String extraOptions) {
this.extraOptions = extraOptions;
}


/**
* Gets the ExtraOptions attribute
*
*@return The ExtraOptions value
*/
public String getExtraOptions() {
return this.extraOptions;
}


/**
* get any extra options or null for no argument needed
*
*@return The ExtraOptions Parameter to CSC
*/
protected String getExtraOptionsParameter() {
if (extraOptions != null && extraOptions.length() != 0) {
return extraOptions;
} else {
return null;
}
}

/**
* set the target type to one of exe|library
* @param targetType the enumerated value.
*/
public void setTargetType(TargetTypes targetType) {
this.targetType = targetType.getValue();
}

/**
* Explicitly override the Mono auto-detection.
*
* <p>Defaults to false on Windows and true on any other platform.</p>
* @param b a <code>boolean</code> value.
* @since Ant 1.7
*/
public void setMono(boolean b) {
isMono = b;
}

/**
* This is the execution entry point. Build a list of files and call ilasm
* on each of them.
*
*@throws BuildException if the assembly failed and FailOnError is true
*/
public void execute()
throws BuildException {
log("This task is deprecated and will be removed in a future version\n"
+ "of Ant. It is now part of the .NET Antlib:\n"
+ "http://ant.apache.org/antlibs/dotnet/index.html",
Project.MSG_WARN);
NetCommand command = buildIlasmCommand();

addFilesAndExecute(command, false);

}
// end execute


/**
* build up our ilasm command
* @return
*/
private NetCommand buildIlasmCommand() {
NetCommand command = new NetCommand(this, exe_title, exe_name);
command.setFailOnError(getFailOnError());
//fill in args
command.addArgument(getDebugParameter());
command.addArgument(getTargetTypeParameter());
command.addArgument(getListingParameter());
command.addArgument(getOutputFileParameter());
command.addArgument(getResourceFileParameter());
command.addArgument(getVerboseParameter());
command.addArgument(getKeyfileParameter());
command.addArgument(getExtraOptionsParameter());

/*
* space for more argumentativeness
* command.addArgument();
* command.addArgument();
*/
return command;
}

/**
* add a new reference fileset to the compilation
* @param reference the fileset to use.
*/
public void addReference(FileSet reference) {
referenceFilesets.add(reference);
}

/**
* test for a file being managed or not
* @param file the file to test.
* @return true if we think this is a managed executable, and thus OK
* for linking
* @todo look at the PE header of the exe and see if it is managed or not.
*/
protected static boolean isFileManagedBinary(File file) {
String filename = file.toString().toLowerCase();
return filename.endsWith(".exe") || filename.endsWith(".dll")
|| filename.endsWith(".netmodule");
}


/**
* Target types to build.
* valid build types are exe|library|module|winexe
*/
public static class TargetTypes extends EnumeratedAttribute {
/** {@inheritDoc}. */
public String[] getValues() {
return new String[]{
"exe",
"library",
};
}
}

}


+ 0
- 474
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ildasm.java View File

@@ -1,474 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.taskdefs.optional.dotnet;

import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.util.FileUtils;

import java.io.File;

/**
* Task to take a .NET or Mono -generated managed executable and turn it
* into ILASM assembly code. Useful when converting imported typelibs into
* assembler before patching and recompiling, as one has to do when doing
* advanced typelib work.
* <p>
* As well as generating the named output file, the ildasm program
* will also generate resource files <code>Icons.resources</code>
* <code>Message.resources</code> and a .res file whose filename stub is derived
* from the source in ways to obscure to determine.
* There is no way to control whether or not these files are created, or where they are created
* (they are created in the current directory; their names come from inside the
* executable and may be those used by the original developer). This task
* creates the resources in the directory specified by <code>resourceDir</code> if
* set, else in the same directory as the <code>destFile</code>.
*
* <p>
* This task requires the .NET SDK installed and ildasm on the path.
* To disassemble using alternate CLR systems, set the executable attribute
* to the name/path of the alternate implementation -one that must
* support all the classic ildasm commands.
*
* <p>
* Dependency logic: the task executes the command if the output file is missing
* or older than the source file. It does not take into account changes
* in the options of the task, or timestamp differences in resource files.
* When the underlying ildasm executable fails for some reason, it leaves the
* .il file in place with some error message. To prevent this from confusing
* the dependency logic, the file specified by the <code>dest</code>
* attribute is <i>always</i> deleted after an unsuccessful build.
* @ant.task category="dotnet"
*/
public class Ildasm extends Task {

private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();

/**
* source file (mandatory)
*/
private File sourceFile;

/**
* dest file (mandatory)
*/
private File destFile;
/**
* progress bar switch
*/
private boolean progressBar = false;

/**
* what is our encoding
*/
private String encoding;

/**
* /bytes flag for byte markup
*/

private boolean bytes = false;

/**
* line numbers? /linenum
*/
private boolean linenumbers = false;

/**
* /raweh flag for raw exception handling
*/
private boolean rawExceptionHandling = false;

/**
* show the source; /source
*/
private boolean showSource = false;

/**
* /quoteallnames to quote all names
*/
private boolean quoteallnames = false;

/**
* /header for header information
*/
private boolean header = false;

/**
* when false, sets the /noil attribute
* to suppress assembly info
*/
private boolean assembler = true;

/**
* include metadata
* /tokens
*/

private boolean metadata = false;

/**
* what visibility do we want.
*
*/
private String visibility;

/**
* specific item to disassemble
*/

private String item;

/**
* override for the executable
*/
private String executable = "ildasm";

/**
* name of the directory for resources to be created. We cannot control
* their names, but we can say where they get created. If not set, the
* directory of the dest file is used
*/
private File resourceDir;


/**
* Set the name of the directory for resources to be created. We cannot control
* their names, but we can say where they get created. If not set, the
* directory of the dest file is used
* @param resourceDir the directory in which to create resources.
*/
public void setResourceDir(File resourceDir) {
this.resourceDir = resourceDir;
}

/**
* override the name of the executable (normally ildasm) or set
* its full path. Do not set a relative path, as the ugly hacks
* needed to create resource files in the dest directory
* force us to change to this directory before running the application.
* i.e use &lt;property location&gt to create an absolute path from a
* relative one before setting this value.
* @param executable the name of the executable to use.
*/
public void setExecutable(String executable) {
this.executable = executable;
}

/**
* Select the output encoding: ascii, utf8 or unicode
* @param encoding the enumerated value.
*/
public void setEncoding(EncodingTypes encoding) {
this.encoding = encoding.getValue();
}

/**
* enable (default) or disable assembly language in the output
* @param assembler a <code>boolean</code> value.
*/
public void setAssembler(boolean assembler) {
this.assembler = assembler;
}

/**
* enable or disable (default) the original bytes as comments
* @param bytes a <code>boolean</code> value.
*/
public void setBytes(boolean bytes) {
this.bytes = bytes;
}

/**
* the output file (required)
* @param destFile the destination file.
*/
public void setDestFile(File destFile) {
this.destFile = destFile;
}

/**
* include header information; default false.
* @param header a <code>boolean</code> value.
*/
public void setHeader(boolean header) {
this.header = header;
}

/**
* name a single item to decode; a class or a method
* e.g item="Myclass::method" or item="namespace1::namespace2::Myclass:method(void(int32))
* @param item the item to decode.
*/
public void setItem(String item) {
this.item = item;
}

/**
* include line number information; default=false
* @param linenumbers a <code>boolean</code> value.
*/
public void setLinenumbers(boolean linenumbers) {
this.linenumbers = linenumbers;
}

/**
* include metadata information
* @param metadata a <code>boolean</code> value.
*/
public void setMetadata(boolean metadata) {
this.metadata = metadata;
}

/**
* show a graphical progress bar in a window during the process; off by default
* @param progressBar a <code>boolean</code> value.
*/
public void setProgressBar(boolean progressBar) {
this.progressBar = progressBar;
}

/**
* quote all names.
* @param quoteallnames a <code>boolean</code> value.
*/
public void setQuoteallnames(boolean quoteallnames) {
this.quoteallnames = quoteallnames;
}

/**
* enable raw exception handling (default = false)
* @param rawExceptionHandling a <code>boolean</code> value.
*/
public void setRawExceptionHandling(boolean rawExceptionHandling) {
this.rawExceptionHandling = rawExceptionHandling;
}

/**
* include the source as comments (default=false)
* @param showSource a <code>boolean</code> value.
*/
public void setShowSource(boolean showSource) {
this.showSource = showSource;
}

/**
* the file to disassemble -required
* @param sourceFile the file to disassemble.
*/
public void setSourceFile(File sourceFile) {
this.sourceFile = sourceFile;
}

/**
* alternate name for sourceFile
* @param sourceFile the source file.
*/
public void setSrcFile(File sourceFile) {
setSourceFile(sourceFile);
}
/**
* This method sets the visibility options. It chooses one
* or more of the following, with + signs to concatenate them:
* <pre>
* pub : Public
* pri : Private
* fam : Family
* asm : Assembly
* faa : Family and Assembly
* foa : Family or Assembly
* psc : Private Scope
*</pre>
* e.g. visibility="pub+pri".
* Family means <code>protected</code> in C#;
* @param visibility the options to use.
*/
public void setVisibility(String visibility) {
this.visibility = visibility;
}

/**
* verify that source and dest are ok
*/
private void validate() {
if (sourceFile == null || !sourceFile.exists() || !sourceFile.isFile()) {
throw new BuildException("invalid source");
}
if (destFile == null || destFile.isDirectory()) {
throw new BuildException("invalid dest");
}
if (resourceDir != null
&& (!resourceDir.exists() || !resourceDir.isDirectory())) {
throw new BuildException("invalid resource directory");
}
}

/**
* Test for disassembly being needed; use existence and granularity
* correct date stamps
* @return true iff a rebuild is required.
*/
private boolean isDisassemblyNeeded() {
if (!destFile.exists()) {
log("Destination file does not exist: a build is required",
Project.MSG_VERBOSE);
return true;
}
long sourceTime = sourceFile.lastModified();
long destTime = destFile.lastModified();
if (sourceTime > (destTime + FILE_UTILS.getFileTimestampGranularity())) {
log("Source file is newer than the dest file: a rebuild is required",
Project.MSG_VERBOSE);
return true;
} else {
log("The .il file is up to date", Project.MSG_VERBOSE);
return false;
}

}
/**
* do the work
* @throws BuildException if there is an error.
*/
public void execute() throws BuildException {
log("This task is deprecated and will be removed in a future version\n"
+ "of Ant. It is now part of the .NET Antlib:\n"
+ "http://ant.apache.org/antlibs/dotnet/index.html",
Project.MSG_WARN);
validate();
if (!isDisassemblyNeeded()) {
return;
}
NetCommand command = new NetCommand(this, "ildasm", executable);
command.setFailOnError(true);
//fill in args
command.addArgument("/text");
command.addArgument("/out=" + destFile.toString());
if (!progressBar) {
command.addArgument("/nobar");
}
if (linenumbers) {
command.addArgument("/linenum");
}
if (showSource) {
command.addArgument("/source");
}
if (quoteallnames) {
command.addArgument("/quoteallnames");
}
if (header) {
command.addArgument("/header");
}
if (!assembler) {
command.addArgument("/noil");
}
if (metadata) {
command.addArgument("/tokens");
}
command.addArgument("/item:", item);
if (rawExceptionHandling) {
command.addArgument("/raweh");
}
command.addArgument(EncodingTypes.getEncodingOption(encoding));
if (bytes) {
command.addArgument("/bytes");
}
command.addArgument("/vis:", visibility);

//add the source file
command.addArgument(sourceFile.getAbsolutePath());

//determine directory: resourceDir if set,
//the dir of the destFile if not
File execDir = resourceDir;
if (execDir == null) {
execDir = destFile.getParentFile();
}
command.setDirectory(execDir);

//now run
try {
command.runCommand();
} catch (BuildException e) {
//forcibly delete the output file in case of trouble
if (destFile.exists()) {
log("Deleting destination file as it may be corrupt");
destFile.delete();
}
//then rethrow the exception
throw e;
}

}

/**
* encoding options; the default is ascii
*/
public static class EncodingTypes extends EnumeratedAttribute {
/** Unicode */
public static final String UNICODE = "unicode";
/** UTF8 */
public static final String UTF8 = "utf8";
/** ASCII */
public static final String ASCII = "ascii";
/** {@inheritDoc}. */
public String[] getValues() {
return new String[]{
ASCII,
UTF8,
UNICODE,
};
}

/**
* This method maps from an encoding enum to an encoding option.
* @param enumValue the value to use.
* @return The encoding option indicated by the enum value.
*/
public static String getEncodingOption(String enumValue) {
if (UNICODE.equals(enumValue)) {
return "/unicode";
}
if (UTF8.equals(enumValue)) {
return "/utf8";
}
return null;
}
}

/**
* visibility options for decoding
*/
public static class VisibilityOptions extends EnumeratedAttribute {
/** {@inheritDoc}. */
public String[] getValues() {
return new String[]{
"pub", //Public
"pri", //Private
"fam", //Family
"asm", //Assembly
"faa", //Family and Assembly
"foa", //Family or Assembly
"psc", //Private Scope
};
}

}
}

+ 0
- 217
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/ImportTypelib.java View File

@@ -1,217 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.tools.ant.taskdefs.optional.dotnet;

import org.apache.tools.ant.Task;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.util.FileUtils;

import java.io.File;

/**
* Import a COM type library into the .NET framework.
* <p>
*
* This task is a wrapper to .NET's tlbimport; it imports a tlb file to a NET assembly
* by generating a binary assembly (.dll) that contains all the binding
* metadata. It uses date timestamps to minimise rebuilds.
* <p>
* Example
* <pre>
* &lt;importtypelib
* srcfile="xerces.tlb"
* destfile="xerces.dll"
* namespace="Apache.Xerces"/&gt;
* </pre>
* @since Ant 1.6
* @ant.task category="dotnet"
*/
public class ImportTypelib extends Task {

private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();

/**
* input file; precedes options
*/
private File srcFile;

/**
* /out:file
*/
private File destFile;

/**
* /namespace:[string]
*/
private String namespace;

/**
* /sysarray
*/
private boolean useSysArray = false;

/**
* /unsafe
*/
private boolean unsafe = false;

/**
* extra commands?
*/
private String extraOptions = null;

/**
* This method names the output file.
*
* This is an operation which is required to have been performed.
* @param destFile the output file.
*/
public void setDestFile(File destFile) {
this.destFile = destFile;
}

/**
* This method sets what namespace the typelib is to be in.
* This is an operation which is required to have been performed.
* @param namespace the namespace to use.
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}

/**
* This method sets which is the source .tlb file.
* This is an operation which is required to have been performed.
* @param srcFile the source file.
*/
public void setSrcFile(File srcFile) {
this.srcFile = srcFile;
}

/**
* do you want unsafe code.
* @param unsafe a <code>boolean</code> value.
*/
public void setUnsafe(boolean unsafe) {
this.unsafe = unsafe;
}

/**
* set this to map a COM SafeArray to the System.Array class
* @param useSysArray a <code>boolean</code> value.
*/
public void setUseSysArray(boolean useSysArray) {
this.useSysArray = useSysArray;
}

/**
* set any extra options that are not yet supported by this task.
* @param extraOptions the options to use.
*/
public void setExtraOptions(String extraOptions) {
this.extraOptions = extraOptions;
}

/**
* validation code
* @throws BuildException if validation failed
*/
protected void validate()
throws BuildException {
if (destFile == null) {
throw new BuildException("destination file must be specified");
}
if (destFile.isDirectory()) {
throw new BuildException(
"destination file is a directory");
}
if (srcFile == null || !srcFile.exists()) {
throw new BuildException(
"source file does not exist");
}
if (srcFile.isDirectory()) {
throw new BuildException(
"source file is a directory");
}
if (namespace == null) {
throw new BuildException("No namespace");
}
}

/**
* Test for disassembly being needed; use existence and granularity
* correct date stamps
* @return true iff a rebuild is required.
*/
private boolean isExecuteNeeded() {
if (!destFile.exists()) {
log("Destination file does not exist: a build is required",
Project.MSG_VERBOSE);
return true;
}
long sourceTime = srcFile.lastModified();
long destTime = destFile.lastModified();
if (sourceTime > (destTime + FILE_UTILS.getFileTimestampGranularity())) {
log("Source file is newer than the dest file: a rebuild is required",
Project.MSG_VERBOSE);
return true;
} else {
log("The output file is up to date", Project.MSG_VERBOSE);
return false;
}

}


/**
* Create a typelib command
* @exception BuildException if something goes wrong with the build
*/
public void execute() throws BuildException {
log("This task is deprecated and will be removed in a future version\n"
+ "of Ant. It is now part of the .NET Antlib:\n"
+ "http://ant.apache.org/antlibs/dotnet/index.html",
Project.MSG_WARN);
validate();
log("Importing typelib " + srcFile
+ " to assembly " + destFile
+ " in namespace " + namespace, Project.MSG_VERBOSE);
//rebuild unless the dest file is newer than the source file
if (!isExecuteNeeded()) {
return;
}

NetCommand command = new NetCommand(this, "ImportTypelib", "tlbimp");
command.setFailOnError(true);
command.addArgument(srcFile.toString());
//fill in args
command.addArgument("/nologo");
command.addArgument("/out:" + destFile);
command.addArgument("/namespace:", namespace);
if (useSysArray) {
command.addArgument("/sysarray");
}
if (unsafe) {
command.addArgument("/unsafe");
}
command.addArgument(extraOptions);
command.runCommand();
}
}

+ 0
- 141
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/JSharp.java View File

@@ -1,141 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.taskdefs.optional.dotnet;

import org.apache.tools.ant.BuildException;


/**
* Compile J# source down to a managed .NET application.
* <p>
* J# is not Java. But it is the language closest to Java in the .NET framework.
* This task compiles jsharp source (.java files), and
* generates a .NET managed exe or dll.
* <p>
*
* <p>For historical reasons the pattern
* <code>**</code><code>/*.java</code> is preset as includes list and
* you can not override it with an explicit includes attribute. Use
* nested <code>&lt;src&gt;</code> elements instead of the basedir
* attribute if you need more control.</p>
*
* @see <a ref=
* "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vjsharp/html/vjoriMicrosoftVisualJ.asp"
* >Visual J++ online documentation</a>
*
* @since ant1.6
* @ant.task category="dotnet" name="jsharpc"
*/
public class JSharp extends DotnetCompile {
// CheckStyle:VisibilityModifier OFF - bc
/**
* hex base address
*/
String baseAddress;

/** /x option to disable J++ and J# lang extensions
*
*/
boolean pureJava = true;

/**
* whether to make package scoped stuff public or assembly scoped
*/
boolean secureScoping = false;

// CheckStyle:VisibilityModifier ON

/** No arg constructor. */
public JSharp() {
setExecutable("vjc");
}


/**
* Set the base address attribute.
* @param baseAddress the value to use.
*/
public void setBaseAddress(String baseAddress) {
this.baseAddress = baseAddress;
}

/**
* do we want pure java (default, true) or corrupted J#?
* @param pureJava a <code>boolean</code> value.
*/
public void setPureJava(boolean pureJava) {
this.pureJava = pureJava;
}

/**
* Make package scoped code visible to the current assembly only (default: false)
* .NET does not have package scoping. Instead it has assembly, private and public.
* By default, package content is public to all.
* @param secureScoping a <code>boolean</code> value.
*/
public void setSecureScoping(boolean secureScoping) {
this.secureScoping = secureScoping;
}

/**
* Get the delimiter that the compiler uses between references.
* For example, c# will return ";"; VB.NET will return ","
* @return The string delimiter for the reference string.
*/
public String getReferenceDelimiter() {
return ";";
}

/**
* Get the extension of filenames to compile.
* @return The string extension of files to compile.
*/
public String getFileExtension() {
return ".java";
}

/**
* add jvc specific commands
* @param command the command to add to.
*/
protected void addCompilerSpecificOptions(NetCommand command) {
if (pureJava) {
command.addArgument("/x:all");
}
if (secureScoping) {
command.addArgument("/securescoping");
}
}

/** {@inheritDoc} */
protected void createResourceParameter(NetCommand command, DotnetResource resource) {
resource.getParameters(getProject(), command, true);
}

/**
* validation code
* @throws org.apache.tools.ant.BuildException if validation failed
*/
protected void validate()
throws BuildException {
super.validate();
if (getDestFile() == null) {
throw new BuildException("DestFile was not specified");
}
}
}

+ 0
- 404
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java View File

@@ -1,404 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
* build notes
* The reference CD to listen to while editing this file is
* Underworld Everything, Everything
* variable naming policy from Fowler's refactoring book.
*/
// place below the optional ant tasks package

package org.apache.tools.ant.taskdefs.optional.dotnet;

// imports

import java.io.File;
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.BufferedOutputStream;
import java.util.Hashtable;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
import org.apache.tools.ant.taskdefs.LogStreamHandler;
import org.apache.tools.ant.types.Commandline;

/**
* This is a helper class to spawn net commands out. In its initial form it
* contains no .net specifics, just contains all the command line/exe
* construction stuff. However, it may be handy in future to have a means of
* setting the path to point to the dotnet bin directory; in which case the
* shared code should go in here.
*
*@version 0.5
*/

public class NetCommand {
private static final int DEFAULT_RESPONSE_THRESHOLD = 64;
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
// CheckStyle:VisibilityModifier OFF - bc

/**
* owner project
*/
protected Task owner;

/**
* executable
*/
protected Execute executable;

/**
* what is the command line
*/
protected Commandline commandLine;

/**
* title of the command
*/
protected String title;

/**
* actual program to invoke
*/
protected String program;

/**
* trace flag
*/
protected boolean traceCommandLine = false;

/**
* flag to control action on execution trouble
*/
protected boolean failOnError;

// CheckStyle:VisibilityModifier ON

/**
* the directory to execute the command in. When null, the current
* directory is used.
*/
private File directory;

/**
* flag to set to to use @file based command cache
*/
private boolean useResponseFile = false;

/**
* name of a temp file; may be null
*/
private File temporaryCommandFile;

/**
* internal threshold for auto-switch
*/
private int automaticResponseFileThreshold = DEFAULT_RESPONSE_THRESHOLD;

/**
* constructor
*
*@param title (for logging/errors)
*@param owner owner task
*@param program app we are to run
*/

public NetCommand(Task owner, String title, String program) {
this.owner = owner;
this.title = title;
this.program = program;
commandLine = new Commandline();
commandLine.setExecutable(program);
}


/**
* turn tracing on or off
*
*@param b trace flag
*/
public void setTraceCommandLine(boolean b) {
traceCommandLine = b;
}


/**
* set fail on error flag
*
*@param b fail flag -set to true to cause an exception to be raised if
* the return value != 0
*/
public void setFailOnError(boolean b) {
failOnError = b;
}


/**
* query fail on error flag
*
*@return The failFailOnError value
*/
public boolean getFailFailOnError() {
return failOnError;
}


/**
* set the directory to run from, if the default is inadequate
* @param directory the directory to use.
*/
public void setDirectory(File directory) {
this.directory = directory;
}

/**
* verbose text log
*
*@param msg string to add to log if verbose is defined for the build
*/
protected void logVerbose(String msg) {
owner.getProject().log(msg, Project.MSG_VERBOSE);
}


/**
* error text log
*
*@param msg message to display as an error
*/
protected void logError(String msg) {
owner.getProject().log(msg, Project.MSG_ERR);
}


/**
* add an argument to a command line; do nothing if the arg is null or
* empty string
*
*@param argument The feature to be added to the Argument attribute
*/
public void addArgument(String argument) {
if (argument != null && argument.length() != 0) {
commandLine.createArgument().setValue(argument);
}
}

/**
* add an argument to a command line; do nothing if the arg is null or
* empty string
*
*@param arguments The features to be added to the Argument attribute
*/
public void addArguments(String[] arguments) {
if (arguments != null && arguments.length != 0) {
for (int i = 0; i < arguments.length; i++) {
addArgument(arguments[i]);
}
}
}

/**
* concatenate two strings together and add them as a single argument,
* but only if argument2 is non-null and non-zero length
*
*@param argument1 The first argument
*@param argument2 The second argument
*/
public void addArgument(String argument1, String argument2) {
if (argument2 != null && argument2.length() != 0) {
commandLine.createArgument().setValue(argument1 + argument2);
}
}

/**
* getter
* @return response file state
*/
public boolean isUseResponseFile() {
return useResponseFile;
}

/**
* set this to true to always use the response file
* @param useResponseFile a <code>boolean</code> value.
*/
public void setUseResponseFile(boolean useResponseFile) {
this.useResponseFile = useResponseFile;
}

/**
* getter for threshold
* @return 0 for disabled, or a threshold for enabling response files
*/
public int getAutomaticResponseFileThreshold() {
return automaticResponseFileThreshold;
}

/**
* set threshold for automatically using response files -use 0 for off
* @param automaticResponseFileThreshold the threshold value to use.
*/
public void setAutomaticResponseFileThreshold(int automaticResponseFileThreshold) {
this.automaticResponseFileThreshold = automaticResponseFileThreshold;
}

/**
* set up the command sequence..
*/
protected void prepareExecutor() {
// default directory to the project's base directory
if (owner == null) {
throw new RuntimeException("no owner");
}
if (owner.getProject() == null) {
throw new RuntimeException("Owner has no project");
}
File dir = owner.getProject().getBaseDir();
if (directory != null) {
dir = directory;
}

ExecuteStreamHandler handler = new LogStreamHandler(owner,
Project.MSG_INFO, Project.MSG_WARN);
executable = new Execute(handler, null);
executable.setAntRun(owner.getProject());
executable.setWorkingDirectory(dir);
}


/**
* Run the command using the given Execute instance.
*
*@exception BuildException if something goes wrong and the
* failOnError flag is true
*/
public void runCommand()
throws BuildException {
prepareExecutor();
int err = -1;
// assume the worst
try {
if (traceCommandLine) {
owner.log("In directory " + executable.getWorkingDirectory());
owner.log(commandLine.describeCommand());
} else {
//in verbose mode we always log stuff
logVerbose("In directory " + executable.getWorkingDirectory());
logVerbose(commandLine.describeCommand());
}
setExecutableCommandLine();
err = executable.execute();
if (Execute.isFailure(err)) {
if (failOnError) {
throw new BuildException(title + " returned: " + err, owner.getLocation());
} else {
owner.log(title + " Result: " + err, Project.MSG_ERR);
}
}
} catch (IOException e) {
throw new BuildException(title + " failed: " + e, e, owner.getLocation());
} finally {
if (temporaryCommandFile != null) {
temporaryCommandFile.delete();
}
}
}

/**
* set the executable command line
*/
private void setExecutableCommandLine() {

String[] commands = commandLine.getCommandline();
//always trigger file mode if commands are big enough
if (automaticResponseFileThreshold > 0
&& commands.length > automaticResponseFileThreshold) {
useResponseFile = true;
}
if (!useResponseFile || commands.length <= 1) {
//the simple action is to send the command line in as is
executable.setCommandline(commands);
} else {
//but for big operations, we save all the params to a temp file
//and set @tmpfile as the command -then we remember to delete the tempfile
//afterwards
FileOutputStream fos = null;

temporaryCommandFile = FILE_UTILS.createTempFile("cmd", ".txt", null, false, true);
owner.log("Using response file " + temporaryCommandFile, Project.MSG_VERBOSE);

try {
fos = new FileOutputStream(temporaryCommandFile);
PrintWriter out = new PrintWriter(new BufferedOutputStream(fos));
//start at 1 because element 0 is the executable name
for (int i = 1; i < commands.length; ++i) {
out.println(commands[i]);
}
out.flush();
out.close();
} catch (IOException ex) {
throw new BuildException("saving command stream to " + temporaryCommandFile, ex);
}

String[] newCommandLine = new String[2];
newCommandLine[0] = commands[0];
newCommandLine[1] = "@" + temporaryCommandFile.getAbsolutePath();
logVerbose(Commandline.describeCommand(newCommandLine));
executable.setCommandline(newCommandLine);
}
}


/**
* scan through one fileset for files to include
* @param scanner the directory scanner to use.
* @param filesToBuild the map to place the files.
* @param outputTimestamp timestamp to compare against
* @return #of files out of date
* @todo should FAT granularity be included here?
*/
public int scanOneFileset(DirectoryScanner scanner, Hashtable filesToBuild,
long outputTimestamp) {
int filesOutOfDate = 0;
String[] dependencies = scanner.getIncludedFiles();
File base = scanner.getBasedir();
//add to the list
for (int i = 0; i < dependencies.length; i++) {
File targetFile = new File(base, dependencies[i]);
if (filesToBuild.get(targetFile) == null) {
filesToBuild.put(targetFile, targetFile);
if (targetFile.lastModified() > outputTimestamp) {
filesOutOfDate++;
owner.log(targetFile.toString() + " is out of date",
Project.MSG_VERBOSE);
} else {
owner.log(targetFile.toString(),
Project.MSG_VERBOSE);
}
}
}
return filesOutOfDate;
}
}

+ 0
- 366
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/VisualBasicCompile.java View File

@@ -1,366 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.tools.ant.taskdefs.optional.dotnet;

import org.apache.tools.ant.BuildException;


/**
* This task compiles Visual Basic.NET source into executables or modules.
* The task requires vbc.exe on the execute path, unless it or an equivalent
* program is specified in the <tt>executable</tt> parameter
*
* <p>
* All parameters are optional: &lt;vbc/&gt; should suffice to produce a debug
* build of all *.vb files.
*
* <p>

* The task is a directory based task, so attributes like
* <tt>includes=&quot;**\/*.vb&quot;</tt> and
* <tt>excludes=&quot;broken.vb&quot;</tt> can be used to control
* the files pulled in. By default,
* all *.vb files from the project folder down are included in the command.
* When this happens the destFile -if not specified-
* is taken as the first file in the list, which may be somewhat hard to control.
Specifying the output file with <tt>destfile</tt> is prudent.
</p>
<p>
* Also, dependency checking only works if destfile is set.
*
* <p>For historical reasons the pattern
* <code>**</code><code>/*.vb</code> is preset as includes list and
* you can not override it with an explicit includes attribute. Use
* nested <code>&lt;src&gt;</code> elements instead of the basedir
* attribute if you need more control.</p>
*
* As with &lt;csc&gt; nested <tt>src</tt> filesets of source,
* reference filesets, definitions and resources can be provided.
*
* <p>
* Example
* </p>
* <pre>&lt;vbc
* optimize=&quot;true&quot;
* debug=&quot;false&quot;
* warnLevel=&quot;4&quot;
* targetType=&quot;exe&quot;
* definitions=&quot;RELEASE&quot;
* excludes=&quot;src/unicode_class.vb&quot;
* mainClass = &quot;MainApp&quot;
* destFile=&quot;NetApp.exe&quot;
* optionExplicit=&quot;true&quot;
* optionCompare=&quot;text&quot;
* references="System.Xml,System.Web.Xml"
* &gt;
* &lt;reference file="${testCSC.dll}" /&gt;
* &lt;define name="RELEASE" /&gt;
* &lt;define name="DEBUG" if="debug.property"/&gt;
* &lt;define name="def3" unless="def2.property"/&gt;
* &lt;/vbc&gt;
</pre>
* @ant.task name="vbc" category="dotnet"
*/

public class VisualBasicCompile extends DotnetCompile {

/**
* Compiler option to remove integer checks. Default: false.
*/
private boolean removeIntChecks = false;

/**
* Require explicit declaration of variables? Default: false.
*/
private boolean optionExplicit = false;

/**
* Enforce strict language semantics? Default: false.
*/
private boolean optionStrict = false;

/**
* Whether to compare strings as "text" or "binary". Default: "binary".
*/
private String optionCompare;

/**
* Root namespace for all type declarations.
*/
private String rootNamespace;

/**
* Declare global imports fornamespaces in referenced metadata files.
*/
private String imports;

/**
* Constructor for VisualBasicCompile.
*/
public VisualBasicCompile() {
clear();
}

/**
* reset all contents.
*/
public void clear() {
super.clear();
imports = null;
rootNamespace = null;
optionCompare = null;
optionExplicit = false;
optionStrict = false;
removeIntChecks = false;
setExecutable("vbc");
}

/**
* get the argument or null for no argument needed
* This is overridden from DotnetCompile.java because VBC uses
* "/win32resource:" rather than "/win32res:"
*
*@return The Win32Res Parameter to CSC
*/
protected String getWin32ResParameter() {
if (getWin32Res() != null) {
return "/win32resource:" + getWin32Res().toString();
} else {
return null;
}
}

/**
* Whether to remove integer checks. Default false.
* @param flag on/off flag
*/
public void setRemoveIntChecks(boolean flag) {
removeIntChecks = flag;
}

/**
* Get the flag for removing integer checks.
* @return true if flag is turned on
*/
public boolean getRemoveIntChecks() {
return removeIntChecks;
}

/**
* Form the option string for removeIntChecks.
* @return The parameter string.
*/
public String getRemoveIntChecksParameter() {
return "/removeintchecks" + (removeIntChecks ? "+" : "-");
}

/**
* Whether to require explicit declaration of variables.
* @param flag on/off flag
*/
public void setOptionExplicit(boolean flag) {
optionExplicit = flag;
}

/**
* Get the flag for whether to require explicit declaration of variables.
*@return true if flag is turned on
*/
public boolean getOptionExplicit() {
return optionExplicit;
}

/**
* Form the option string for optionExplicit..
* @return The parameter string.
*/
public String getOptionExplicitParameter() {
return "/optionexplicit" + (optionExplicit ? "+" : "-");
}

/**
* Enforce strict language semantics.
* @param flag on/off flag
*/
public void setOptionStrict(boolean flag) {
optionStrict = flag;
}

/**
* Get the flag for whether to enforce strict language semantics.
* @return true if flag is turned on
*/
public boolean getOptionStrict() {
return optionStrict;
}

/**
* For the option string for optionStrict.
* @return The parameter string.
*/
public String getOptionStrictParameter() {
return "/optionstrict" + (optionStrict ? "+" : "-");
}


/**
* Specifies the root namespace for all type declarations.
* @param rootNamespace a root namespace.
*/
public void setRootNamespace(String rootNamespace) {
this.rootNamespace = rootNamespace;
}


/**
* Get the root namespace.
* @return the root namespace.
*/
public String getRootNamespace() {
return this.rootNamespace;
}


/**
* Form the option string for rootNamespace.
* @return the root namespace option string.
*/
protected String getRootNamespaceParameter() {
if (rootNamespace != null && rootNamespace.length() != 0) {
return "/rootnamespace:" + rootNamespace;
} else {
return null;
}
}


/**
* Declare global imports for namespaces in referenced metadata files.
* @param imports the imports string
*/
public void setImports(String imports) {
this.imports = imports;
}


/**
* Get global imports for namespaces in referenced metadata files.
* @return the imports string.
*/
public String getImports() {
return this.imports;
}


/**
* Format the option for imports.
* @return the formatted import option.
*/
protected String getImportsParameter() {
if (imports != null && imports.length() != 0) {
return "/imports:" + imports;
} else {
return null;
}
}


/**
* Specify binary- or text-style string comparisons. Defaults
* to "binary"
* @param optionCompare the option compare style. "text" | "binary".
*/
public void setOptionCompare(String optionCompare) {
if ("text".equalsIgnoreCase(optionCompare)) {
this.optionCompare = "text";
} else {
this.optionCompare = "binary";
}
}


/**
* "binary" or "text" for the string-comparison style.
* @return the option compare style.
*/
public String getOptionCompare() {
return this.optionCompare;
}

/**
* Format the option for string comparison style.
* @return The formatted option.
*/
protected String getOptionCompareParameter() {
if (optionCompare != null && "text".equalsIgnoreCase(optionCompare)) {
return "/optioncompare:text";
} else {
return "/optioncompare:binary";
}
}

/**
* implement VBC commands
* @param command the command to set arguements on.
*/
protected void addCompilerSpecificOptions(NetCommand command) {
command.addArgument(getRemoveIntChecksParameter());
command.addArgument(getImportsParameter());
command.addArgument(getOptionExplicitParameter());
command.addArgument(getOptionStrictParameter());
command.addArgument(getRootNamespaceParameter());
command.addArgument(getOptionCompareParameter());
}

/**
* Get the delimiter that the compiler uses between references.
* For example, c# will return ";"; VB.NET will return ","
* @return The string delimiter for the reference string.
*/
public String getReferenceDelimiter() {
return ",";
}



/**
* Get the extension of filenames to compile.
* @return The string extension of files to compile.
*/
public String getFileExtension() {
return "vb";
}

/** {@inheritDoc} */
protected void createResourceParameter(NetCommand command, DotnetResource resource) {
resource.getParameters(getProject(), command, false);
}

/**
* validation code
* @throws BuildException if validation failed
*/
protected void validate()
throws BuildException {
super.validate();
if (getDestFile() == null) {
throw new BuildException("DestFile was not specified");
}
}
}

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

@@ -1,595 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.taskdefs.optional.dotnet;

import java.io.File;
import java.util.Vector;
import java.util.Iterator;
import java.net.MalformedURLException;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.EnumeratedAttribute;
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.
*
* Why add a wrapper to the MS WSDL tool?
* So that you can verify that your web services, be they written with Axis or
*anyone else's SOAP toolkit, work with .NET clients.
*
*This task is dependency aware when using a file as a source and destination;
*so if you &lt;get&gt; the file (with <code>usetimestamp="true"</code>) then
*you only rebuild stuff when the WSDL file is changed. Of course,
*if the server generates a new timestamp every time you ask for the WSDL,
*this is not enough...use the &lt;filesmatch&gt; &lt;condition&gt; to
*to byte for byte comparison against a cached WSDL file then make
*the target conditional on that test failing.

* See "Creating an XML Web Service Proxy", "wsdl.exe" docs in
* the framework SDK documentation
* @version 0.5
* @ant.task category="dotnet"
* @since Ant 1.5
*/

public class WsdlToDotnet extends Task {

/**
* used for timestamp checking
*/
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();

/**
* name of output file (required)
*/
private File destFile = null;

/**
* language; defaults to C#
*/
private String language = "CS";

/**
* flag set to true to generate server side skeleton
*/
private boolean server = false;

/**
* namespace
*/
private String namespace = null;

/**
* flag to control action on execution trouble
*/
private boolean failOnError = true;

// CheckStyle:VisibilityModifier OFF - bc
/**
* any extra command options?
*/
protected String extraOptions = null;

// CheckStyle:VisibilityModifier ON


/**
* protocol string. Exact value set depends on SOAP stack version.
* @since Ant 1.7
*/
private String protocol = null;

/**
* should errors come in an IDE format. This
* is WSE only.
* @since Ant 1.7
*/
private boolean ideErrors = false;

/**
* filesets of file to compile
* @since Ant 1.7
*/
private Vector schemas = new Vector();

/**
* our WSDL file.
* @since ant1.7
*/
private Schema wsdl = new Schema();

/**
* compiler
* @since ant1.7
*/
private Compiler compiler = null;

/**
* error message: dest file is a directory
*/
public static final String ERROR_DEST_FILE_IS_DIR = "destination file is a directory";

/**
* error message: no dest file
*/
public static final String ERROR_NO_DEST_FILE = "destination file must be specified";

/**
* 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) {
wsdl.setUrl(url);
}

/**
* The local WSDL file to parse; either url or srcFile is required.
* @param srcFile WSDL file
*/
public void setSrcFile(File srcFile) {
wsdl.setFile(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;
}

/**
* Whether or not a failure should halt the build.
* Optional - default is <code>true</code>.
* @param failOnError new failure option
*/
public void setFailOnError(boolean failOnError) {
this.failOnError = failOnError;
}

/**
* Any extra WSDL.EXE options which aren't explicitly
* supported by the ant wrapper task; optional
*
*@param extraOptions The new ExtraOptions value
*/
public void setExtraOptions(String extraOptions) {
this.extraOptions = extraOptions;
}

/**
* Defines wether errors are machine parseable.
* Optional, default=true
*
* @since Ant 1.7
* @param ideErrors a <code>boolean</code> value.
*/
public void setIdeErrors(boolean ideErrors) {
this.ideErrors = ideErrors;
}

/**
* what protocol to use. SOAP, SOAP1.2, HttpPost and HttpGet
* are the base options. Different version and implementations may.
* offer different options.
* @since Ant 1.7
*
* @param protocol the protocol to use.
*/
public void setProtocol(String protocol) {
this.protocol = protocol;
}

/**
* add a new source schema to the compilation
* @since Ant 1.7
*
* @param source a nested schema element.
*/
public void addSchema(Schema source) {
schemas.add(source);
}

/**
* flag to trigger turning a filename into a file:url
* ignored for the mono compiler.
* @param b a <code>boolean</code> value.
*/
public void setMakeURL(boolean b) {
wsdl.setMakeURL(b);
}

/**
* identify the compiler
* @since Ant 1.7
* @param compiler the enumerated value.
*/
public void setCompiler(Compiler compiler) {
this.compiler = compiler;
}

/**
* validation code
* @throws BuildException if validation failed
*/
protected void validate()
throws BuildException {
if (destFile == null) {
throw new BuildException(ERROR_NO_DEST_FILE);
}
if (destFile.isDirectory()) {
throw new BuildException(
ERROR_DEST_FILE_IS_DIR);
}
wsdl.validate();
}

/**
* do the work by building the command line and then calling it
*
*@throws BuildException if validation or execution failed
*/
public void execute()
throws BuildException {
log("This task is deprecated and will be removed in a future version\n"
+ "of Ant. It is now part of the .NET Antlib:\n"
+ "http://ant.apache.org/antlibs/dotnet/index.html",
Project.MSG_WARN);

if (compiler == null) {
compiler = Compiler.createDefaultCompiler();
}
validate();
NetCommand command = new NetCommand(this,
"WSDL",
compiler.getCommand());
command.setFailOnError(failOnError);
//fill in args
compiler.applyExtraArgs(command);
command.addArgument("/nologo");
command.addArgument("/out:" + destFile);
command.addArgument("/language:", language);
if (server) {
command.addArgument("/server");
}
command.addArgument("/namespace:", namespace);
if (protocol != null) {
command.addArgument("/protocol:" + protocol);
}
if (ideErrors) {
command.addArgument("/parsableErrors");
}
command.addArgument(extraOptions);

//set source and rebuild options
boolean rebuild = true;
long destLastModified = -1;

//rebuild unless the dest file is newer than the source file
if (destFile.exists()) {
destLastModified = destFile.lastModified();
rebuild = isRebuildNeeded(wsdl, destLastModified);
}
String path;
//mark for a rebuild if the dest file is newer
path = wsdl.evaluate();
if (!compiler.supportsAbsoluteFiles() && wsdl.getFile() != null) {
// Mono 1.0's wsdl doesn't deal with absolute paths
File f = wsdl.getFile();
command.setDirectory(f.getParentFile());
path = f.getName();
}
command.addArgument(path);
//add in any extra files.
//this is an error in mono, but we do not warn on it as they may fix that outside
//the ant build cycle.
Iterator it = schemas.iterator();
while (it.hasNext()) {
Schema schema = (Schema) it.next();
//mark for a rebuild if we are newer
rebuild |= isRebuildNeeded(schema, destLastModified);
command.addArgument(schema.evaluate());
}
//conditionally compile
if (rebuild) {
command.runCommand();
}
}

/**
* checks for a schema being out of data
* @param schema url/file
* @param destLastModified timestamp, -1 for no dest
* @return true if a rebuild is needed.
*/
private boolean isRebuildNeeded(Schema schema, long destLastModified) {
if (destLastModified == -1) {
return true;
}
return !FILE_UTILS.isUpToDate(schema.getTimestamp(), destLastModified);
}


/**
* nested schema class
* Only supported on NET until mono add multi-URL handling on the command line
*/
public static class Schema {
private File file;
private String url;
private boolean makeURL = false;

// Errors
/** One of file or url must be set */
public static final String ERROR_NONE_DECLARED = "One of file and url must be set";
/** Only one of file or url */
public static final String ERROR_BOTH_DECLARED = "Only one of file or url can be set";
/** Not found */
public static final String ERROR_FILE_NOT_FOUND = "Not found: ";
/** File is a directory */
public static final String ERROR_FILE_IS_DIR = "File is a directory: ";
/** Could not URL convert */
public static final String ERROR_NO_URL_CONVERT = "Could not URL convert ";

/**
* validate the schema
*/
public void validate() {

if (file != null) {
if (!file.exists()) {
throw new BuildException(ERROR_FILE_NOT_FOUND + file.toString());
}
if (file.isDirectory()) {
throw new BuildException(ERROR_FILE_IS_DIR + file.toString());
}
}
if (file != null && url != null) {
throw new BuildException(ERROR_BOTH_DECLARED);
}
if (file == null && url == null) {
throw new BuildException(ERROR_NONE_DECLARED);
}
}

/**
* Validate our settings.
* @return either the URL or the full file path
*/
public String evaluate() {
validate();
if (url != null) {
return getUrl();
}
if (makeURL) {
try {
return FILE_UTILS.getFileURL(file).toExternalForm();
} catch (MalformedURLException e) {
throw new BuildException(ERROR_NO_URL_CONVERT + file);
}
}
return file.toString();
}

/**
* Get the file.
* @return the file used.
*/
public File getFile() {
return file;
}

/**
* name of a file to use as a source of WSDL or XSD data
* @param file the file to use.
*/
public void setFile(File file) {
this.file = file;
}

/**
* Get the url.
* @return the URL of the resource.
*/
public String getUrl() {
return url;
}

/**
* url of a resource.
* URLs have no timestamp checking, and are not validated
* @param url the URL string to use.
*/
public void setUrl(String url) {
this.url = url;
}

/**
* Get the makeURL attribute.
* @return the attribute.
*/
public boolean isMakeURL() {
return makeURL;
}

/**
* flag to request that a file is turned into an absolute file: URL
* before being passed to the WSDL compiler
* @param makeURL a <code>boolean</code> value.
*/
public void setMakeURL(boolean makeURL) {
this.makeURL = makeURL;
}

/**
* Gets the file timestamp.
* @return the timestamp of a file, or -1 for a URL (meaning we do not know its age)
*/
public long getTimestamp() {
if (file != null) {
return file.lastModified();
} else {
return -1;
}
}
}

/**
* The enumerated values for our compiler
*/
public static class Compiler extends EnumeratedAttribute {

/** microsoft */
public static final String COMPILER_MS = "microsoft";
/** mono */
public static final String COMPILER_MONO = "mono";
/** microsoft-on-mono */
public static final String COMPILER_MS_ON_MONO = "microsoft-on-mono";
// CheckStyle:VisibilityModifier OFF - bc
/** the index to string mappings */
String[] compilers = {
COMPILER_MS,
COMPILER_MONO,
COMPILER_MS_ON_MONO
};

/** WSDL */
public static final String EXE_WSDL = "wsdl";
/** MONO */
public static final String EXE_MONO = "mono";
/**
* programs to run
*/
String[] compilerExecutables = {
EXE_WSDL,
EXE_WSDL,
EXE_MONO
};


/**
* extra things
*/
String[][] extraCompilerArgs = {
{},
{},
{EXE_WSDL + ".exe"}
};

boolean[] absoluteFiles = {
true,
false,
true
};

// CheckStyle:VisibilityModifier ON
/**
* This is the only method a subclass needs to implement.
*
* @return an array holding all possible values of the enumeration.
* The order of elements must be fixed so that <tt>indexOfValue(String)</tt>
* always return the same index for the same value.
*/
public String[] getValues() {
return compilers;
}

/**
* Create the default compiler for this platform.
* @return the default compiler
*/
public static Compiler createDefaultCompiler() {
Compiler c = new Compiler();
String compilerName;
compilerName = Os.isFamily("windows") ? COMPILER_MS : COMPILER_MONO;
c.setValue(compilerName);
return c;
}

/**
* return the command to run
* @return the command
*/
public String getCommand() {
return compilerExecutables[getIndex()];
}

/**
* return any extra arguments for the compiler
* @return extra compiler arguments
*/
public String[] getExtraArgs() {
return extraCompilerArgs[getIndex()];
}

/**
* Get where the current value supports absolute files.
* @return true if the compiler does supports absolute files.
*/
public boolean supportsAbsoluteFiles() {
return absoluteFiles[getIndex()];
}

/**
* apply any extra arguments of this class
* @param command the command to apply the arguments to.
*/
public void applyExtraArgs(NetCommand command) {
String[] args = getExtraArgs();
for (int i = 0; i < args.length; i++) {
command.addArgument(args[i]);
}
}

}

}

+ 0
- 136
src/tests/junit/org/apache/tools/ant/taskdefs/optional/DotnetTest.java View File

@@ -1,136 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.taskdefs.optional;

import org.apache.tools.ant.BuildFileTest;

/**
* Tests the Dotnet tasks, based off WsdlToDotnetTest
*
* @since Ant 1.6
*/
public class DotnetTest extends BuildFileTest {

/**
* Description of the Field
*/
private final static String TASKDEFS_DIR = "src/etc/testcases/taskdefs/optional/";


/**
* Constructor
*
* @param name testname
*/
public DotnetTest(String name) {
super(name);
}


/**
* The JUnit setup method
*/
public void setUp() {
configureProject(TASKDEFS_DIR + "dotnet.xml");
}


/**
* The teardown method for JUnit
*/
public void tearDown() {
executeTarget("teardown");
}


/**
* A unit test for JUnit
*/
public void testCSC() throws Exception {
executeTarget("testCSC");
}


/**
* A unit test for JUnit
*/
public void testCSCintrinsicFileset() throws Exception {
executeTarget("testCSCintrinsicFileset");
}


/**
* A unit test for JUnit
*/
public void testCSCdll() throws Exception {
executeTarget("testCSCdll");
}

/**
* A unit test for JUnit
*/
public void testCscReferences() throws Exception {
executeTarget("testCscReferences");
}

/**
* A unit test for JUnit
*/
public void testCscResources() throws Exception {
executeTarget("testCSCResources");
}

/**
* test we can assemble
*/
public void testILASM() throws Exception {
executeTarget("testILASM");
}

/**
* test we can disassemble
*/
public void testILDASM() throws Exception {
executeTarget("testILDASM");
}

/**
* test we can disassemble
*/
public void testILDASM_empty() throws Exception {
expectBuildExceptionContaining("testILDASM_empty",
"parameter validation",
"invalid");
}

/**
* test we can handle jsharp (if found)
*/
public void testJsharp() throws Exception {
executeTarget("jsharp");
}

/**
* test we can handle jsharp (if found)
*/
public void testResponseFile() throws Exception {
executeTarget("testCSCresponseFile");
}

}


+ 0
- 201
src/tests/junit/org/apache/tools/ant/taskdefs/optional/WsdlToDotnetTest.java View File

@@ -1,201 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.tools.ant.taskdefs.optional;

import org.apache.tools.ant.BuildFileTest;
import org.apache.tools.ant.taskdefs.optional.dotnet.WsdlToDotnet;

/**
* Tests the WsdlToDotnet task.
*
* @since Ant 1.5
*/
public class WsdlToDotnetTest extends BuildFileTest {

/**
* dir for taskdefs
*/
private final static String TASKDEFS_DIR = "src/etc/testcases/taskdefs/optional/";

/**
* message from exec
*/
private static final String WSDL_FAILED = "WSDL returned:";


/**
* Constructor
*
* @param name testname
*/
public WsdlToDotnetTest(String name) {
super(name);
}


/**
* The JUnit setup method
*/
public void setUp() {
configureProject(TASKDEFS_DIR + "WsdlToDotnet.xml");
}


/**
* The teardown method for JUnit
*/
public void tearDown() {
executeTarget("teardown");
}



/**
* A unit test for JUnit
*/
public void testNoParams() throws Exception {
expectBuildExceptionContaining("testNoParams",
"expected failure",
WsdlToDotnet.ERROR_NO_DEST_FILE);
}

/**
* A unit test for JUnit
*/
public void testNoSrc() throws Exception {
expectBuildExceptionContaining("testNoSrc",
"expected failure",
WsdlToDotnet.Schema.ERROR_NONE_DECLARED);
}

/**
* A unit test for JUnit
*/
public void testDestIsDir() throws Exception {
expectBuildExceptionContaining("testDestIsDir",
"expected failure",
WsdlToDotnet.ERROR_DEST_FILE_IS_DIR);
}

/**
* A unit test for JUnit
*/
public void testBothSrc() throws Exception {
expectBuildExceptionContaining("testBothSrc",
"expected failure",
WsdlToDotnet.Schema.ERROR_BOTH_DECLARED);
}
/**
* A unit test for JUnit
*/
public void testSrcIsDir() throws Exception {
expectBuildExceptionContaining("testSrcIsDir",
"expected failure",
WsdlToDotnet.Schema.ERROR_FILE_IS_DIR);
}

/**
* A unit test for JUnit
*/
public void testSrcIsMissing() throws Exception {
expectBuildExceptionContaining("testSrcIsMissing",
"expected failure",
WsdlToDotnet.Schema.ERROR_FILE_NOT_FOUND);
}

/**
* A unit test for JUnit
*/
public void testLocalWsdl() throws Exception {
executeTarget("testLocalWsdl");
}
/**
* A unit test for JUnit
*/
public void testLocalWsdlServer() throws Exception {
executeTarget("testLocalWsdlServer");
}
/**
* A unit test for JUnit
*/
public void testInvalidExtraOps() throws Exception {
expectBuildExceptionContaining("testInvalidExtraOps",
"expected failure",
WSDL_FAILED);
}

/**
* A unit test for JUnit
*/
public void testLocalWsdlVB() throws Exception {
executeTarget("testLocalWsdlVB");
}
/**
* A unit test for JUnit
*/
public void testLocalWsdlServerVB() throws Exception {
executeTarget("testLocalWsdlServerVB");
}
/**
* A unit test for JUnit
*/
public void testInvalidExtraOpsVB() throws Exception {
expectBuildExceptionContaining("testInvalidExtraOpsVB",
"expected failure",
WSDL_FAILED);
}

/**
* as if parseable errors were not ignored, mono and WSE1.0 would
* crash and burn. So here we verify the property exists,
* and that it is not passed to the app when false
*/
public void testParseableErrorsIgnoredWhenFalse() throws Exception {
executeTarget("testLocalWsdl");
}

/**
* A unit test for JUnit
*/
public void testSchemaFileMustExist() throws Exception {
expectBuildExceptionContaining("testSchemaFileMustExist",
"expected failure",
WsdlToDotnet.Schema.ERROR_FILE_NOT_FOUND);
}

/**
* A unit test for JUnit
*/
public void testSchemaFileMustHaveOneOptionOnly() throws Exception {
expectBuildExceptionContaining("testSchemaFileMustHaveOneOptionOnly",
"expected failure",
WsdlToDotnet.Schema.ERROR_BOTH_DECLARED);
}

/**
* A unit test for JUnit
*/
public void testSchemaMustBeSet() throws Exception {
expectBuildExceptionContaining("testSchemaMustBeSet",
"expected failure",
WsdlToDotnet.Schema.ERROR_NONE_DECLARED);
}


}


Loading…
Cancel
Save