diff options
author | Matt Ward <matt.ward@microsoft.com> | 2021-02-19 15:56:51 +0300 |
---|---|---|
committer | Matt Ward <matt.ward@microsoft.com> | 2021-02-19 17:05:26 +0300 |
commit | ae7377ed39bb739c5343c7703604ea97c70464f6 (patch) | |
tree | 78d03a6468dd87ab89b85009e483e5a583f84585 /Test | |
parent | 6773e884d8f2caf28f5bd61c35ee77a959deb49f (diff) |
UnitTests now local copy setup process executable
Before the UnitTests was using a ProjectReference without
ReferenceOutputAssembly set to false. This would prevent
the project building if the SetupProcess project was
targeting an incompatible target framework, such as .NET
Core. Now ReferenceOutputAssembly is set to false on the
project reference and the executable files are copied in
a custom msbuild target after the build finishes. Also
have to add SkipGetTargetFrameworkProperties to true
for the project reference to workaround an MSBuild bug
where the build fails with UnitTests referencing a
.NET Core 3.1 SetupProcess project even though it does
not compile against its assemblies.
Diffstat (limited to 'Test')
-rw-r--r-- | Test/UnitTests/UnitTests.csproj | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/Test/UnitTests/UnitTests.csproj b/Test/UnitTests/UnitTests.csproj index 5f08df7..30d2358 100644 --- a/Test/UnitTests/UnitTests.csproj +++ b/Test/UnitTests/UnitTests.csproj @@ -31,21 +31,13 @@ <PackageReference Include="NUnit3TestAdapter" Version="3.17.0" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\Mono.Addins\Mono.Addins.csproj"> - <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project> - <Name>Mono.Addins</Name> - </ProjectReference> - <ProjectReference Include="..\..\Mono.Addins.CecilReflector\Mono.Addins.CecilReflector.csproj"> - <Project>{42D1CE65-A14B-4218-B787-58AD7AA68513}</Project> - <Name>Mono.Addins.CecilReflector</Name> - </ProjectReference> - <ProjectReference Include="..\..\Mono.Addins.Setup\Mono.Addins.Setup.csproj"> - <Project>{A85C9721-C054-4BD8-A1F3-0227615F0A36}</Project> - <Name>Mono.Addins.Setup</Name> - </ProjectReference> + <ProjectReference Include="..\..\Mono.Addins\Mono.Addins.csproj" /> + <ProjectReference Include="..\..\Mono.Addins.CecilReflector\Mono.Addins.CecilReflector.csproj" /> + <ProjectReference Include="..\..\Mono.Addins.Setup\Mono.Addins.Setup.csproj" /> <ProjectReference Include="..\..\Mono.Addins.SetupProcess\Mono.Addins.SetupProcess.csproj"> - <Project>{303D2716-94AA-4067-8111-F478D26DFAFE}</Project> - <Name>Mono.Addins.SetupProcess</Name> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + <!-- Workaround for build error - https://github.com/dotnet/msbuild/issues/2661 --> + <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties> </ProjectReference> </ItemGroup> <ItemGroup> @@ -85,4 +77,13 @@ <Compile Remove="TestFileDatabase.cs" /> <Compile Remove="TestLocalization.cs" /> </ItemGroup> + <Target Name="_UnitTestsAfterBuild" AfterTargets="AfterBuild"> + <PropertyGroup> + <MonoAddinsSetupProcessOutputDir>..\..\bin\</MonoAddinsSetupProcessOutputDir> + </PropertyGroup> + <ItemGroup> + <MonoAddinsSetupProcessFile Include="$(MonoAddinsSetupProcessOutputDir)Mono.Addins.SetupProcess.*" /> + </ItemGroup> + <Copy SourceFiles="@(MonoAddinsSetupProcessFile)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" /> + </Target> </Project> |