ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r936234 - in /ant/antlibs/dotnet/trunk: changes.xml docs/fsc.html docs/index.html src/main/org/apache/ant/dotnet/antlib.xml src/main/org/apache/ant/dotnet/compile/FSharp.java src/tests/antunit/fsc-test.xml src/tests/antunit/src/example.fs
Date Wed, 21 Apr 2010 09:56:57 GMT
Author: bodewig
Date: Wed Apr 21 09:56:56 2010
New Revision: 936234

URL: http://svn.apache.org/viewvc?rev=936234&view=rev
Log:
first cut at a F# compiler task

Added:
    ant/antlibs/dotnet/trunk/docs/fsc.html
      - copied, changed from r936202, ant/antlibs/dotnet/trunk/docs/vbc.html
    ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/compile/FSharp.java
      - copied, changed from r936202, ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/compile/VisualBasicCompile.java
    ant/antlibs/dotnet/trunk/src/tests/antunit/fsc-test.xml
    ant/antlibs/dotnet/trunk/src/tests/antunit/src/example.fs   (with props)
Modified:
    ant/antlibs/dotnet/trunk/changes.xml
    ant/antlibs/dotnet/trunk/docs/index.html
    ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/antlib.xml

Modified: ant/antlibs/dotnet/trunk/changes.xml
URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/changes.xml?rev=936234&r1=936233&r2=936234&view=diff
==============================================================================
--- ant/antlibs/dotnet/trunk/changes.xml (original)
+++ ant/antlibs/dotnet/trunk/changes.xml Wed Apr 21 09:56:56 2010
@@ -38,6 +38,9 @@
     </properties>
 
     <release version="SVN trunk" date="unpublished">
+      <action type="add">
+        A new F# compiler task has been added.
+      </action>
       <action type="add" issue="47078">
         A new tallow task has been added to ease creation of WiX built
         installers.

Copied: ant/antlibs/dotnet/trunk/docs/fsc.html (from r936202, ant/antlibs/dotnet/trunk/docs/vbc.html)
URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/docs/fsc.html?p2=ant/antlibs/dotnet/trunk/docs/fsc.html&p1=ant/antlibs/dotnet/trunk/docs/vbc.html&r1=936202&r2=936234&rev=936234&view=diff
==============================================================================
--- ant/antlibs/dotnet/trunk/docs/vbc.html (original)
+++ ant/antlibs/dotnet/trunk/docs/fsc.html Wed Apr 21 09:56:56 2010
@@ -20,27 +20,27 @@
   <head>
     <meta http-equiv="Content-Language" content="en-us"></meta>
     <link rel="stylesheet" type="text/css" href="style.css">
-    <title>Vbc Task</title>
+    <title>Fsc Task</title>
   </head>
 
 <body>
 
-    <h2>Vbc Task</h2>
+    <h2>Fsc Task</h2>
 
     <h3><a name="description">Description</a></h3>
 
-    <p>This task compiles Visual Basic.NET source into executables or
-    modules. The task requires vbc.exe on the execute path, unless it
+    <p>This task compiles F# source into executables or
+    modules. The task requires fsc.exe on the execute path, unless it
     or an equivalent program is specified in the <tt>executable</tt>
     parameter </p>
 
-    <p>All parameters are optional: <code>&lt;vbc/&gt;</code> should
-    suffice to produce a debug build of all *.vb files. </p>
+    <p>All parameters are optional: <code>&lt;fsc/&gt;</code> should
+    suffice to produce a debug build of all *.fs files. </p>
 
     <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
+    <tt>includes=&quot;**\/*.fs&quot;</tt> and
+    <tt>excludes=&quot;broken.fs&quot;</tt> can be used to control the
+    files pulled in. By default, all *.fs 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
@@ -126,9 +126,9 @@
         <td valign="top" align="left">
           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
+          alternate implementation of the command -provided they use
+          the same command line arguments as the .NET framework
+          edition
         </td>
         <td valign="top" align="left">
           String
@@ -161,45 +161,6 @@
 
       <tr>
         <td valign="top" align="left">
-          imports
-        </td>
-        <td valign="top" align="left">
-          Declare global imports for namespaces in referenced metadata files.
-        </td>
-        <td valign="top" align="left">
-          String
-        </td>
-      </tr>
-
-      <tr>
-        <td valign="top" align="left">
-          includedefaultreferences
-        </td>
-        <td valign="top" align="left">
-          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
-        </td>
-        <td valign="top" align="left">
-          boolean
-        </td>
-      </tr>
-
-      <tr>
-        <td valign="top" align="left">
-          mainclass
-        </td>
-        <td valign="top" align="left">
-          Sets the name of main class for executables.
-        </td>
-        <td valign="top" align="left">
-          String
-        </td>
-      </tr>
-
-      <tr>
-        <td valign="top" align="left">
           optimize
         </td>
         <td valign="top" align="left">
@@ -212,49 +173,38 @@
 
       <tr>
         <td valign="top" align="left">
-          optioncompare
-        </td>
-        <td valign="top" align="left">
-          Specify binary- or text-style string comparisons. Defaults to "binary"
-        </td>
-        <td valign="top" align="left">
-          String
-        </td>
-      </tr>
-
-      <tr>
-        <td valign="top" align="left">
-          optionexplicit
+          tailcalls
         </td>
         <td valign="top" align="left">
-          Whether to require explicit declaration of variables.
+          Whether to enable tailcalls
         </td>
         <td valign="top" align="left">
-          boolean
+          boolean, defaults to true
         </td>
       </tr>
 
       <tr>
         <td valign="top" align="left">
-          optionstrict
+          crossoptimize
         </td>
         <td valign="top" align="left">
-          Enforce strict language semantics.
+          Whether to enable cross-module optimizations.
         </td>
         <td valign="top" align="left">
-          boolean
+          boolean, defaults to false
         </td>
       </tr>
 
       <tr>
         <td valign="top" align="left">
-          referencefiles
+          standalone
         </td>
         <td valign="top" align="left">
-          Path of references to include. Wildcards should work.
+          Whether to statically link the F# library and all referenced
+          DLLs into the assembly.
         </td>
         <td valign="top" align="left">
-          Path
+          boolean, defaults to false
         </td>
       </tr>
 
@@ -272,30 +222,6 @@
 
       <tr>
         <td valign="top" align="left">
-          removeintchecks
-        </td>
-        <td valign="top" align="left">
-          Whether to remove integer checks. Default false.
-        </td>
-        <td valign="top" align="left">
-          boolean
-        </td>
-      </tr>
-
-      <tr>
-        <td valign="top" align="left">
-          rootnamespace
-        </td>
-        <td valign="top" align="left">
-          Specifies the root namespace for all type declarations.
-        </td>
-        <td valign="top" align="left">
-          String
-        </td>
-      </tr>
-
-      <tr>
-        <td valign="top" align="left">
           srcdir
         </td>
         <td valign="top" align="left">
@@ -405,16 +331,15 @@
 
     <h3>Examples</h3>
 
-<pre>&lt;vbc optimize=&quot;true&quot; debug=&quot;false&quot;
+<pre>&lt;fsc 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;
+  excludes=&quot;src/unicode_class.fs&quot;
+  destFile=&quot;NetApp.exe&quot; tailcalls=&quot;true&quot; &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;
+&lt;/fsc&gt;
 </pre>
 </body>
 </html>

Modified: ant/antlibs/dotnet/trunk/docs/index.html
URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/docs/index.html?rev=936234&r1=936233&r2=936234&view=diff
==============================================================================
--- ant/antlibs/dotnet/trunk/docs/index.html (original)
+++ ant/antlibs/dotnet/trunk/docs/index.html Wed Apr 21 09:56:56 2010
@@ -151,6 +151,8 @@
       is going to be used - defaults to Mono on non-Windows platforms
       and Microsoft's on Windows.</li>
 
+      <li><a href="fsc.html">fsc</a> - F# compiler task.</li>
+
       <li><a href="nant.html">nant</a> - execute the NAnt build
       tool.</li>
 

Modified: ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/antlib.xml
URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/antlib.xml?rev=936234&r1=936233&r2=936234&view=diff
==============================================================================
--- ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/antlib.xml (original)
+++ ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/antlib.xml Wed Apr 21 09:56:56
2010
@@ -61,4 +61,7 @@
   <taskdef
     name="importtypelib"
     classname="org.apache.ant.dotnet.ImportTypelib"/>
+  <taskdef
+    name="fsc"
+    classname="org.apache.ant.dotnet.compile.FSharp"/>
 </antlib>

Copied: ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/compile/FSharp.java (from
r936202, ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/compile/VisualBasicCompile.java)
URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/compile/FSharp.java?p2=ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/compile/FSharp.java&p1=ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/compile/VisualBasicCompile.java&r1=936202&r2=936234&rev=936234&view=diff
==============================================================================
--- ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/compile/VisualBasicCompile.java
(original)
+++ ant/antlibs/dotnet/trunk/src/main/org/apache/ant/dotnet/compile/FSharp.java Wed Apr 21
09:56:56 2010
@@ -23,21 +23,21 @@ import org.apache.tools.ant.BuildExcepti
 
 
 /**
- * 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
+ * This task compiles F# source into executables or modules.
+ * The task requires fsc.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.
+ * All parameters are optional: &lt;fsc/&gt; should suffice to produce a debug
+ * build of all *.fs 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
+ * <tt>includes=&quot;**\/*.fs&quot;</tt> and
+ * <tt>excludes=&quot;broken.fs&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.
+ * all *.fs 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.
@@ -46,7 +46,7 @@ import org.apache.tools.ant.BuildExcepti
  * 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
+ * <code>**</code><code>/*.fs</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>
@@ -57,64 +57,45 @@ import org.apache.tools.ant.BuildExcepti
  * <p>
  * Example
  * </p>
- * <pre>&lt;vbc
+ * <pre>&lt;fsc
  *   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;
+ *   excludes=&quot;src/unicode_class.fs&quot;
  *   destFile=&quot;NetApp.exe&quot;
- *   optionExplicit=&quot;true&quot;
- *   optionCompare=&quot;text&quot;
+ *   tailcalls=&quot;true&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;
+ *   &lt;/fsc&gt;
  </pre>
- * @ant.task    name="vbc" category="dotnet"
+ * @ant.task    name="fsc" category="dotnet"
  */
 
-public class VisualBasicCompile extends DotnetCompile {
+public class FSharp extends DotnetCompile {
 
     /**
-     * Compiler option to remove integer checks. Default: false.
+     * Compiler option to enable tailcalls.
      */
-    private boolean removeIntChecks = false;
+    private boolean tailcalls = true;
 
     /**
-     * Require explicit declaration of variables? Default: false.
+     * Compiler option to enable cross-module optimizations.
      */
-    private boolean optionExplicit = false;
+    private boolean crossoptimize = false;
 
     /**
-     * Enforce strict language semantics? Default: false.
+     * Compiler option to statically link the F# library and all
+     * referenced DLLs into the assembly.
      */
-    private boolean optionStrict = false;
+    private boolean standalone = 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() {
+    public FSharp() {
         clear();
     }
 
@@ -123,244 +104,112 @@ public class VisualBasicCompile extends 
      */
     public void clear() {
         super.clear();
-        imports = null;
-        rootNamespace = null;
-        optionCompare = null;
-        optionExplicit = false;
-        optionStrict = false;
-        removeIntChecks = false;
-        setExecutable("vbc");
+        tailcalls = true;
+        crossoptimize = false;
+        standalone = false;
+        setExecutable("fsc");
     }
 
     /**
-     *  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
+     * Whether to enable tailcalls.
      */
-    public void setRemoveIntChecks(boolean flag) {
-        removeIntChecks = flag;
+    public void setTailcalls(boolean b) {
+        tailcalls = b;
     }
 
     /**
-     * Get the flag for removing integer checks.
+     * Whether to enable tailcalls.
      * @return    true if flag is turned on
      */
-    public boolean getRemoveIntChecks() {
-        return removeIntChecks;
+    public boolean getTailcalls() {
+        return tailcalls;
     }
 
     /**
-     * Form the option string for removeIntChecks.
+     * Form the option string for tailcalls.
      * @return The parameter string.
      */
-    public String getRemoveIntChecksParameter() {
-        return "/removeintchecks" + (removeIntChecks ? "+" : "-");
+    public String getTailcallsParameter() {
+        return "/tailcalls" + (tailcalls ? "+" : "-");
     }
 
     /**
-     * Whether to require explicit declaration of variables.
-     * @param  flag  on/off flag
+     * Whether to enable cross-module optimizations.
      */
-    public void setOptionExplicit(boolean flag) {
-        optionExplicit = flag;
+    public void setCrossoptimize(boolean b) {
+        crossoptimize = b;
     }
 
     /**
-     * Get the flag for whether to require explicit declaration of variables.
-     *@return    true if flag is turned on
+     * Whether to enable cross-module optimizations.
+     * @return    true if flag is turned on
      */
-    public boolean getOptionExplicit() {
-        return optionExplicit;
+    public boolean getCrossoptimize() {
+        return crossoptimize;
     }
 
     /**
-     * Form the option string for optionExplicit..
+     * Form the option string for cross-module optimizations.
      * @return The parameter string.
      */
-    public String getOptionExplicitParameter() {
-        return "/optionexplicit" + (optionExplicit ? "+" : "-");
+    public String getCrossoptimizeParameter() {
+        return "/crossoptimize" + (crossoptimize ? "+" : "-");
     }
 
     /**
-     * Enforce strict language semantics.
-     * @param  flag  on/off flag
+     * Whether to create a standalone assembly.
      */
-    public void setOptionStrict(boolean flag) {
-        optionStrict = flag;
+    public void setStandalone(boolean b) {
+        standalone = b;
     }
 
     /**
-     * Get the flag for whether to enforce strict language semantics.
+     * Whether to create a standalone assembly.
      * @return    true if flag is turned on
      */
-    public boolean getOptionStrict() {
-        return optionStrict;
+    public boolean getStandalone() {
+        return standalone;
     }
 
     /**
-     * For the option string for optionStrict.
+     * Form the option string for standalone.
      * @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;
-        }
+    public String getStandaloneParameter() {
+        return standalone ? "/standalone" : 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
+     * implement FSC commands
      * @param command
      */
     protected void addCompilerSpecificOptions(NetCommand command) {
-        command.addArgument(getRemoveIntChecksParameter());
-        command.addArgument(getImportsParameter());
-        command.addArgument(getOptionExplicitParameter());
-        command.addArgument(getOptionStrictParameter());
-        command.addArgument(getRootNamespaceParameter());
-        command.addArgument(getOptionCompareParameter());
+        command.addArgument(getTailcallsParameter());
+        command.addArgument(getCrossoptimizeParameter());
+        String s = getStandaloneParameter();
+        if (s != null) {
+            command.addArgument(s);
+        }
     }
 
     /**
      * 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 ",";
+        return ";";
     }
 
-
-
     /**
      * Get the extension of filenames to compile.
      * @return The string extension of files to compile.
      */
     public String getFileExtension() {
-        return "vb";
+        return "fs";
     }
 
-    protected void createResourceParameter(NetCommand command, DotnetResource resource) {
+    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");
-        }
-    }
 }

Added: ant/antlibs/dotnet/trunk/src/tests/antunit/fsc-test.xml
URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/src/tests/antunit/fsc-test.xml?rev=936234&view=auto
==============================================================================
--- ant/antlibs/dotnet/trunk/src/tests/antunit/fsc-test.xml (added)
+++ ant/antlibs/dotnet/trunk/src/tests/antunit/fsc-test.xml Wed Apr 21 09:56:56 2010
@@ -0,0 +1,53 @@
+<?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 xmlns:dn="antlib:org.apache.ant.dotnet"
+         xmlns:au="antlib:org.apache.ant.antunit">
+
+  <property environment="env"/>
+  <property name="build.dir" location="${java.io.tmpdir}/build"/>
+  <property name="src.dir" location="src"/>
+
+  <target name="setUp">
+    <mkdir dir="${build.dir}"/>
+    <condition property="fsc.found">
+      <or>
+        <available file="fsc"     filepath="${env.PATH}" />
+        <available file="fsc.exe" filepath="${env.PATH}" />
+        <available file="fsc.exe" filepath="${env.Path}" />
+      </or>
+    </condition>
+  </target>
+
+  <target name="test-fsc" depends="setUp" if="fsc.found">
+    <property name="testFSC.exe"
+              location="${build.dir}/ExampleFsc.exe" />
+    <dn:fsc
+       destFile="${testFSC.exe}"
+       targetType="exe"
+       optimize="true"
+       srcDir="${src.dir}"
+      >
+    </dn:fsc>
+    <au:assertFileExists file="${testFSC.exe}"/>
+    <dn:dotnetexec executable="${testFSC.exe}" failonerror="true" />
+  </target>
+
+  <target name="tearDown">
+    <delete dir="${build.dir}" quiet="true"/>
+  </target>
+</project>

Added: ant/antlibs/dotnet/trunk/src/tests/antunit/src/example.fs
URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/src/tests/antunit/src/example.fs?rev=936234&view=auto
==============================================================================
--- ant/antlibs/dotnet/trunk/src/tests/antunit/src/example.fs (added)
+++ ant/antlibs/dotnet/trunk/src/tests/antunit/src/example.fs Wed Apr 21 09:56:56 2010
@@ -0,0 +1,21 @@
+#light
+
+(*
+ *  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.
+ *
+ *)
+
+printfn "hello, I look like ML, but I'm really .NET"

Propchange: ant/antlibs/dotnet/trunk/src/tests/antunit/src/example.fs
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message