From f016c7b5bb0bf48f890f67f8c3289e7e9f64c802 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 26 May 2019 21:08:25 -0600 Subject: [PATCH 1/2] Fix `dotnet build` of a clean repo For a perfectly clean repo (git clean -fdx), `dotnet build` fails because some tests require that other projects have been built using build.proj first. This change adds the necessary build ordering instructions so that the build tasks are always built before the tests that need them, and the tests are always run against the *latest* source code being tested rather than the last version that happened to be built with build.proj. --- build.proj | 14 +------------ .../coverlet.msbuild.props | 3 +++ .../coverlet.msbuild.targets | 4 ++-- test/Directory.Build.targets | 20 +++++++++++++++++++ .../coverlet.core.performancetest.csproj | 4 ++-- .../coverlet.core.tests.csproj | 4 ++-- 6 files changed, 30 insertions(+), 19 deletions(-) create mode 100644 test/Directory.Build.targets diff --git a/build.proj b/build.proj index 3778c6379..2c9b2e955 100644 --- a/build.proj +++ b/build.proj @@ -13,19 +13,7 @@ - - - - - - - - - - - - - + diff --git a/src/coverlet.msbuild.tasks/coverlet.msbuild.props b/src/coverlet.msbuild.tasks/coverlet.msbuild.props index c9d21109b..e6906ccc3 100644 --- a/src/coverlet.msbuild.tasks/coverlet.msbuild.props +++ b/src/coverlet.msbuild.tasks/coverlet.msbuild.props @@ -16,4 +16,7 @@ line,branch,method minimum + + $(MSBuildThisFileDirectory) + diff --git a/src/coverlet.msbuild.tasks/coverlet.msbuild.targets b/src/coverlet.msbuild.tasks/coverlet.msbuild.targets index effbc421c..c6cbb404d 100644 --- a/src/coverlet.msbuild.tasks/coverlet.msbuild.targets +++ b/src/coverlet.msbuild.tasks/coverlet.msbuild.targets @@ -1,7 +1,7 @@ - - + + + + + + + + + false + + + + + $(MSBuildThisFileDirectory)..\src\coverlet.msbuild.tasks\bin\$(Configuration)\netstandard2.0\ + + + + \ No newline at end of file diff --git a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj index 9e471b9bf..af4d3080d 100644 --- a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj +++ b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj @@ -1,5 +1,5 @@  - + netcoreapp2.0 @@ -15,5 +15,5 @@ - + diff --git a/test/coverlet.core.tests/coverlet.core.tests.csproj b/test/coverlet.core.tests/coverlet.core.tests.csproj index a44b0e7b9..2b6903b32 100644 --- a/test/coverlet.core.tests/coverlet.core.tests.csproj +++ b/test/coverlet.core.tests/coverlet.core.tests.csproj @@ -1,5 +1,5 @@  - + netcoreapp2.0 @@ -19,5 +19,5 @@ - + From dfda81a1f42f35a1cae7cadd7ad03a83769cdd6d Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 26 May 2019 21:14:33 -0600 Subject: [PATCH 2/2] Define RepoRoot property for simpler paths --- Directory.Build.props | 1 + test/Directory.Build.targets | 4 ++-- .../coverlet.collector.tests.csproj | 4 ++-- .../coverlet.core.performancetest.csproj | 4 ++-- test/coverlet.core.tests/coverlet.core.tests.csproj | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 7a0f467c8..84cb4ce8d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,7 @@ + $(MSBuildThisFileDirectory) $(MSBuildThisFileDirectory)build\$(Configuration)\ diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 58f0255b5..050fa6862 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -4,7 +4,7 @@ - + false @@ -13,7 +13,7 @@ This is required when the coverlet.msbuild imports are made in their src directory (so that msbuild eval works even before they are built) so that they can still find the tooling that will be built by the build. --> - $(MSBuildThisFileDirectory)..\src\coverlet.msbuild.tasks\bin\$(Configuration)\netstandard2.0\ + $(RepoRoot)src\coverlet.msbuild.tasks\bin\$(Configuration)\netstandard2.0\ diff --git a/test/coverlet.collector.tests/coverlet.collector.tests.csproj b/test/coverlet.collector.tests/coverlet.collector.tests.csproj index dce1752be..9831caf3c 100644 --- a/test/coverlet.collector.tests/coverlet.collector.tests.csproj +++ b/test/coverlet.collector.tests/coverlet.collector.tests.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj index af4d3080d..dd65bf3a7 100644 --- a/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj +++ b/test/coverlet.core.performancetest/coverlet.core.performancetest.csproj @@ -1,5 +1,5 @@  - + netcoreapp2.0 @@ -15,5 +15,5 @@ - + diff --git a/test/coverlet.core.tests/coverlet.core.tests.csproj b/test/coverlet.core.tests/coverlet.core.tests.csproj index 2b6903b32..56cf06cae 100644 --- a/test/coverlet.core.tests/coverlet.core.tests.csproj +++ b/test/coverlet.core.tests/coverlet.core.tests.csproj @@ -1,5 +1,5 @@  - + netcoreapp2.0 @@ -16,8 +16,8 @@ - + - +