[nant] Build with system mono-nunit

Kalev Lember kalev at fedoraproject.org
Fri Apr 8 21:13:42 UTC 2011


commit b5c2966f9f290c5d8e774a06ea3ffdea5cc0e620
Author: Kalev Lember <kalev at smartlink.ee>
Date:   Fri Apr 8 17:26:46 2011 +0300

    Build with system mono-nunit
    
    Added a patch to build with system mono-nunit instead of the bundled copy and
    removed support for mono-nunit22.

 nant-0.90-system_nunit.patch |  267 ++++++++++++++++++++++++++++++++++++++++++
 nant-0.90-systemlibs.patch   |   30 -----
 nant.spec                    |   19 ++--
 3 files changed, 278 insertions(+), 38 deletions(-)
---
diff --git a/nant-0.90-system_nunit.patch b/nant-0.90-system_nunit.patch
new file mode 100644
index 0000000..1964b38
--- /dev/null
+++ b/nant-0.90-system_nunit.patch
@@ -0,0 +1,267 @@
+diff -up nant-0.90/src/NAnt.NUnit/NAnt.NUnit.build.system_nunit nant-0.90/src/NAnt.NUnit/NAnt.NUnit.build
+--- nant-0.90/src/NAnt.NUnit/NAnt.NUnit.build.system_nunit	2010-02-17 07:08:02.000000000 +0200
++++ nant-0.90/src/NAnt.NUnit/NAnt.NUnit.build	2011-04-08 20:39:34.000000000 +0300
+@@ -17,29 +17,10 @@
+             </sources>
+             <references>
+                 <include name="${build.dir}/bin/NAnt.Core.dll" />
+-                <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+             </references>
+-        </csc>
+-        <csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/NAnt.NUnit1Tasks.dll" doc="${build.dir}/bin/NAnt.NUnit1Tasks.xml">
+-            <nowarn>
+-                <!-- do not report warnings for missing XML comments -->
+-                <warning number="1591" />
+-                 <!-- workaround for Mono bug #61902: do not report deprecation warnings -->
+-                <warning number="0618" if="${framework::get-family(framework::get-target-framework()) == 'mono'}" />
+-            </nowarn>
+-            <sources>
+-                <include name="NUnit1/**/*.cs"/>
+-                <!-- common assembly-level attributes -->
+-                <include name="../CommonAssemblyInfo.cs" />
+-            </sources>
+-            <references>
+-                <include name="${build.dir}/bin/NAnt.Core.dll" />
+-                <include name="${build.dir}/bin/NAnt.NUnit.dll" />
+-                <include name="${nant::scan-probing-paths(build.dir + '/bin','NUnitCore.dll')}" />
+-            </references>
+-            <resources>
+-                <include name="*.resx"/>
+-            </resources>
++            <pkg-references>
++                <package name="mono-nunit"/>
++            </pkg-references>
+         </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>
+@@ -55,10 +36,10 @@
+                 <include name="${build.dir}/bin/NAnt.Core.dll" />
+                 <include name="${build.dir}/bin/NAnt.NUnit.dll" />
+                 <include name="${build.dir}/bin/NAnt.DotNetTasks.dll" />
+-                <include name="${nant::scan-probing-paths(build.dir + '/bin','nunit.framework.dll')}" />
+-                <include name="${nant::scan-probing-paths(build.dir + '/bin','nunit.core.dll')}" />
+-                <include name="${nant::scan-probing-paths(build.dir + '/bin','nunit.util.dll')}" />
+             </references>
++            <pkg-references>
++                <package name="mono-nunit"/>
++            </pkg-references>
+         </csc>
+     </target>
+ </project>
+diff -up nant-0.90/src/NAnt.NUnit/NUnit2/NUnit2Task.cs.system_nunit nant-0.90/src/NAnt.NUnit/NUnit2/NUnit2Task.cs
+--- nant-0.90/src/NAnt.NUnit/NUnit2/NUnit2Task.cs.system_nunit	2008-06-01 17:03:51.000000000 +0300
++++ nant-0.90/src/NAnt.NUnit/NUnit2/NUnit2Task.cs	2011-04-08 20:39:34.000000000 +0300
+@@ -31,6 +31,7 @@ using System.Xml.Xsl;
+ using System.Xml.XPath;
+ 
+ using NUnit.Core;
++using NUnit.Core.Filters;
+ using TestCase = NUnit.Core.TestCase;
+ using TestOutput = NUnit.Core.TestOutput;
+ using NUnit.Framework;
+@@ -189,16 +190,16 @@ namespace NAnt.NUnit2.Tasks {
+             EventListener listener = new EventCollector(logWriter, logWriter);
+ 
+             foreach (NUnit2Test testElement in Tests) {
+-                IFilter categoryFilter = null;
++                ITestFilter categoryFilter = null;
+ 
+                 // include or exclude specific categories
+                 string categories = testElement.Categories.Includes.ToString();
+                 if (!StringUtils.IsNullOrEmpty(categories)) {
+-                    categoryFilter = new CategoryFilter(categories.Split(','), false);
++                    categoryFilter = new CategoryFilter(categories.Split(','));
+                 } else {
+                     categories = testElement.Categories.Excludes.ToString();
+                     if (!StringUtils.IsNullOrEmpty(categories)) {
+-                        categoryFilter = new CategoryFilter(categories.Split(','), true);
++                        categoryFilter = new NotFilter(new CategoryFilter(categories.Split(',')));
+                     }
+                 }
+ 
+@@ -210,27 +211,22 @@ namespace NAnt.NUnit2.Tasks {
+                             new FileInfo(testAssembly),
+                             testElement.AppConfigFile,
+                             testElement.References.FileNames);
++						TestPackage package = new TestPackage(testAssembly);
+ 
+-                        Test test = null;
+-                        if (testElement.TestName != null) {
+-                            test = runner.Load(testAssembly, testElement.TestName);
+-                        } else {
+-                            test = runner.Load(testAssembly);
+-                        }
+-
+-                        if (test == null) {
++						bool test = runner.Load(package);
++                        if (!test) {
+                             Log(Level.Warning, "Assembly \"{0}\" contains no tests.",
+                                 testAssembly);
+                             continue;
+                         }
+ 
+-                        // set category filter
+-                        if (categoryFilter != null) {
+-                            runner.Filter = categoryFilter;
+-                        }
+-
++						TestResult result;
+                         // run test
+-                        TestResult result = runner.Run(listener);
++						if (categoryFilter != null) {
++							result = runner.Run(listener, categoryFilter);
++						} else {
++							result = runner.Run(listener);
++						}
+ 
+                         // flush test output to log
+                         logWriter.Flush();
+@@ -378,7 +374,7 @@ namespace NAnt.NUnit2.Tasks {
+         
+         #endregion Private Instance Methods
+ 
+-        private class EventCollector : LongLivingMarshalByRefObject, EventListener {
++        private class EventCollector : MarshalByRefObject, EventListener {
+             private TextWriter outWriter;
+             private TextWriter errorWriter;
+             private string currentTestName;
+@@ -389,10 +385,10 @@ namespace NAnt.NUnit2.Tasks {
+                 this.currentTestName = string.Empty;
+              }
+ 
+-            public void RunStarted(Test[] tests) {
++            public void RunStarted(string name, int testcount) {
+             }
+ 
+-            public void RunFinished(TestResult[] results) {
++            public void RunFinished(TestResult result) {
+             }
+ 
+             public void RunFinished(Exception exception) {
+@@ -402,11 +398,11 @@ namespace NAnt.NUnit2.Tasks {
+                 currentTestName = string.Empty;
+             }
+ 
+-            public void TestStarted(TestCase testCase) {
+-                currentTestName = testCase.FullName;
++            public void TestStarted(TestName testName) {
++                currentTestName = testName.FullName;
+             }
+ 
+-            public void SuiteStarted(TestSuite suite) {
++            public void SuiteStarted(TestName testName) {
+             }
+ 
+             public void SuiteFinished(TestSuiteResult suiteResult) {
+@@ -430,4 +426,4 @@ namespace NAnt.NUnit2.Tasks {
+             }
+         }
+     }
+-}
+\ No newline at end of file
++}
+diff -up nant-0.90/tests/NAnt.Compression/NAnt.Compression.build.system_nunit nant-0.90/tests/NAnt.Compression/NAnt.Compression.build
+--- nant-0.90/tests/NAnt.Compression/NAnt.Compression.build.system_nunit	2010-03-14 18:11:16.000000000 +0200
++++ nant-0.90/tests/NAnt.Compression/NAnt.Compression.build	2011-04-08 20:39:34.000000000 +0300
+@@ -21,8 +21,10 @@
+             <references>
+                 <include name="${build.dir}/bin/NAnt.Core.dll" />
+                 <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+-                <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+             </references>
++            <pkg-references>
++                <package name="mono-nunit"/>
++            </pkg-references>
+         </csc>
+     </target>
+     <target name="test" depends="build">
+diff -up nant-0.90/tests/NAnt.Console/NAnt.Console.build.system_nunit nant-0.90/tests/NAnt.Console/NAnt.Console.build
+--- nant-0.90/tests/NAnt.Console/NAnt.Console.build.system_nunit	2010-03-14 18:11:16.000000000 +0200
++++ nant-0.90/tests/NAnt.Console/NAnt.Console.build	2011-04-08 20:39:34.000000000 +0300
+@@ -22,8 +22,10 @@
+             <references>
+                 <include name="${build.dir}/bin/NAnt.Core.dll" />
+                 <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+-                <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+             </references>
++            <pkg-references>
++                <package name="mono-nunit"/>
++            </pkg-references>
+         </csc>
+     </target>
+     <target name="test" depends="build">
+diff -up nant-0.90/tests/NAnt.Core/NAnt.Core.build.system_nunit nant-0.90/tests/NAnt.Core/NAnt.Core.build
+--- nant-0.90/tests/NAnt.Core/NAnt.Core.build.system_nunit	2010-03-14 18:11:16.000000000 +0200
++++ nant-0.90/tests/NAnt.Core/NAnt.Core.build	2011-04-08 20:39:34.000000000 +0300
+@@ -22,8 +22,10 @@
+             </sources>
+             <references>
+                 <include name="${build.dir}/bin/NAnt.Core.dll" />
+-                <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+             </references>
++            <pkg-references>
++                <package name="mono-nunit"/>
++            </pkg-references>
+             <resources failonempty="true" basedir="Resources" dynamicprefix="true" prefix="XML:">
+                 <include name="**/*.xml"/>
+                 <include name="**/*.build"/>
+diff -up nant-0.90/tests/NAnt.DotNet/NAnt.DotNet.build.system_nunit nant-0.90/tests/NAnt.DotNet/NAnt.DotNet.build
+--- nant-0.90/tests/NAnt.DotNet/NAnt.DotNet.build.system_nunit	2010-03-14 18:11:16.000000000 +0200
++++ nant-0.90/tests/NAnt.DotNet/NAnt.DotNet.build	2011-04-08 20:39:34.000000000 +0300
+@@ -29,8 +29,10 @@
+                 <include name="${build.dir}/bin/NAnt.Core.dll"/>
+                 <include name="${build.dir}/bin/NAnt.Core.Tests.dll"/>
+                 <include name="${build.dir}/bin/${project::get-name()}Tasks.dll"/>
+-                <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+             </references>
++            <pkg-references>
++                <package name="mono-nunit"/>
++            </pkg-references>
+         </csc>
+     </target>
+     <target name="test" depends="build">
+diff -up nant-0.90/tests/NAnt.VisualCpp/NAnt.VisualCpp.build.system_nunit nant-0.90/tests/NAnt.VisualCpp/NAnt.VisualCpp.build
+--- nant-0.90/tests/NAnt.VisualCpp/NAnt.VisualCpp.build.system_nunit	2010-04-08 06:59:19.000000000 +0300
++++ nant-0.90/tests/NAnt.VisualCpp/NAnt.VisualCpp.build	2011-04-08 20:39:34.000000000 +0300
+@@ -22,8 +22,10 @@
+                 <include name="${build.dir}/bin/NAnt.Core.dll" />
+                 <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+                 <include name="${build.dir}/bin/NAnt.VisualCppTasks.dll" />
+-                <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+             </references>
++            <pkg-references>
++                <package name="mono-nunit"/>
++            </pkg-references>
+         </csc>
+     </target>
+     <target name="test" depends="build" if="${platform::is-windows()}">
+diff -up nant-0.90/tests/NAnt.VSNet/NAnt.VSNet.build.system_nunit nant-0.90/tests/NAnt.VSNet/NAnt.VSNet.build
+--- nant-0.90/tests/NAnt.VSNet/NAnt.VSNet.build.system_nunit	2010-04-08 06:59:19.000000000 +0300
++++ nant-0.90/tests/NAnt.VSNet/NAnt.VSNet.build	2011-04-08 20:39:34.000000000 +0300
+@@ -22,8 +22,10 @@
+                 <include name="${build.dir}/bin/NAnt.Core.dll" />
+                 <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+                 <include name="${build.dir}/bin/NAnt.VisualCpp.Tests.dll" />
+-                <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+             </references>
++            <pkg-references>
++                <package name="mono-nunit"/>
++            </pkg-references>
+         </csc>
+     </target>
+     <target name="test" depends="build" if="${platform::is-windows()}">
+diff -up nant-0.90/tests/NAnt.Win32/NAnt.Win32.build.system_nunit nant-0.90/tests/NAnt.Win32/NAnt.Win32.build
+--- nant-0.90/tests/NAnt.Win32/NAnt.Win32.build.system_nunit	2010-04-08 06:59:19.000000000 +0300
++++ nant-0.90/tests/NAnt.Win32/NAnt.Win32.build	2011-04-08 20:39:34.000000000 +0300
+@@ -21,8 +21,10 @@
+             <references>
+                 <include name="${build.dir}/bin/NAnt.Core.dll" />
+                 <include name="${build.dir}/bin/NAnt.Core.Tests.dll" />
+-                <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
+             </references>
++            <pkg-references>
++                <package name="mono-nunit"/>
++            </pkg-references>
+         </csc>
+     </target>
+     <target name="test" depends="build" if="${platform::is-windows()}">
diff --git a/nant-0.90-systemlibs.patch b/nant-0.90-systemlibs.patch
index 3abbe94..db9d76a 100644
--- a/nant-0.90-systemlibs.patch
+++ b/nant-0.90-systemlibs.patch
@@ -1,33 +1,3 @@
---- nant-0.90/src/NAnt.NUnit/NAnt.NUnit.build	2010-02-17 05:08:02.000000000 +0000
-+++ nant-0.90/src/NAnt.NUnit/NAnt.NUnit-new.build	2010-10-15 00:16:01.238010218 +0100
-@@ -20,27 +20,6 @@
-                 <include name="${nant::scan-probing-paths('nunit.framework.dll')}" />
-             </references>
-         </csc>
--        <csc target="library" define="${current.build.defines}" warnaserror="${build.warnaserror}" debug="${build.debug}" output="${build.dir}/bin/NAnt.NUnit1Tasks.dll" doc="${build.dir}/bin/NAnt.NUnit1Tasks.xml">
--            <nowarn>
--                <!-- do not report warnings for missing XML comments -->
--                <warning number="1591" />
--                 <!-- workaround for Mono bug #61902: do not report deprecation warnings -->
--                <warning number="0618" if="${framework::get-family(framework::get-target-framework()) == 'mono'}" />
--            </nowarn>
--            <sources>
--                <include name="NUnit1/**/*.cs"/>
--                <!-- common assembly-level attributes -->
--                <include name="../CommonAssemblyInfo.cs" />
--            </sources>
--            <references>
--                <include name="${build.dir}/bin/NAnt.Core.dll" />
--                <include name="${build.dir}/bin/NAnt.NUnit.dll" />
--                <include name="${nant::scan-probing-paths(build.dir + '/bin','NUnitCore.dll')}" />
--            </references>
--            <resources>
--                <include name="*.resx"/>
--            </resources>
--        </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 deprecation warnings -->
 --- nant-0.90/src/NAnt.SourceControl/Tasks/AbstractCvsTask.cs	2007-11-16 10:46:38.000000000 +0000
 +++ nant-0.90/src/NAnt.SourceControl/Tasks/AbstractCvsTask-new.cs	2010-10-15 00:20:43.733745701 +0100
 @@ -266,10 +266,12 @@
diff --git a/nant.spec b/nant.spec
index 1922b92..efb0e51 100644
--- a/nant.spec
+++ b/nant.spec
@@ -10,16 +10,18 @@ Release: 4%{?dist}
 Epoch: 1
 Source0: http://downloads.sourceforge.net/nant/%{name}-%{version}-src.tar.gz
 Patch1: nant-0.90-no_ndoc.patch
+Patch2: nant-0.90-system_nunit.patch
 Patch4: nant-0.90-systemlibs.patch
 License: GPLv2+
 Group: Development/Tools
 Url: http://nant.sourceforge.net/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: mono-devel
+BuildRequires: mono-nunit-devel
 %if 0%{bootstrap}
 # Nothing here if we're bootstrapping
 %else
-BuildRequires: log4net, mono-nunit, mono-nunit22-devel
+BuildRequires: log4net
 BuildRequires:mono-sharpcvslib-devel
 %endif
 Requires(post): scrollkeeper
@@ -69,6 +71,11 @@ sed -i -e "s,/share/,/%{_lib}/," etc/nant.pc.in
 rm src/NAnt.DotNet/Tasks/NDocTask.cs
 find lib -name 'NDoc*.dll' | xargs rm
 
+# Remove NUnit1 support and fix build with system NUnit.
+# Based on Debian's 004-nant-nunit_2.4.dpatch
+%patch2 -p1 -b .system_nunit
+find lib -iname 'nunit*' | xargs rm
+
 %patch4 -p1 -b .system
 
 find . -type d|xargs chmod 755
@@ -85,7 +92,7 @@ echo "BOOTSTRAP BUILD"
 %else
 echo "NORMAL BUILD, NUKING PREBUILT BUNDLED DLL FILES"
 rm -rf lib/ICSharpCode.SharpCvsLib.Console.dll lib/ICSharpCode.SharpCvsLib.dll lib/scvs.exe
-rm -rf lib/ICSharpCode.SharpZipLib.dll lib/NUnitCore.dll lib/log4net.dll lib/mono/1.0/*.dll lib/mono/2.0/*.dll
+rm -rf lib/ICSharpCode.SharpZipLib.dll lib/log4net.dll lib/mono/1.0/*.dll lib/mono/2.0/*.dll
 %endif
 
 # Copy in the system libs, unless we're bootstrapping.
@@ -97,12 +104,6 @@ cp -p %{_libdir}/mono/sharpcvslib/ICSharpCode.SharpCvsLib.dll lib/
 cp -p %{_libdir}/mono/sharpcvslib/cvs.exe lib/scvs.exe
 cp -p %{_libdir}/mono/2.0/ICSharpCode.SharpZipLib.dll lib/
 cp -p %{_libdir}/mono/log4net/log4net.dll lib/
-cp -p %{_libdir}/mono/2.0/nunit.core.dll lib/mono/2.0/
-cp -p %{_libdir}/mono/2.0/nunit.framework.dll lib/mono/2.0/
-cp -p %{_libdir}/mono/2.0/nunit.util.dll lib/mono/2.0/
-cp -p %{_libdir}/mono/nunit22/nunit.core.dll lib/mono/2.0/
-cp -p %{_libdir}/mono/nunit22/nunit.framework.dll lib/mono/2.0/
-cp -p %{_libdir}/mono/nunit22/nunit.util.dll lib/mono/2.0/
 %endif
 
 %build
@@ -150,6 +151,8 @@ scrollkeeper-update -q || :
 * Fri Apr 08 2011 Kalev Lember <kalev at smartlink.ee> - 1:0.90-4
 - Fixed build in bootstrap mode
 - Added a patch to build without NDoc
+- Added a patch to build with system mono-nunit instead of the bundled copy and
+  removed support for mono-nunit22
 
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1:0.90-3.1
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild


More information about the scm-commits mailing list