forked from Sergio0694/ComputeSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
87 lines (73 loc) · 4.22 KB
/
Directory.Build.targets
File metadata and controls
87 lines (73 loc) · 4.22 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
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
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="..\build\Directory.Build.targets" />
<!-- Check whether any analyzers are available for packing -->
<PropertyGroup Condition="$(IsPackagedProject)">
<!-- Source generator project, if available -->
<IsSourceGeneratorAvailableForPacking>false</IsSourceGeneratorAvailableForPacking>
<IsSourceGeneratorAvailableForPacking Condition="Exists('..\$(MSBuildProjectName).SourceGenerators')">true</IsSourceGeneratorAvailableForPacking>
<!-- Code fixers project, if available -->
<IsCodeFixersAvailableForPacking>false</IsCodeFixersAvailableForPacking>
<IsCodeFixersAvailableForPacking Condition="Exists('..\$(MSBuildProjectName).CodeFixers')">true</IsCodeFixersAvailableForPacking>
</PropertyGroup>
<!-- Pack the source generator, if present -->
<ItemGroup Condition="'$(IsSourceGeneratorAvailableForPacking)' == 'true'" Label="Package">
<!-- Source generator reference (to trigger building the generator) -->
<ProjectReference Include="..\$(MSBuildProjectName).SourceGenerators\$(MSBuildProjectName).SourceGenerators.csproj"
ReferenceOutputAssembly="false" />
<!-- Pack the source generator from its output directory (source generators always use .NET Standard 2.0) -->
<None Include="..\$(MSBuildProjectName).SourceGenerators\bin\$(Configuration)\netstandard2.0\$(MSBuildProjectName).SourceGenerators.dll"
PackagePath="analyzers\dotnet\cs"
Pack="true"
Visible="false" />
</ItemGroup>
<!-- Pack the code fixers, if present -->
<ItemGroup Condition="'$(IsCodeFixersAvailableForPacking)' == 'true'" Label="Package">
<!-- Code fixers reference (to trigger building the project) -->
<ProjectReference Include="..\$(MSBuildProjectName).CodeFixers\$(MSBuildProjectName).CodeFixers.csproj"
ReferenceOutputAssembly="false" />
<!-- Pack the code fixers project from its output directory -->
<None Include="..\$(MSBuildProjectName).CodeFixers\bin\$(Configuration)\netstandard2.0\$(MSBuildProjectName).CodeFixers.dll"
PackagePath="analyzers\dotnet\cs"
Pack="true"
Visible="false" />
</ItemGroup>
<!--
The following target has been ported from TerraFX.Interop.Windows.
See: https://github.com/terrafx/terrafx.interop.windows.
This generates the [module: SkipLocalsInit] attribute for all projects.
-->
<PropertyGroup>
<GeneratedSkipLocalsInitFile Condition="'$(GeneratedSkipLocalsInitFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).SkipLocalsInit.g.cs</GeneratedSkipLocalsInitFile>
<GeneratedSkipLocalsInitFileLines>
<![CDATA[//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[module: System.Runtime.CompilerServices.SkipLocalsInitAttribute]]]>
</GeneratedSkipLocalsInitFileLines>
</PropertyGroup>
<Target Name="GenerateSkipLocalsInit"
BeforeTargets="BeforeCompile;CoreCompile"
DependsOnTargets="PrepareForBuild"
Condition="'$(Language)' == 'C#'"
Inputs="$(MSBuildAllProjects)"
Outputs="$(GeneratedSkipLocalsInitFile)">
<!-- Write the file with the attribute -->
<WriteLinesToFile Lines="$(GeneratedSkipLocalsInitFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" File="$(GeneratedSkipLocalsInitFile)" />
<!-- Include the generated file in the list of files to compile -->
<ItemGroup>
<Compile Include="$(GeneratedSkipLocalsInitFile)" />
</ItemGroup>
</Target>
<!-- Emit an error if our custom 'BeforeMicrosoftNETSdkTargets' .targets file has not been invoked -->
<Target Name="_ComputeSharpCheckForInvalidBeforeMicrosoftNETSdkTargets"
BeforeTargets="_CheckForInvalidConfigurationAndPlatform;CoreCompile">
<Error Condition ="'$(_ComputeSharpBeforeMicrosoftNETSdkTargetsValid)' != 'true'"
Text="The '_ComputeSharpBeforeMicrosoftNETSdkTargetsValid' marker property is not set."/>
</Target>
</Project>