From 85a688731627504c0f0e94b8e8b15306a0cf9e7c Mon Sep 17 00:00:00 2001
From: Ryan Boggs <rmboggs@gmail.com>
Date: Thu, 22 Oct 2015 17:53:33 -0700
Subject: [PATCH] Add initial support for mono-4.5 on unix. Untested. Cannot
 work on mono-4.5 on win until next mono release with corrected installer. 
 Fix has been committed to mono repo but no eta as to when the next Windows
 release for mono will occur.

---
 src/NAnt.Console/App.config | 119 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 119 insertions(+)

Index: nant/src/NAnt.Console/App.config
===================================================================
--- nant.orig/src/NAnt.Console/App.config
+++ nant/src/NAnt.Console/App.config
@@ -2973,6 +2973,125 @@
                     </tasks>
                 </framework>
                 <framework
+                    name="mono-4.5"
+                    family="mono"
+                    version="4.5"
+                    description="Mono 4.5 Profile"
+                    sdkdirectory="${toolDirectory}"
+                    frameworkdirectory="${toolDirectory}"
+                    frameworkassemblydirectory="${path::combine(prefix, 'lib/mono/4.5')}"
+                    clrversion="4.0.30319"
+                    clrtype="Desktop"
+                    vendor="Mono"
+                    >
+                    <runtime>
+                        <probing-paths>
+                            <directory name="lib/mono/2.0" />
+                            <directory name="lib/mono/neutral" />
+                            <directory name="lib/common/2.0" />
+                            <directory name="lib/common/neutral" />
+                        </probing-paths>
+                        <modes>
+                            <auto>
+                                <engine program="${path::combine(prefix, 'bin/mono')}" />
+                            </auto>
+                            <strict>
+                                <engine program="${path::combine(prefix, 'bin/mono')}">
+                                    <arg value="--runtime=v4.0.30319" />
+                                </engine>
+                            </strict>
+                        </modes>
+                    </runtime>
+                    <reference-assemblies basedir="${path::combine(prefix, 'lib/mono/4.5')}">
+                        <include name="*.dll" />
+                    </reference-assemblies>
+                    <reference-assemblies basedir="${path::combine(prefix, 'lib/mono/4.0')}">
+                        <include name="*.dll" />
+                    </reference-assemblies>
+                    <reference-assemblies basedir="${path::combine(prefix, 'lib/mono/3.5')}">
+                        <include name="*.dll" />
+                    </reference-assemblies>
+                    <reference-assemblies basedir="${path::combine(prefix, 'lib/mono/3.0')}">
+                        <include name="*.dll" />
+                    </reference-assemblies>
+                    <reference-assemblies basedir="${path::combine(prefix, 'lib/mono/2.0')}">
+                        <include name="*.dll" />
+                    </reference-assemblies>
+                    <task-assemblies>
+                        <!-- include Mono version-neutral assemblies -->
+                        <include name="extensions/mono/neutral/**/*.dll" />
+                        <!-- include Mono 2.0 specific assemblies -->
+                        <include name="extensions/mono/2.0/**/*.dll" />
+                        <!-- include .NET 2.0 specific assemblies -->
+                        <include name="extensions/common/2.0/**/*.dll" />
+                    </task-assemblies>
+                    <tool-paths>
+                        <directory name="${toolDirectory}" />
+                        <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
+                        <directory name="${path::combine(prefix, 'lib/mono/3.5')}" />
+                        <directory name="${path::combine(prefix, 'lib/mono/2.0')}" />
+                        <directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
+                        <!-- unmanaged tools -->
+                        <directory name="${prefix}/bin" />
+                    </tool-paths>
+                    <project>
+                        <if test="${not pkg-config::exists('mono')}">
+                            <fail>Unable to locate 'mono' module using pkg-config. Download the Mono development packages from http://www.mono-project.com/downloads/.</fail>
+                        </if>
+                        <property name="resgen.supportsexternalfilereferences" value="false" />
+                        <property name="prefix" value="${pkg-config::get-variable('mono', 'prefix')}" />
+                        <property name="toolDirectory" value="${path::combine(prefix, 'lib/mono/4.5')}" />
+                        <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+                            <property name="csc.tool" value="dmcs"/>
+                            <property name="mcs.sdk" value="0"/>
+                        </if>
+                        <if test="${pkg-config::is-atleast-version('mono', '3.0')}">
+                            <property name="csc.tool" value="mcs"/>
+                            <property name="mcs.sdk" value="4.5"/>
+                        </if>
+                    </project>
+                    <tasks>
+                        <task name="al">
+                            <attribute name="managed">true</attribute>
+                        </task>
+                        <task name="csc">
+                            <attribute name="exename">${csc.tool}</attribute>
+                            <attribute name="mcssdk">${mcs.sdk}</attribute>
+                            <attribute name="managed">true</attribute>
+                            <attribute name="langversion">linq</attribute>
+                            <attribute name="supportspackagereferences">true</attribute>
+                            <attribute name="supportsnowarnlist">true</attribute>
+                            <attribute name="supportsdocgeneration">true</attribute>
+                            <attribute name="supportskeycontainer">true</attribute>
+                            <attribute name="supportskeyfile">true</attribute>
+                            <attribute name="supportsdelaysign">true</attribute>
+                            <attribute name="supportslangversion">true</attribute>
+                        </task>
+                        <task name="jsc">
+                            <attribute name="exename">mjs</attribute>
+                            <attribute name="managed">strict</attribute>
+                        </task>
+                        <task name="vbc">
+                            <attribute name="exename">vbnc</attribute>
+                            <attribute name="managed">true</attribute>
+                        </task>
+                        <task name="resgen">
+                            <attribute name="managed">true</attribute>
+                            <attribute name="supportsexternalfilereferences">true</attribute>
+                        </task>
+                        <task name="delay-sign">
+                            <attribute name="exename">sn</attribute>
+                            <attribute name="managed">true</attribute>
+                        </task>
+                        <task name="license">
+                            <attribute name="hascommandlinecompiler">false</attribute>
+                        </task>
+                        <task name="ilasm">
+                            <attribute name="managed">true</attribute>
+                        </task>
+                    </tasks>
+                </framework>
+                <framework
                     name="moonlight-2.0" 
                     family="moonlight" 
                     version="2.0"
