forked from UbiquityDotNET/Ubiquity.NET.Versioning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
54 lines (48 loc) · 3.74 KB
/
Directory.Build.targets
File metadata and controls
54 lines (48 loc) · 3.74 KB
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
<Project InitialTargets="VerifyProjectSettings;ShowBuildParameters;EnsureBuildOutputPaths">
<Target Name="EnsureBuildOutputPaths">
<MakeDir Condition="!EXISTS($(PackageOutputPath))" Directories="$(PackageOutputPath)"/>
</Target>
<Target Name="ShowBuildParameters">
<Message Importance="normal" Text="Build paths:" />
<Message Importance="normal" Text=" BuildRootDir: $(BuildRootDir)" />
<Message Importance="normal" Text=" BaseBuildOutputPath: $(BaseBuildOutputPath)" />
<Message Importance="normal" Text=" BaseBuildOutputBinPath: $(BaseBuildOutputBinPath)" />
<Message Importance="normal" Text="BaseIntermediateOutputPath: $(BaseIntermediateOutputPath)" />
<Message Importance="normal" Text=" IntDir: $(IntDir)" />
<Message Importance="normal" Text=" BaseOutputPath: $(BaseOutputPath)" />
<Message Importance="normal" Text="Versioning:" />
<Message Importance="normal" Text=" FullBuildNumber: $(FullBuildNumber)"/>
<Message Importance="normal" Text=" PackageVersion: $(PackageVersion)"/>
<Message Importance="normal" Text=" FileVersion: $(FileVersion)"/>
<Message Importance="normal" Text=" AssemblyVersion: $(AssemblyVersion)"/>
<Message Importance="normal" Text=" InformationalVersion: $(InformationalVersion)"/>
<Message Importance="normal" Text=" Platform: $(Platform)"/>
<Message Importance="normal" Text=" Configuration: $(Configuration)"/>
</Target>
<Target Name="VerifyProjectSettings" Condition="'$(MSBuildProjectExtension)'=='.csproj'">
<!--
Detect if something has this horrible non-feature enabled. It is a blight on the build that should never have been added,
let alone used as the default for projects with no way to block/disable it all up...
NOTE:
.editorconfig in this repo includes `csharp_style_prefer_top_level_statements = false:error` to ensure that bad design choice isn't used either.
NOTE:
While the MSBuild `ImplicitUsings` property is banned from this repo, the C# language feature of global usings is NOT.
The build property will auto include an invisible and undiscoverable (without looking up obscure documentation)
set of namespaces that is NOT consistent or controlled by the developer. THAT is what is BAD/BROKEN about that feature.
By banning it's use and then providing a `GlobalNamespaceImports.cs` source file with ONLY global using statements ALL of
that is eliminated. Such use of the language feature restores FULL control and visibility of the namespaces to the developer,
where it belongs. For a good explanation of this problem see: https://rehansaeed.com/the-problem-with-csharp-10-implicit-usings/.
For an explanation of the benefits of the language feature see: https://www.hanselman.com/blog/implicit-usings-in-net-6
-->
<Error Condition="'$(ImplicitUsings)'!='disable'" Code="REPO001" Text="$(MSBuildProjectFile) - Projects in this repository MUST NOT have ImplicitUsings enabled!"/>
<!--
Until issue https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3902 is resolved, this directly tests for the missing stylecop.json file.
Given that was opened nearly a year ago and that it went 2 months to even get a comment about the cause, it seems unlikely that will receive a
fix any time soon...
-->
<Error Code="REPO002" Condition="!Exists('$(MSBuildThisFileDirectory)stylecop.json')" Text="Missing StyleCop.Json file!"/>
<!--
Additional Repo specific checks go here...
-->
</Target>
</Project>