Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building on linux/WSL #1723

Merged
merged 1 commit into from Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 27 additions & 14 deletions Build/Build.cs
Expand Up @@ -76,11 +76,14 @@ class Build : NukeBuild
.DependsOn(Compile)
.Executes(() =>
{
Xunit2(s => s
.SetFramework("net47")
.AddTargetAssemblies(GlobFiles(
Solution.Specs.FluentAssertions_Specs.Directory,
"bin/Debug/net47/*.Specs.dll").NotEmpty()));
if (EnvironmentInfo.IsWin)
{
Xunit2(s => s
.SetFramework("net47")
.AddTargetAssemblies(GlobFiles(
Solution.Specs.FluentAssertions_Specs.Directory,
"bin/Debug/net47/*.Specs.dll").NotEmpty()));
}

DotNetTest(s => s
.SetProjectFile(Solution.Specs.FluentAssertions_Specs)
Expand All @@ -95,20 +98,30 @@ class Build : NukeBuild
.DependsOn(Compile)
.Executes(() =>
{
var testCombinations =
from project in new[]
{
Solution.TestFrameworks.MSpec_Specs,
Solution.TestFrameworks.MSTestV2_Specs,
Solution.TestFrameworks.NUnit3_Specs,
Solution.TestFrameworks.XUnit2_Specs
}
let frameworks = project.GetTargetFrameworks()
let supportedFrameworks = EnvironmentInfo.IsWin ? frameworks : frameworks.Except(new[] { "net47" })
from framework in supportedFrameworks
select new { project, framework };

DotNetTest(s => s
.SetConfiguration("Debug")
.EnableNoBuild()
.CombineWith(
new[]
{
Solution.TestFrameworks.MSpec_Specs,
Solution.TestFrameworks.MSTestV2_Specs,
Solution.TestFrameworks.NUnit3_Specs,
Solution.TestFrameworks.XUnit2_Specs
},
(_, v) => _.SetProjectFile(v)));
testCombinations,
(_, v) => _.SetProjectFile(v.project).SetFramework(v.framework)));

NSpec3(Solution.TestFrameworks.NSpec3_Net47_Specs.Directory / "bin" / "Debug" / "net47" / "NSpec3.Specs.dll");
if (EnvironmentInfo.IsWin)
{
NSpec3(Solution.TestFrameworks.NSpec3_Net47_Specs.Directory / "bin" / "Debug" / "net47" / "NSpec3.Specs.dll");
}
});

Target Pack => _ => _
Expand Down
2 changes: 1 addition & 1 deletion Tests/TestFrameworks/MSTestV2.Specs/MSTestV2.Specs.csproj
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>MSTestV2.Specs</RootNamespace>
<AssemblyName>MSTestV2.Specs</AssemblyName>
<CodeAnalysisRuleSet>..\..\..\TestRules.ruleset</CodeAnalysisRuleSet>
Expand Down
2 changes: 1 addition & 1 deletion Tests/TestFrameworks/MSpec.Specs/MSpec.Specs.csproj
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>MSpec.Specs</RootNamespace>
<AssemblyName>MSpec.Specs</AssemblyName>
<CodeAnalysisRuleSet>Rules.ruleset</CodeAnalysisRuleSet>
Expand Down
2 changes: 1 addition & 1 deletion Tests/TestFrameworks/NUnit3.Specs/NUnit3.Specs.csproj
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>NUnit3.Specs</RootNamespace>
<AssemblyName>NUnit3.Specs</AssemblyName>
<CodeAnalysisRuleSet>..\..\..\TestRules.ruleset</CodeAnalysisRuleSet>
Expand Down
2 changes: 1 addition & 1 deletion Tests/TestFrameworks/XUnit2.Specs/XUnit2.Specs.csproj
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net47;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net47;net5.0</TargetFrameworks>
<RootNamespace>XUnit2.Specs</RootNamespace>
<AssemblyName>XUnit2.Specs</AssemblyName>
<CodeAnalysisRuleSet>..\..\..\TestRules.ruleset</CodeAnalysisRuleSet>
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Expand Up @@ -9,7 +9,7 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
# CONFIGURATION
###########################################################################

BUILD_PROJECT_FILE="$SCRIPT_DIR/build/_build.csproj"
BUILD_PROJECT_FILE="$SCRIPT_DIR/Build/_build.csproj"
TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"

DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
Expand Down