forked from rubberduck-vba/Rubberduck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RubberduckBaseProject.csproj
131 lines (122 loc) · 6.7 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
<Project Skd="Microsoft.NET.Sdk">
<!--
We're specifying the Sdk here to make sure appveyor correctly recognizes this as a .NET Core project
Unfortunately this generates the warning MSB4011, because the including projects already define an Sdk
-->
<PropertyGroup>
<OutputType>Library</OutputType>
<Company>Rubberduck-VBA</Company>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFramework>net461</TargetFramework>
<LangVersion>7.2</LangVersion>
<SolutionDir>$(MSBuildProjectDirectory)</SolutionDir>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputPath>bin\$(Configuration)\</OutputPath>
<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;1591</DisabledWarnings>
<!-- Declare a Version if it's not already declared as a global property through MSBuild invocation -->
<Version Condition=" '$(Version)' == '' ">2.5.2</Version>
<!-- all other relevant version numbers are computed from Version automagically -->
</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>
<!-- Valid Constants used in the solution:
LOG_COM_RELEASE // Records COM objects released when a safe COM wrapper has been disposed
PRETTY_XML // Includes whitespace and formatting to serialized XML files for XmlComProjectSerializer
REF_COUNT // Tracks the reported reference counts when acquiring/disposing COM objects
THRISTY_DUCK // Outputs the message content from the message pump in VBENativeServices / SubclassingWindow
THRISTY_DUCK_EVT // Outptus the events raised from the message pump in VBENativeServices / SubclassingWindow
TRACE_COM_SAFE // Tracks the COM wrappers added & removed to the ComSafe and also allow serializing the contents of ComSafe
TRACE_TYPEAPI // Tracks the methods called on the wrapped ITypeLib & ITypeInfo
TRACE_COM_POINTERS // Tracks the ComPointer access & disposal
TRACE_MARSHAL // Tracks the calls made through the RdMarshal class (useful for tracking all Marshal methods)
-->
<DefineConstants>DEBUG;TRACE;</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>RELEASE</DefineConstants>
</PropertyGroup>
<!-- 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>