Permalink
Browse files

Merge pull request #91 from rmboggs/issue_90

Fix for Issue 90
  • Loading branch information...
rmboggs committed Apr 3, 2013
2 parents 3193e44 + 8e7fd37 commit 69c8ee96493c5d953212397c8ca06c2392372ca4
@@ -1724,6 +1724,7 @@
</task-assemblies>
<tool-paths>
<directory name="${toolDirectory}" />
+ <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
<!-- for compatibility with Mono 1.0.x -->
<directory name="${frameworkAssemblyDirectory}" />
@@ -1782,6 +1783,14 @@
<if test="${version::parse(mono.version) >= version::parse('1.2.3.50')}">
<property name="resgen.supportsexternalfilereferences" value="true" />
</if>
+ <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+ <property name="csc.tool" value="gmcs"/>
+ <property name="mcs.sdk" value="0"/>
+ </if>
+ <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+ <property name="csc.tool" value="mcs"/>
+ <property name="mcs.sdk" value="2"/>
+ </if>
<target name="configure-from-pkg-config">
<property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
@@ -1820,7 +1829,8 @@
<attribute name="managed">true</attribute>
</task>
<task name="csc">
- <attribute name="exename">gmcs</attribute>
+ <attribute name="exename">${csc.tool}</attribute>
+ <attribute name="mcssdk">${mcs.sdk}</attribute>
<attribute name="managed">true</attribute>
<attribute name="supportspackagereferences">true</attribute>
<attribute name="supportsnowarnlist">true</attribute>
@@ -1912,6 +1922,7 @@
</task-assemblies>
<tool-paths>
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}" />
+ <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
<!-- unmanaged tools -->
@@ -1934,6 +1945,14 @@
<property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}" />
<property name="runtimeEngine" value="${path::combine(sdkInstallRoot, 'bin/mono.exe')}" />
+ <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+ <property name="csc.tool" value="gmcs"/>
+ <property name="mcs.sdk" value="0"/>
+ </if>
+ <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+ <property name="csc.tool" value="mcs"/>
+ <property name="mcs.sdk" value="2"/>
+ </if>
<target name="configure-from-pkg-config">
<property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
@@ -1972,7 +1991,8 @@
<attribute name="managed">true</attribute>
</task>
<task name="csc">
- <attribute name="exename">gmcs</attribute>
+ <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>
@@ -2067,6 +2087,7 @@
</task-assemblies>
<tool-paths>
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.0')}" />
+ <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/3.5')}" />
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
@@ -2090,6 +2111,14 @@
<property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/4.0')}" />
<property name="runtimeEngine" value="${path::combine(sdkInstallRoot, 'bin/mono.exe')}" />
+ <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+ <property name="csc.tool" value="dmcs"/>
+ <property name="mcs.sdk" value="0"/>
+ </if>
+ <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+ <property name="csc.tool" value="mcs"/>
+ <property name="mcs.sdk" value="4"/>
+ </if>
<target name="configure-from-pkg-config">
<property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
@@ -2128,7 +2157,8 @@
<attribute name="managed">true</attribute>
</task>
<task name="csc">
- <attribute name="exename">dmcs</attribute>
+ <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>
@@ -2212,6 +2242,7 @@
</task-assemblies>
<tool-paths>
<directory name="${toolDirectory}" />
+ <directory name="${path::combine(frameworkAssemblyDirectory, 'mono/4.5')}" />
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/2.0')}" />
<directory name="${path::combine(frameworkAssemblyDirectory, 'mono/1.0')}" />
<!-- unmanaged tools -->
@@ -2234,6 +2265,14 @@
<property name="toolDirectory" value="${path::combine(frameworkAssemblyDirectory, 'mono/2.1')}" />
<property name="runtimeEngine" value="${path::combine(sdkInstallRoot, 'bin/mono.exe')}" />
+ <if test="${version::parse(mono.version) &lt; version::parse('3.0')}">
+ <property name="csc.tool" value="smcs"/>
+ <property name="mcs.sdk" value="0"/>
+ </if>
+ <if test="${version::parse(mono.version) >= version::parse('3.0')}">
+ <property name="csc.tool" value="mcs"/>
+ <property name="mcs.sdk" value="2.1"/>
+ </if>
<target name="configure-from-pkg-config">
<property name="mono.version" value="${pkg-config::get-mod-version('mono')}" />
@@ -2267,7 +2306,8 @@
</project>
<tasks>
<task name="csc">
- <attribute name="exename">smcs</attribute>
+ <attribute name="exename">${csc.tool}</attribute>
+ <attribute name="mcssdk">${mcs.sdk}</attribute>
<attribute name="managed">true</attribute>
<attribute name="supportspackagereferences">true</attribute>
<attribute name="supportsnowarnlist">true</attribute>
@@ -2502,6 +2542,7 @@
</task-assemblies>
<tool-paths>
<directory name="${toolDirectory}" />
+ <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
<directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
<!-- unmanaged tools -->
<directory name="${prefix}/bin" />
@@ -2526,13 +2567,22 @@
<if test="${pkg-config::is-atleast-version('mono', '1.2.3.50')}">
<property name="resgen.supportsexternalfilereferences" value="true" />
</if>
+ <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+ <property name="csc.tool" value="gmcs"/>
+ <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="2"/>
+ </if>
</project>
<tasks>
<task name="al">
<attribute name="managed">true</attribute>
</task>
<task name="csc">
- <attribute name="exename">gmcs</attribute>
+ <attribute name="exename">${csc.tool}</attribute>
+ <attribute name="mcssdk">${mcs.sdk}</attribute>
<attribute name="managed">true</attribute>
<attribute name="supportspackagereferences">true</attribute>
<attribute name="supportsnowarnlist">true</attribute>
@@ -2616,6 +2666,7 @@
</task-assemblies>
<tool-paths>
<directory name="${toolDirectory}" />
+ <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
<directory name="${path::combine(prefix, 'lib/mono/2.0')}" />
<directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
<!-- unmanaged tools -->
@@ -2628,13 +2679,22 @@
<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/3.5')}" />
+ <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+ <property name="csc.tool" value="gmcs"/>
+ <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="2"/>
+ </if>
</project>
<tasks>
<task name="al">
<attribute name="managed">true</attribute>
</task>
<task name="csc">
- <attribute name="exename">gmcs</attribute>
+ <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>
@@ -2721,6 +2781,7 @@
</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')}" />
@@ -2734,13 +2795,22 @@
<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.0')}" />
+ <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"/>
+ </if>
</project>
<tasks>
<task name="al">
<attribute name="managed">true</attribute>
</task>
<task name="csc">
- <attribute name="exename">dmcs</attribute>
+ <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>
@@ -2824,6 +2894,7 @@
</task-assemblies>
<tool-paths>
<directory name="${toolDirectory}" />
+ <directory name="${path::combine(prefix, 'lib/mono/4.5')}" />
<directory name="${path::combine(prefix, 'lib/mono/2.0')}" />
<directory name="${path::combine(prefix, 'lib/mono/1.0')}" />
<!-- unmanaged tools -->
@@ -2835,10 +2906,19 @@
</if>
<property name="prefix" value="${pkg-config::get-variable('mono', 'prefix')}" />
<property name="toolDirectory" value="${path::combine(prefix, 'lib/mono/2.1')}" />
+ <if test="${not(pkg-config::is-atleast-version('mono', '3.0'))}">
+ <property name="csc.tool" value="smcs"/>
+ <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="2.1"/>
+ </if>
</project>
<tasks>
<task name="csc">
- <attribute name="exename">smcs</attribute>
+ <attribute name="exename">${csc.tool}</attribute>
+ <attribute name="mcssdk">${mcs.sdk}</attribute>
<attribute name="managed">true</attribute>
<attribute name="supportspackagereferences">true</attribute>
<attribute name="supportsnowarnlist">true</attribute>
View
5 src/NAnt.Core/ConsoleDriver.cs 100644 → 100755
@@ -318,8 +318,9 @@ public class ConsoleDriver {
xsltDoc.Load(reader);
xsltDoc.DocumentElement.SetAttribute("xmlns:nant",buildDoc.DocumentElement.NamespaceURI);
- XslTransform transform = new XslTransform();
- transform.Load(xsltDoc);
+ XslCompiledTransform transform = new XslCompiledTransform();
+ XsltSettings settings = new XsltSettings(false, true);
+ transform.Load(xsltDoc, settings, new XmlUrlResolver());
StringBuilder sb = new StringBuilder();
StringWriter writer = new StringWriter(sb, CultureInfo.InvariantCulture);
View
@@ -26,7 +26,7 @@
<xslt:output method="text" />
<msxsl:script language="C#" implements-prefix="stringutils">
<![CDATA[
- string PadRight( string str, int padding) {
+ public string PadRight( string str, int padding) {
return str.PadRight(padding);
}
]]>
@@ -90,6 +90,7 @@ public class CscTask : CompilerBase {
private string _langVersion;
// framework configuration settings
+ private double _mcsSdk = 0;
private bool _supportsDocGeneration = true;
private bool _supportsPlatform;
private bool _supportsLangVersion;
@@ -362,6 +363,21 @@ public class CscTask : CompilerBase {
#endregion Public Instance Properties
+ #region Protected Instance Properties
+
+ /// <summary>
+ /// Gets or sets the mcs sdk version to apply to the new mcs compiler
+ /// for Mono 3.0+
+ /// </summary>
+ [FrameworkConfigurable("mcssdk")]
+ protected double McsSdk
+ {
+ get { return _mcsSdk; }
+ set { _mcsSdk = value; }
+ }
+
+ #endregion Protected Instance Properties
+
#region Override implementation of CompilerBase
/// <summary>
@@ -378,6 +394,16 @@ public class CscTask : CompilerBase {
WriteOption(writer, "baseaddress", BaseAddress);
}
+ // If mcs is the compiler and the specified McsSdk version is specified, append the new
+ // -sdk: option to the argument list.
+ if (PlatformHelper.IsMono)
+ {
+ if (ExeName.Equals("mcs", StringComparison.InvariantCultureIgnoreCase) && _mcsSdk > 0)
+ {
+ WriteOption(writer, "sdk", _mcsSdk.ToString());
+ }
+ }
+
// XML documentation
if (DocFile != null) {
if (SupportsDocGeneration) {
@@ -42,6 +42,8 @@
</csc>
<csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/NAnt.NUnit2Tasks.dll" doc="${build.dir}/bin/NAnt.NUnit2Tasks.xml">
<nowarn>
+ <!-- do not report obsolete warnings until XslCompiledTransform works with NUnit2 output -->
+ <warning number="0612" />
<!-- do not report deprecation warnings -->
<warning number="0618" />
</nowarn>
@@ -11,6 +11,7 @@
<!-- build main assembly -->
<csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/${project::get-name()}.dll" doc="${build.dir}/bin/${project::get-name()}.xml">
<nowarn>
+ <warning number="0612" />
<warning number="0618" />
<warning number="1591" />
<warning number="1572" />
Oops, something went wrong.

0 comments on commit 69c8ee9

Please sign in to comment.