Skip to content

Commit

Permalink
Enable net sdk project properties to be set in assembly info
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinRansom committed Mar 6, 2018
1 parent f214dcc commit 37973e5
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 3 deletions.
6 changes: 6 additions & 0 deletions mono/config.make
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ install-sdk-lib:
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \
\
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v11.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \
fi
@if test x-$(outsuffix) = x-net40; then \
if test -e $(outdir)$(NAME).dll; then \
Expand Down
6 changes: 6 additions & 0 deletions setup/FSharp.SDK/component-groups/Compiler_Redist.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<ComponentRef Id="Compiler_Redist_Microsoft.Portable.FSharp.targets" />
<ComponentRef Id="Compiler_Redist_Microsoft.FSharp.NetSdk.props" />
<ComponentRef Id="Compiler_Redist_Microsoft.FSharp.NetSdk.targets" />
<ComponentRef Id="Compiler_Redist_Microsoft.FSharp.Overrides.NetSdk.targets" />
<ComponentRef Id="Compiler_Redist_SupportedRuntimes.xml" />
<ComponentRef Id="Compiler_Redist_RegistryKeys_CompilerLocation" />

Expand Down Expand Up @@ -126,6 +127,10 @@
<File Id="Compiler_Redist_Microsoft.FSharp.NetSdk.targets" Source="$(var.BinariesDir)\net40\bin\Microsoft.FSharp.NetSdk.targets" />
</Component>

<Component Id="Compiler_Redist_Microsoft.FSharp.Overrides.NetSdk.targets" Guid="$(fsharp.guid(Compiler_Redist_Microsoft.FSharp.Overrides.NetSdk.targets, $(var.LocaleCode)))">
<File Id="Compiler_Redist_Microsoft.FSharp.Overrides.NetSdk.targets" Source="$(var.BinariesDir)\net40\bin\Microsoft.FSharp.Overrides.NetSdk.targets" />
</Component>

<Component Id="Compiler_Redist_SupportedRuntimes.xml" Guid="$(fsharp.guid(Compiler_Redist_SupportedRuntimes.xml, $(var.LocaleCode)))">
<File Id="Compiler_Redist_SupportedRuntimes.xml" Source="$(var.FSharpTreeRoot)\vsintegration\src\SupportedRuntimes\SupportedRuntimes.xml" />
</Component>
Expand All @@ -140,6 +145,7 @@
<RegistryValue Name="Microsoft.Portable.FSharp.Targets" Value="[MicrosoftSDKs_FS_4.1_Framework_v4.0]Microsoft.Portable.FSharp.Targets" Type="string" />
<RegistryValue Name="Microsoft.FSharp.NetSdk.props" Value="[MicrosoftSDKs_FS_4.1_Framework_v4.0]Microsoft.FSharp.NetSdk.props" Type="string" />
<RegistryValue Name="Microsoft.FSharp.NetSdk.targets" Value="[MicrosoftSDKs_FS_4.1_Framework_v4.0]Microsoft.FSharpNetSdk.targets" Type="string" />
<RegistryValue Name="Microsoft.FSharp.Overrides.NetSdk.targets" Value="[MicrosoftSDKs_FS_4.1_Framework_v4.0]Microsoft.Overrides.FSharpNetSdk.targets" Type="string" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="Software\Microsoft\VisualStudio\15.0\Setup\F#" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
<RegistryValue Name="ProductDir" Value="[MicrosoftSDKs_FS_4.1_Framework_v4.0]" Type="string" />
Expand Down
1 change: 1 addition & 0 deletions setup/Swix/Microsoft.FSharp.Dependencies/Files.swr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ folder "InstallDir:MSBuild\Microsoft\VisualStudio\v15.0\FSharp"
file "Microsoft.FSharp.Targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.Shim.targets"
file "Microsoft.Portable.FSharp.Targets" source="$(BinariesFolder)\setup\resources\Microsoft.Portable.FSharp.Shim.targets"
file "Microsoft.FSharp.NetSdk.targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.NetSdk.Shim.targets"
file "Microsoft.FSharp.NetSdk.Overrides.targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.Overrides.NetSdk.Shim.targets"
file "Microsoft.FSharp.NetSdk.props" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.NetSdk.Shim.props"

folder "InstallDir:Common7\IDE\PublicAssemblies"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\F#\4.1\Framework\v4.0\Microsoft.FSharp.Overrides.NetSdk.targets" />

</Project>
5 changes: 5 additions & 0 deletions src/buildfromsource/FSharp.Build/FSharp.Build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
<Pattern1>{BuildSuffix}</Pattern1>
<Replacement1></Replacement1>
</CopyAndSubstituteText>
<CopyAndSubstituteText Include="$(FSharpSourcesRoot)\fsharp\FSharp.Build\Microsoft.FSharp.Overrides.NetSdk.targets">
<TargetFilename>Microsoft.FSharp.Overrides.NetSdk.targets</TargetFilename>
<Pattern1>{BuildSuffix}</Pattern1>
<Replacement1></Replacement1>
</CopyAndSubstituteText>
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
<None Include="..\FSharp.Build\Microsoft.FSharp.NetSdk.targets" CopyToOutputDirectory="PreserveNewest">
<Link>Microsoft.FSharp.NetSdk.targets</Link>
</None>
<None Include="..\FSharp.Build\Microsoft.FSharp.Overrides.NetSdk.targets" CopyToOutputDirectory="PreserveNewest">
<Link>Microsoft.FSharp.Overrides.NetSdk.targets</Link>
</None>
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/FSharp.Build/FSharp.Build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<None Include="Microsoft.Portable.FSharp.Targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="Microsoft.FSharp.NetSdk.props" CopyToOutputDirectory="PreserveNewest" />
<None Include="Microsoft.FSharp.NetSdk.targets" CopyToOutputDirectory="PreserveNewest" />
<None Include="Microsoft.FSharp.Overrides.NetSdk.targets" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetDotnetProfile)' != 'coreclr'">
Expand Down
36 changes: 36 additions & 0 deletions src/fsharp/FSharp.Build/Microsoft.FSharp.Overrides.NetSdk.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->

<!--
***********************************************************************************************
Microsoft.FSharp.Overrides.NetSdk.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
***********************************************************************************************
-->

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>

<Target Name="CoreGenerateAssemblyInfo"
Condition="'$(Language)'=='F#'"
DependsOnTargets="CreateGeneratedAssemblyInfoInputsCacheFile"
Inputs="$(GeneratedAssemblyInfoInputsCacheFile)"
Outputs="$(GeneratedAssemblyInfoFile)">
<ItemGroup>
<!-- Ensure the generated assemblyinfo file is not already part of the Compile sources, as a workaround for https://github.com/dotnet/sdk/issues/114 -->
<Compile Remove="$(GeneratedAssemblyInfoFile)" />
</ItemGroup>

<WriteCodeFragment AssemblyAttributes="@(AssemblyAttribute)" Language="$(Language)" OutputFile="$(GeneratedAssemblyInfoFile)">
<Output TaskParameter="OutputFile" ItemName="CompileBefore" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragment>
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
<files include="any\any\default.win32manifest" buildAction="Content" copyToOutput="true" flatten="false" />
<files include="any\any\Microsoft.FSharp.Targets" buildAction="Content" copyToOutput="true" flatten="false" />
<files include="any\any\Microsoft.Portable.FSharp.targets" buildAction="Content" copyToOutput="true" flatten="false" />
<files include="any\any\Microsoft.FSharp.NetSdk.targets" buildAction="Content" copyToOutput="true" flatten="false" />
<files include="any\any\Microsoft.FSharp.NetSdk.props" buildAction="Content" copyToOutput="true" flatten="false" />
<files include="any\any\Microsoft.FSharp.NetSdk.targets" buildAction="Content" copyToOutput="true" flatten="false" />
<files include="any\any\Microsoft.FSharp.Overrides.NetSdk.targets" buildAction="Content" copyToOutput="true" flatten="false" />
</contentFiles>
</metadata>
<files>
Expand All @@ -63,7 +64,8 @@
<file src="default.win32manifest" target="contentFiles\any\any" />
<file src="Microsoft.FSharp.Targets" target="contentFiles\any\any" />
<file src="Microsoft.Portable.FSharp.Targets" target="contentFiles\any\any" />
<file src="Microsoft.FSharp.NetSdk.targets" target="contentFiles\any\any" />
<file src="Microsoft.FSharp.NetSdk.props" target="contentFiles\any\any" />
<file src="Microsoft.FSharp.NetSdk.targets" target="contentFiles\any\any" />
<file src="Microsoft.FSharp.Overrides.NetSdk.targets" target="contentFiles\any\any" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<file src="default.win32manifest" target="runtimes\any\native" />
<file src="Microsoft.FSharp.Targets" target="runtimes\any\native" />
<file src="Microsoft.Portable.FSharp.Targets" target="runtimes\any\native" />
<file src="Microsoft.FSharp.NetSdk.targets" target="runtimes\any\native" />
<file src="Microsoft.FSharp.NetSdk.props" target="runtimes\any\native" />
<file src="Microsoft.FSharp.Overrides.NetSdk.targets" target="runtimes\any\native" />
</files>
</package>
1 change: 1 addition & 0 deletions vsintegration/update-vsintegration.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ if "!BIN_AVAILABLE!" == "true" (
CALL :backupAndOrCopy Microsoft.Portable.FSharp.Targets "%COMPILERSDKPATH%"
CALL :backupAndOrCopy Microsoft.FSharp.NetSdk.props "%COMPILERSDKPATH%"
CALL :backupAndOrCopy Microsoft.FSharp.NetSdk.targets "%COMPILERSDKPATH%"
CALL :backupAndOrCopy Microsoft.FSharp.Overrides.NetSdk.targets "%COMPILERSDKPATH%"

rem Special casing for SupportedRuntimes.xml, it has a different source directory, it's always there
set SOURCEDIR="%TOPDIR%\vsintegration\src\SupportedRuntimes"
Expand Down

0 comments on commit 37973e5

Please sign in to comment.