Skip to content

Commit

Permalink
Merge pull request nunit#15 from runehalfdan/dotnetcore
Browse files Browse the repository at this point in the history
Support .NET Core
  • Loading branch information
CharliePoole authored Aug 13, 2020
2 parents 9df6040 + 28bb59a commit 5ab70b1
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 135 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 3.5.{build}
image: Visual Studio 2015
image: Visual Studio 2017

build_script:
- ps: .\build.ps1 -Target "Appveyor"
Expand Down
23 changes: 18 additions & 5 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#tool nuget:?package=NUnit.ConsoleRunner&version=3.7.0
#tool nuget:?package=NUnit.ConsoleRunner&version=3.11.1

//////////////////////////////////////////////////////////////////////
// PROJECT-SPECIFIC
Expand All @@ -8,12 +8,13 @@
// main changes needed should be in this section.

var SOLUTION_FILE = "nunit-project-loader.sln";
var OUTPUT_ASSEMBLY = "nunit-project-loader.dll";
var UNIT_TEST_ASSEMBLY = "nunit-project-loader.tests.dll";
var GITHUB_SITE = "https://github.com/nunit/nunit-project-loader";
var WIKI_PAGE = "https://github.com/nunit/docs/wiki/Console-Command-Line";
var NUGET_ID = "NUnit.Extension.NUnitProjectLoader";
var CHOCO_ID = "nunit-extension-nunit-project-loader";
var VERSION = "3.6.0";
var VERSION = "3.7.0";

// Metadata used in the nuget and chocolatey packages
var TITLE = "NUnit 3 - NUnit Project Loader Extension";
Expand All @@ -24,6 +25,11 @@ var SUMMARY = "NUnit Engine extension for loading NUnit projects.";
var COPYRIGHT = "Copyright (c) 2016 Charlie Poole";
var RELEASE_NOTES = new [] { "See https://raw.githubusercontent.com/nunit/nunit-project-loader/master/CHANGES.txt" };
var TAGS = new [] { "nunit", "test", "testing", "tdd", "runner" };
var TARGET_FRAMEWORKS = new [] { "net20", "netcoreapp2.1" };

// We don't support running tests built with .net core yet
// var TEST_TARGET_FRAMEWORKS = TARGET_FRAMEWORKS
var TEST_TARGET_FRAMEWORKS = new [] { "net20" };

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
Expand Down Expand Up @@ -180,7 +186,7 @@ Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
NUnit3(BIN_DIR + UNIT_TEST_ASSEMBLY);
NUnit3(TEST_TARGET_FRAMEWORKS.Select(framework => System.IO.Path.Combine(BIN_DIR, framework, UNIT_TEST_ASSEMBLY)));
});

//////////////////////////////////////////////////////////////////////
Expand All @@ -197,6 +203,12 @@ var BUG_TRACKER_URL = new Uri(GITHUB_SITE + "/issues");
var DOCS_URL = new Uri(WIKI_PAGE);
var MAILING_LIST_URL = new Uri("https://groups.google.com/forum/#!forum/nunit-discuss");

// Nuspec-files don't handle forward slash in path in combination with recursive wildcards
// https://github.com/cake-build/cake/issues/2367
// https://github.com/NuGet/Home/issues/3584
var TOOLS_SOURCE = BIN_SRC + "**/" + OUTPUT_ASSEMBLY;
TOOLS_SOURCE = TOOLS_SOURCE.Replace("/", @"\");

Task("RePackageNuGet")
.Does(() =>
{
Expand All @@ -221,10 +233,11 @@ Task("RePackageNuGet")
Tags = TAGS,
//Language = "en-US",
OutputDirectory = OUTPUT_DIR,
KeepTemporaryNuSpecFile =false,
Files = new [] {
new NuSpecContent { Source = PROJECT_DIR + "LICENSE.txt" },
new NuSpecContent { Source = PROJECT_DIR + "CHANGES.txt" },
new NuSpecContent { Source = BIN_SRC + "nunit-project-loader.dll", Target = "tools" }
new NuSpecContent { Source = TOOLS_SOURCE, Target = "tools" }
}
});
});
Expand Down Expand Up @@ -262,7 +275,7 @@ Task("RePackageChocolatey")
new ChocolateyNuSpecContent { Source = PROJECT_DIR + "LICENSE.txt", Target = "tools" },
new ChocolateyNuSpecContent { Source = PROJECT_DIR + "CHANGES.txt", Target = "tools" },
new ChocolateyNuSpecContent { Source = PROJECT_DIR + "VERIFICATION.txt", Target = "tools" },
new ChocolateyNuSpecContent { Source = BIN_SRC + "nunit-project-loader.dll", Target = "tools" }
new ChocolateyNuSpecContent { Source = TOOLS_SOURCE, Target = "tools" }
}
});
});
Expand Down
17 changes: 13 additions & 4 deletions nunit-project-loader.sln
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.30320.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-project-loader", "src\extension\nunit-project-loader.csproj", "{26270E99-C60E-4816-8342-D6BBCFFD4809}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit-project-loader", "src\extension\nunit-project-loader.csproj", "{26270E99-C60E-4816-8342-D6BBCFFD4809}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-project-loader.tests", "src\tests\nunit-project-loader.tests.csproj", "{32A8075A-8DA8-49F8-9222-2DE7B4B6C98E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit-project-loader.tests", "src\tests\nunit-project-loader.tests.csproj", "{32A8075A-8DA8-49F8-9222-2DE7B4B6C98E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3B28CF0C-D613-4971-9D8F-00C960C656E2}"
ProjectSection(SolutionItems) = preProject
build.cake = build.cake
nunit-project-loader.nuspec = nunit-project-loader.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2348254E-9C3B-4C38-B86F-8F1D131E041E}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
build.cake = build.cake
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -31,4 +37,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B07C6102-6B2F-4FC3-9F17-FCD093128F6D}
EndGlobalSection
EndGlobal
61 changes: 8 additions & 53 deletions src/extension/nunit-project-loader.csproj
Original file line number Diff line number Diff line change
@@ -1,62 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{26270E99-C60E-4816-8342-D6BBCFFD4809}</ProjectGuid>
<!-- If adding/updating TargetFrameworks, also update build.cake -->
<TargetFrameworks>net20;netcoreapp2.1</TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NUnit.Engine.Services.ProjectLoaders</RootNamespace>
<AssemblyName>nunit-project-loader</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<OutputPath>..\..\bin\$(Configuration)\</OutputPath>

<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.engine.api, Version=3.0.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnit.Engine.Api.3.7.0\lib\nunit.engine.api.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="SafeAttributeAccess.cs" />
<Compile Include="StringHelper.cs" />
<Compile Include="NUnitProject.cs" />
<Compile Include="NUnitProjectLoader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RunnerSettings.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="nunit.engine.api" Version="3.11.1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
4 changes: 0 additions & 4 deletions src/extension/packages.config

This file was deleted.

74 changes: 12 additions & 62 deletions src/tests/nunit-project-loader.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,62 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{32A8075A-8DA8-49F8-9222-2DE7B4B6C98E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<!-- If adding/updating TargetFrameworks, also update build.cake -->
<!-- Even though we don't support running tests build for netcoreapp2.1 yet, we still build for it -->
<TargetFrameworks>net20;netcoreapp2.1</TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<RootNamespace>NUnit.Engine.Tests</RootNamespace>
<AssemblyName>nunit-project-loader.tests</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>

<OutputPath>..\..\bin\$(Configuration)\</OutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.engine.api, Version=3.0.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnit.Engine.Api.3.7.0\lib\nunit.engine.api.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnit.3.7.1\lib\net20\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NUnit.System.Linq, Version=0.6.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\..\packages\NUnit.3.7.1\lib\net20\NUnit.System.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="NUnitProjectLoaderTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="resources\TestResource.cs" />
<Compile Include="TempResourceFile.cs" />
<PackageReference Include="nunit.engine.api" Version="3.11.1" />
<!-- This is the newest NUnit that support .NET Framework 2.0 -->
<PackageReference Include="NUnit" Version="3.11.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\extension\nunit-project-loader.csproj">
<Project>{26270e99-c60e-4816-8342-d6bbcffd4809}</Project>
<Name>nunit-project-loader</Name>
</ProjectReference>
<ProjectReference Include="..\extension\nunit-project-loader.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="resources\NUnitProject.nunit" />
Expand All @@ -66,15 +27,4 @@
<EmbeddedResource Include="resources\NUnitProject_ManualBinPath.nunit" />
<EmbeddedResource Include="resources\NUnitProject_XmlDecl.nunit" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
5 changes: 0 additions & 5 deletions src/tests/packages.config

This file was deleted.

2 changes: 1 addition & 1 deletion tools/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake" version="0.20.0" />
<package id="Cake" version="0.38.4" />
</packages>

0 comments on commit 5ab70b1

Please sign in to comment.