|
| 1 | +<Project> |
| 2 | + |
| 3 | + <Import Project="GitHash.props" /> |
| 4 | + |
| 5 | + <PropertyGroup> |
| 6 | + <GeneratedFSharpInternalsVisibleToFile>$(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension)</GeneratedFSharpInternalsVisibleToFile> |
| 7 | + </PropertyGroup> |
| 8 | + |
| 9 | + <ItemDefinitionGroup> |
| 10 | + <InternalsVisibleTo> |
| 11 | + <Visible>false</Visible> |
| 12 | + </InternalsVisibleTo> |
| 13 | + </ItemDefinitionGroup> |
| 14 | + |
| 15 | + <Target Name="PrepareFSharpGenerateInternalsVisibleToFile" |
| 16 | + Condition="'@(InternalsVisibleTo)' != ''"> |
| 17 | + <PropertyGroup> |
| 18 | + <_PublicKey>002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293</_PublicKey> |
| 19 | + </PropertyGroup> |
| 20 | + <ItemGroup> |
| 21 | + <_InternalsVisibleToAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"> |
| 22 | + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' != ''">%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key)</_Parameter1> |
| 23 | + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == ''">%(InternalsVisibleTo.Identity), PublicKey=$(_PublicKey)</_Parameter1> |
| 24 | + </_InternalsVisibleToAttribute> |
| 25 | + </ItemGroup> |
| 26 | + </Target> |
| 27 | + |
| 28 | + <Target Name="GenerateFSharpInternalsVisibleToFile" |
| 29 | + Inputs="$(MSBuildProjectFile)" |
| 30 | + Outputs="$(GeneratedFSharpInternalsVisibleToFile)" |
| 31 | + DependsOnTargets="PrepareFSharpGenerateInternalsVisibleToFile;PrepareForBuild" |
| 32 | + Condition="'$(Configuration)' != 'Proto' and '@(InternalsVisibleTo)' != ''" |
| 33 | + BeforeTargets="CoreCompile"> |
| 34 | + <WriteCodeFragment AssemblyAttributes="@(_InternalsVisibleToAttribute)" |
| 35 | + Language="$(Language)" |
| 36 | + OutputFile="$(GeneratedFSharpInternalsVisibleToFile)"> |
| 37 | + <Output TaskParameter="OutputFile" ItemName="CompileBefore" /> |
| 38 | + <Output TaskParameter="OutputFile" ItemName="FileWrites" /> |
| 39 | + </WriteCodeFragment> |
| 40 | + </Target> |
| 41 | + |
| 42 | + <Target Name="GenerateAssemblyFileVersion" |
| 43 | + BeforeTargets="CoreCompile" |
| 44 | + Condition="'$(Configuration)' != 'Proto'"> |
| 45 | + <PropertyGroup> |
| 46 | + <GeneratedFSharpAssemblyVersionFile>$(IntermediateOutputPath)$(MSBuildProjectName).AssemblyAttributes$(DefaultLanguageSourceExtension)</GeneratedFSharpAssemblyVersionFile> |
| 47 | + <!-- AssemblyInformationalVersionAttribute issues a by-design warning if the value passed isn't of the form #.#.#.#, but we specifically want to suppress this to allow the commit hash to be embedded. --> |
| 48 | + <NoWarn Condition="'$(Language)' == 'F#'">2003;$(NoWarn)</NoWarn> |
| 49 | + </PropertyGroup> |
| 50 | + |
| 51 | + <ItemGroup> |
| 52 | + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyCompanyAttribute"> |
| 53 | + <_Parameter1>Microsoft Corporation</_Parameter1> |
| 54 | + </_AssemblyVersionAttributes> |
| 55 | + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyCopyrightAttribute"> |
| 56 | + <_Parameter1>© Microsoft Corporation. All Rights Reserved.</_Parameter1> |
| 57 | + </_AssemblyVersionAttributes> |
| 58 | + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyDescriptionAttribute"> |
| 59 | + <_Parameter1>$(AssemblyName).dll</_Parameter1> |
| 60 | + </_AssemblyVersionAttributes> |
| 61 | + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyFileVersionAttribute"> |
| 62 | + <_Parameter1>$(Build_FileVersion)</_Parameter1> |
| 63 | + </_AssemblyVersionAttributes> |
| 64 | + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyInformationalVersionAttribute"> |
| 65 | + <_Parameter1>$(MicroBuildAssemblyVersion). Commit Hash: $(GitHeadSha).</_Parameter1> |
| 66 | + </_AssemblyVersionAttributes> |
| 67 | + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyProductAttribute"> |
| 68 | + <_Parameter1>Microsoft® F#</_Parameter1> |
| 69 | + </_AssemblyVersionAttributes> |
| 70 | + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyTitleAttribute"> |
| 71 | + <_Parameter1>$(AssemblyName).dll</_Parameter1> |
| 72 | + </_AssemblyVersionAttributes> |
| 73 | + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyVersionAttribute"> |
| 74 | + <_Parameter1>$(MicroBuildAssemblyVersion)</_Parameter1> |
| 75 | + </_AssemblyVersionAttributes> |
| 76 | + </ItemGroup> |
| 77 | + |
| 78 | + <WriteCodeFragment AssemblyAttributes="@(_AssemblyVersionAttributes)" |
| 79 | + Language="$(Language)" |
| 80 | + OutputFile="$(GeneratedFSharpAssemblyVersionFile)"> |
| 81 | + <!-- For FSharp.Core, assembly version must be inserted after all Core files, as it defines F# basic types (strings) --> |
| 82 | + <Output TaskParameter="OutputFile" ItemName="Compile" Condition="'$(AssemblyName)' == 'FSharp.Core' or '$(Language)' != 'F#'" /> |
| 83 | + <!-- For other assemblies, this must be inserted before all source files, to keep exe's EntryPoints (if any) as the last source file --> |
| 84 | + <Output TaskParameter="OutputFile" ItemName="CompileBefore" Condition="'$(AssemblyName)' != 'FSharp.Core' and '$(Language)' == 'F#'" /> |
| 85 | + <Output TaskParameter="OutputFile" ItemName="FileWrites" /> |
| 86 | + </WriteCodeFragment> |
| 87 | + </Target> |
| 88 | + |
| 89 | +</Project> |
0 commit comments