-
Notifications
You must be signed in to change notification settings - Fork 0
/
LiteralAssemblyAttributeItemGroup.targets
43 lines (35 loc) · 1.68 KB
/
LiteralAssemblyAttributeItemGroup.targets
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
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<LiteralAssemblyAttribute Include="global::System.CLSCompliantAttribute" Condition="'$(IsCLSCompliant)' != ''">
<_Parameters>$(IsCLSCompliant)</_Parameters>
</LiteralAssemblyAttribute>
</ItemGroup>
<PropertyGroup>
<_LiteralAssemblyFile Condition="'$(Language)' == 'C#'">$(IntermediateOutputPath)LiteralAssemblyAttributes.cs</_LiteralAssemblyFile>
<CoreCompileDependsOn>
AddLiteralAssemblyAttributes;
$(CoreCompileDependsOn);
</CoreCompileDependsOn>
</PropertyGroup>
<Target Name="AddLiteralAssemblyAttributes"
BeforeTargets="CoreCompile"
Condition="'$(Language)' == 'C#'"
Inputs="$(MSBuildAllProjects)"
Outputs="$(_LiteralAssemblyFile)">
<ItemGroup>
<Compile Include="$(_LiteralAssemblyFile)" />
</ItemGroup>
<ItemGroup>
<_LiteralAssemblyAttrDecls Include="// <autogenerated />" />
<_LiteralAssemblyAttrDecls Include="extern alias %(LiteralAssemblyAttributeExternAlias.Identity);"
Condition="'%(LiteralAssemblyAttributeExternAlias.Identity)' != ''" />
<_LiteralAssemblyAttrDecls Include="[assembly: %(LiteralAssemblyAttribute.Identity)(%(LiteralAssemblyAttribute._Parameters))]"
Condition="'%(LiteralAssemblyAttribute.Identity)' != ''" />
</ItemGroup>
<WriteLinesToFile File="$(_LiteralAssemblyFile)" Encoding="UTF-8" Lines="@(_LiteralAssemblyAttrDecls)" Overwrite="true" />
<ItemGroup>
<FileWrites Include="$(_LiteralAssemblyFile)" />
</ItemGroup>
</Target>
</Project>