forked from rubberduck-vba/Rubberduck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RubberduckBaseProject.csproj
136 lines (125 loc) · 6.63 KB
/
RubberduckBaseProject.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<Project Sdk="Sunburst.NET.Sdk.WPF.Patched/1.0.49">
<!-- We're specifying the Sdk here to make appveyor happy, but this generates warning MSB4011 -->
<PropertyGroup>
<OutputType>Library</OutputType>
<Company>Rubberduck-VBA</Company>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFramework>net46</TargetFramework>
<LangVersion>7.2</LangVersion>
<SolutionDir>$(MSBuildProjectDirectory)</SolutionDir>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputPath>bin\$(Configuration)\</OutputPath>
<RunCodeAnalysis>true</RunCodeAnalysis>
<RestorePackages>true</RestorePackages>
<!-- do not unify output paths by default -->
<UnifyOutputPath Condition=" '$(UnifyOutputPath)' == ''">false</UnifyOutputPath>
<!-- Ignore MSB4011 warning, rationale above -->
<!-- Ignore VisualStudio whining about the CodeAnalysis assembly changing (IDE1001) -->
<DisabledWarnings>$(DisabledWarnings);4011;1001</DisabledWarnings>
<Version Condition=" '$(Version)' == ''">2.5.1</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(AssemblyVersion)' == '' ">
<!--
This assembly version specification is considered nonstandard.
As such builds that do not override the assembly version generate a warning, which we ignore.
-->
<AssemblyVersion>2.5.1.*</AssemblyVersion>
<!-- Ignore CSharp compiler warning for nonstandard assembly version (CS7035) -->
<!-- Ignore Linker warning for nonstandard assembly version (AL1053) -->
<DisabledWarnings>$(DisabledWarnings);7035;1053</DisabledWarnings>
<!-- 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 -->
<ItemGroup Condition=" '$(AssemblyName)' != 'RubberduckTests'
AND '$(AssemblyName)' != 'RubberduckCodeAnalysis'
AND '$(AssemblyName)' != 'RubberduckTestsCodeAnalysis'">
<Analyzer Include="$(SolutionDir)\RubberduckCodeAnalysis\bin\RubberduckCodeAnalysis.dll" />
</ItemGroup>
<!-- Commented out due to large number of false positives. Hopefully the package
will get annotations, which would enable us to exclude those false positives.
Ref: https://github.com/DotNetAnalyzers/IDisposableAnalyzers/issues/126
<ItemGroup>
<PackageReference Include="IDisposableAnalyzers">
<Version>2.0.5</Version>
</PackageReference>
</ItemGroup>
-->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>RELEASE</DefineConstants>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- This section does not work; it seems to find the solution fine but doesn't actually build
so we work around this by enumerating the projects in the next section below
<Target Name="EnsureMetaProjectsBuild" BeforeTargets="PrepareForBuild"
Condition="!Exists('$(SolutionDir)RubberduckCodeAnalysis\bin\RubberduckCodeAnalysis.dll')">
<Message Text="Missing the required meta projects. Building the meta projects..." Importance="high" />
<MSBuild Projects="$(SolutionDir)\RubberduckMeta.sln"
Targets="Build"
Properties="Configuration=Release">
<Output TaskParameter="TargetOutputs"
ItemName="MetaAssemblies" />
</MSBuild>
<Message Text="Built the meta projects" Importance="high" />
</Target>
-->
<ItemGroup>
<MetaProjects Include="$(SolutionDir)\RubberduckCodeAnalysis\RubberduckCodeAnalysis.csproj">
<Properties>Configuration=Release</Properties>
</MetaProjects>
<MetaProjects Include="$(SolutionDir)\Rubberduck.Deployment.Build\Rubberduck.Deployment.Build.csproj">
<Properties>Configuration=Release</Properties>
</MetaProjects>
<MetaProjects Include="$(SolutionDir)\RubberduckTestsCodeAnalysis\RubberduckTestsCodeAnalysis.csproj">
<Properties>Configuration=Release</Properties>
</MetaProjects>
</ItemGroup>
<Target Name="EnsureMetaProjectsBuild" BeforeTargets="PrepareForBuild"
Condition="!Exists('$(SolutionDir)RubberduckCodeAnalysis\bin\RubberduckCodeAnalysis.dll') OR !Exists('$(SolutionDir)Rubberduck.Deployment.Build\bin\Rubberduck.Deployment.Build.dll') OR !Exists('$(SolutionDir)RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll')">
<Message Text="Missing the required meta projects. Building the meta projects..." Importance="high" />
<MSBuild Projects="@(MetaProjects)"
BuildInParallel="false"
ContinueOnError="false"
SkipNonexistentProjects="false"
StopOnFirstFailure="true"
UnloadProjectsOnCompletion="true"
UseResultsCache="false"
RebaseOutputs="true"
Targets="Restore"/>
<MSBuild Projects="@(MetaProjects)"
BuildInParallel="false"
ContinueOnError="false"
SkipNonexistentProjects="false"
StopOnFirstFailure="true"
UnloadProjectsOnCompletion="true"
UseResultsCache="false"
RebaseOutputs="true"/>
<Message Text="Built the meta projects" Importance="high" />
</Target>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<PropertyGroup>
<!--
Visual Studio warning ignores work through NoWarn and ignore DisabledWarnings.
Accordingly we amend NoWarn to include DisabledWarnings.
-->
<NoWarn>$(NoWarn);$(DisabledWarnings)</NoWarn>
</PropertyGroup>
</Project>