Skip to content

Commit

Permalink
Simplify Output Paths for Analyzers and Test assembly
Browse files Browse the repository at this point in the history
Update path to TestAssemblies to not contain Configuration
  • Loading branch information
Vogel612 committed Oct 7, 2018
1 parent 4abb375 commit 26d6e18
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
18 changes: 16 additions & 2 deletions RubberduckBaseProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,38 @@
<OutputPath>bin\$(Configuration)\</OutputPath>
<RunCodeAnalysis>true</RunCodeAnalysis>
<RestorePackages>true</RestorePackages>
<!-- do not unify output paths by default -->
<UnifyOutputPath Condition=" '$(UnifyOutputPath)' == ''">false</UnifyOutputPath>
</PropertyGroup>

<PropertyGroup Condition=" '$(AssemblyVersion)' == ''">
<!--
This assembly version specification is considered nonstandard.
As such builds that do not override the assembly version generate a warning.
-->
<AssemblyVersion>2.2.*</AssemblyVersion>
<FileVersion Condition=" '$(FileVersion)' == '' ">2.2.*</FileVersion>
<!-- Wildcards are not deterministic, ensure build passes when setting wildcard versions -->
<Deterministic>False</Deterministic>
</PropertyGroup>

<PropertyGroup Condition=" $(UnifyOutputPath) ">
<OutputPath>bin\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>

<!-- Analyzer projects must set UnifyOutputPath to have this reference correctly -->
<Choose>
<When Condition=" '$(AssemblyName)' == 'RubberduckTests' ">
<ItemGroup>
<Analyzer Include="$(SolutionDir)\RubberduckTestsCodeAnalysis\bin\Release\$(TargetFramework)\RubberduckTestsCodeAnalysis.dll"/>
<Analyzer Include="$(SolutionDir)\RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll"/>
</ItemGroup>
</When>
<When Condition=" '$(AssemblyName)' == 'RubberduckCodeAnalysis' OR '$(AssemblyName)' == 'RubberduckTestsCodeAnalysis'" />
<Otherwise>
<ItemGroup>
<Analyzer Include="$(SolutionDir)\RubberduckCodeAnalysis\bin\Release\$(TargetFramework)\RubberduckCodeAnalysis.dll" />
<Analyzer Include="$(SolutionDir)\RubberduckCodeAnalysis\bin\RubberduckCodeAnalysis.dll" />
</ItemGroup>
</Otherwise>
</Choose>
Expand Down
2 changes: 2 additions & 0 deletions RubberduckCodeAnalysis/RubberduckCodeAnalysis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<!-- default to release, since this is code analysis. we want it fast -->
<Configuration>Release</Configuration>
<ProjectGuid>{F83B6746-49A6-4CFD-9A29-3D7BBD4F0323}</ProjectGuid>

<UnifyOutputPath>true</UnifyOutputPath>
</PropertyGroup>
<Import Project="..\RubberduckBaseProject.csproj" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand Down
2 changes: 2 additions & 0 deletions RubberduckTests/RubberduckTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>

<UnifyOutputPath>true</UnifyOutputPath>
</PropertyGroup>
<Import Project="..\RubberduckBaseProject.csproj" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<ProjectGuid>{E9FC6518-F9E8-4E57-BD28-583A9EA69297}</ProjectGuid>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PlatformTarget Condition=" '$(Platform)' == 'AnyCPU' ">AnyCPU</PlatformTarget>

<UnifyOutputPath>true</UnifyOutputPath>
</PropertyGroup>
<Import Project="..\RubberduckBaseProject.csproj" />

Expand Down
8 changes: 5 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ build:
verbosity: minimal
project: Rubberduck.sln

# TestScript depends on the build matrix to only contain Release cpu
# Otherwise we might run tests against artifacts that do not exist
test_script:
# we use -returntargetcode to fail the build if tests fail
- OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTests\bin\Release\RubberduckTests.dll" -output:".\Rubberduck_Coverage.xml"
- OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTestsCodeAnalysis\bin\Release\RubberduckTestsCodeAnalysis.dll" -output:".\RubberduckCodeAnalysis_Coverage.xml"
- OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTests\bin\RubberduckTests.dll" -output:".\Rubberduck_Coverage.xml"
- OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll" -output:".\RubberduckCodeAnalysis_Coverage.xml"
# when using test_script, after_test seems to not be executed
- codecov -f "Rubberduck_Coverage.xml"
- codecov -f "Rubberduck_Coverage.xml RubberduckCodeAnalysis_Coverage.xml"

for:
- branches:
Expand Down

0 comments on commit 26d6e18

Please sign in to comment.