diff options
Diffstat (limited to '.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/GenerateInternalsVisibleTo.targets')
-rwxr-xr-x | .packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/GenerateInternalsVisibleTo.targets | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/GenerateInternalsVisibleTo.targets b/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/GenerateInternalsVisibleTo.targets new file mode 100755 index 0000000000..424c76d24e --- /dev/null +++ b/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/GenerateInternalsVisibleTo.targets @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> +<Project> + <PropertyGroup> + <GeneratedInternalsVisibleToFile>$(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension)</GeneratedInternalsVisibleToFile> + </PropertyGroup> + + <ItemDefinitionGroup> + <InternalsVisibleTo> + <Visible>false</Visible> + </InternalsVisibleTo> + </ItemDefinitionGroup> + + <Target Name="PrepareGenerateInternalsVisibleToFile" Condition="'@(InternalsVisibleTo)' != ''"> + <ItemGroup> + <_InternalsVisibleToAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"> + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' != ''">%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key)</_Parameter1> + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == '' and '$(PublicKey)' != ''">%(InternalsVisibleTo.Identity), PublicKey=$(PublicKey)</_Parameter1> + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == '' and '$(PublicKey)' == ''">%(InternalsVisibleTo.Identity)</_Parameter1> + </_InternalsVisibleToAttribute> + </ItemGroup> + </Target> + + <!-- + Dependency on PrepareForBuild is necessary so that we don't accidentally get ordered before it. + We rely on PrepareForBuild to create the IntermediateOutputDirectory if it doesn't exist. + --> + <Target Name="GenerateInternalsVisibleToFile" + Inputs="$(MSBuildThisFileFullPath);$(MSBuildProjectFile)" + Outputs="$(GeneratedInternalsVisibleToFile)" + DependsOnTargets="PrepareGenerateInternalsVisibleToFile;PrepareForBuild" + Condition="'@(InternalsVisibleTo)' != ''" + BeforeTargets="CoreCompile"> + + <WriteCodeFragment AssemblyAttributes="@(_InternalsVisibleToAttribute)" + Language="$(Language)" + OutputFile="$(GeneratedInternalsVisibleToFile)"> + <Output TaskParameter="OutputFile" ItemName="CompileBefore" Condition="'$(Language)' == 'F#'" /> + <Output TaskParameter="OutputFile" ItemName="Compile" Condition="'$(Language)' != 'F#'" /> + <Output TaskParameter="OutputFile" ItemName="FileWrites" /> + </WriteCodeFragment> + </Target> + +</Project> |