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 compiling the .NET 2.0 version of Mock Assembly in VS2017 #220

Merged
merged 3 commits into from
May 10, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Note that assemblies in one layer must not reference those in any other layer, e
Developers should make sure not to introduce any other references.

There are two ways to build NUnit: using the solution file in an IDE or through the build script.
See also [Building and testing for Linux on a Windows machine](#building-and-testing-for-linux-on-a-windows-machine).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything here copied verbatim from the NUnit repo.


## Solution Build

Expand Down Expand Up @@ -61,3 +62,19 @@ For a full list of tasks, run `build.cmd -ShowDescription`.
you have to be very careful that the build is up to date before packaging.

2. For additional targets, refer to the build.cake script itself.

### Building and testing for Linux on a Windows machine

Most of the time, it's not necessary to build or run tests on platforms other than your primary
platform. The continuous integration which runs on every PR is enough to catch any problems.

Once in a while you may find it desirable to be primarily developing the repository on a Windows
machine but to run Linux tests on the same set of files while you edit them in Windows.
One convenient way to do this is to pass the same arguments to [build-mono-docker.ps1](.\build-mono-docker.ps1) that you would pass to build.ps1. It requires
[Docker](https://docs.docker.com/docker-for-windows/install/) to be installed.

For example, to build and test everything: `.\build-mono-docker.ps1 -t test`

This will run a temporary container using the latest
[Mono image](https://hub.docker.com/r/library/mono/), mounting the repo inside the container
and executing the [build.sh](build.sh) Cake bootstrapper with the arguments you specify.
2 changes: 1 addition & 1 deletion NUnit.Engine.Netstandard.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.engine.tests.netstandard", "src\NUnitEngine\nunit.engine.tests.netstandard\nunit.engine.tests.netstandard.csproj", "{BC22F0E4-0862-4F82-A912-C9A447FECBAD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mock-assembly.netstandard", "src\NUnitEngine\mock-assembly\mock-assembly.netstandard.csproj", "{BC6C8155-2024-4F58-A006-18A15EA22A5C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mock-assembly.netstandard", "src\NUnitEngine\mock-assembly.netstandard\mock-assembly.netstandard.csproj", "{BC6C8155-2024-4F58-A006-18A15EA22A5C}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the .NET Standard version of mock-assembly into its own directory. The newer version of NuGet didn't like finding the .NET Standard version in the main project for some reason and the project.json fix didn't work. I got tired of experimenting, so took the easy route out.

EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.engine.netstandard", "src\NUnitEngine\nunit.engine.netstandard\nunit.engine.netstandard.csproj", "{C26FFC46-60CE-4CBA-87BD-8E9B972C0E0D}"
EndProject
Expand Down
7 changes: 7 additions & 0 deletions build-mono-docker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
trap [Management.Automation.CommandNotFoundException] {
Write-Error 'Docker cannot be found. Make sure it is installed and added to the path.'
Start-Process -FilePath 'https://docs.docker.com/docker-for-windows/install/'
continue;
}

docker run --rm -it -v ${PSScriptRoot}:/nunit-console -w=/nunit-console mono:4.2.4 bash build.sh $args
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use 4.2.4 instead of latest because latest is crashing with a mono bug and we are ignoring those builds in Travis. See #211

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<ItemGroup>
<Compile Include="..\..\CommonAssemblyInfo.cs" Link="Properties\CommonAssemblyInfo.cs" />
<Compile Include="..\EngineVersion.cs" Link="Properties\EngineVersion.cs" />
<Compile Include="..\mock-assembly\Properties\AssemblyInfo.cs" Link="Properties\AssemblyInfo.cs" />
<Compile Include="..\mock-assembly\MockAssembly.cs" Link="MockAssembly.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\mock-assembly\mock-assembly.netstandard.csproj" />
<ProjectReference Include="..\mock-assembly.netstandard\mock-assembly.netstandard.csproj" />
<ProjectReference Include="..\nunit.engine.netstandard\nunit.engine.netstandard.csproj" />
</ItemGroup>

Expand Down