Skip to content

Commit

Permalink
Merge pull request #91 from rmboggs/issue_90
Browse files Browse the repository at this point in the history
Fix for Issue 90
  • Loading branch information
Ryan Boggs committed Apr 3, 2013
2 parents 3193e44 + 8e7fd37 commit 69c8ee9
Show file tree
Hide file tree
Showing 7 changed files with 319 additions and 88 deletions.
96 changes: 88 additions & 8 deletions src/NAnt.Console/App.config
Expand Up @@ -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}" />
Expand Down Expand Up @@ -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')}" />
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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 -->
Expand All @@ -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')}" />
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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')}" />
Expand All @@ -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')}" />
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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 -->
Expand All @@ -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')}" />
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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" />
Expand All @@ -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>
Expand Down Expand Up @@ -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 -->
Expand All @@ -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>
Expand Down Expand Up @@ -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')}" />
Expand All @@ -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>
Expand Down Expand Up @@ -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 -->
Expand All @@ -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>
Expand Down
5 changes: 3 additions & 2 deletions src/NAnt.Core/ConsoleDriver.cs 100644 → 100755
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/NAnt.Core/Resources/ProjectHelp.xslt 100644 → 100755
Expand Up @@ -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);
}
]]>
Expand Down
26 changes: 26 additions & 0 deletions src/NAnt.DotNet/Tasks/CscTask.cs
Expand Up @@ -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;
Expand Down Expand Up @@ -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>
Expand All @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/NAnt.NUnit/NAnt.NUnit.build
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions src/NDoc.Documenter.NAnt/NDoc.Documenter.NAnt.build
Expand Up @@ -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" />
Expand Down

0 comments on commit 69c8ee9

Please sign in to comment.