Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Net Sdk to write project properties #4430

Merged
merged 4 commits into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_10.1_Framework_v4.0]Microsoft.Portable.FSharp.Targets" Type="string" />
<RegistryValue Name="Microsoft.FSharp.NetSdk.props" Value="[MicrosoftSDKs_FS_10.1_Framework_v4.0]Microsoft.FSharp.NetSdk.props" Type="string" />
<RegistryValue Name="Microsoft.FSharp.NetSdk.targets" Value="[MicrosoftSDKs_FS_10.1_Framework_v4.0]Microsoft.FSharpNetSdk.targets" Type="string" />
<RegistryValue Name="Microsoft.FSharp.Overrides.NetSdk.targets" Value="[MicrosoftSDKs_FS_10.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_10.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#\10.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 @@ -37,6 +37,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#'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the condition to '$(Language)' == 'F#' AND '$(GenerateAssemblyInfo)' != 'false'.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,8 +64,9 @@
<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" />

<file src="**\FSharp.Core.resources.dll" target="lib\netstandard1.6" />
<file src="**\FSharp.Compiler.Private.resources.dll" target="lib\netstandard1.6" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
<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.NetSdk.targets" target="runtimes\any\native" />
<file src="Microsoft.FSharp.Overrides.NetSdk.targets" target="runtimes\any\native" />

<file src="**\FSharp.Core.resources.dll" target="lib\netstandard1.6" />
<file src="**\FSharp.Compiler.Private.resources.dll" target="lib\netstandard1.6" />
Expand Down
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