Skip to content
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
1 change: 1 addition & 0 deletions FSharp.Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

<!-- other -->
<PropertyGroup>
<DebugType>full</DebugType>
<MicroBuildAssemblyFileLanguage>fs</MicroBuildAssemblyFileLanguage>
<UseStandardResourceNames>false</UseStandardResourceNames>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
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: 2 additions & 3 deletions src/absil/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1558,9 +1558,8 @@ type ILFieldDef =
member x.WithStatic(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.Static }
member x.WithSpecialName(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition (FieldAttributes.SpecialName ||| FieldAttributes.RTSpecialName) }
member x.WithNotSerialized(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.NotSerialized }
member x.WithLiteral(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.Literal }
member x.WithHasDefault(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.HasDefault }
member x.WithHasFieldMarshal(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.HasFieldMarshal }
member x.WithLiteralDefaultValue(literal) = { x with LiteralValue = literal; Attributes = x.Attributes |> conditionalAdd literal.IsSome (FieldAttributes.Literal ||| FieldAttributes.HasDefault) }
member x.WithFieldMarshal(marshal) = { x with Marshal = marshal; Attributes = x.Attributes |> conditionalAdd marshal.IsSome FieldAttributes.HasFieldMarshal }


// Index table by name. Keep a canonical list to make sure field order is not disturbed for binary manipulation.
Expand Down
5 changes: 2 additions & 3 deletions src/absil/il.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,8 @@ type ILFieldDef =
member WithStatic: bool -> ILFieldDef
member WithSpecialName: bool -> ILFieldDef
member WithNotSerialized: bool -> ILFieldDef
member WithLiteral: bool -> ILFieldDef
member WithHasDefault: bool -> ILFieldDef
member WithHasFieldMarshal: bool -> ILFieldDef
member WithLiteralDefaultValue: ILFieldInit option -> ILFieldDef
member WithFieldMarshal: ILNativeType option -> ILFieldDef

/// Tables of fields. Logically equivalent to a list of fields but
/// the table is kept in a form optimized for looking up fields by
Expand Down
25 changes: 9 additions & 16 deletions src/absil/ilwritepdb.fs
Original file line number Diff line number Diff line change
Expand Up @@ -423,22 +423,15 @@ let generatePortablePdb (embedAllSource:bool) (embedSourceList:string list) (sou
list.ToArray() |> Array.sortWith<PdbMethodScope> scopeSorter

collectScopes scope |> Seq.iter(fun s ->
if s.Children.Length = 0 then
metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken),
Unchecked.defaultof<ImportScopeHandle>,
nextHandle lastLocalVariableHandle,
Unchecked.defaultof<LocalConstantHandle>,
0, s.EndOffset - s.StartOffset ) |>ignore
else
metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken),
Unchecked.defaultof<ImportScopeHandle>,
nextHandle lastLocalVariableHandle,
Unchecked.defaultof<LocalConstantHandle>,
s.StartOffset, s.EndOffset - s.StartOffset) |>ignore

for localVariable in s.Locals do
lastLocalVariableHandle <- metadata.AddLocalVariable(LocalVariableAttributes.None, localVariable.Index, metadata.GetOrAddString(localVariable.Name))
)
metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken),
Unchecked.defaultof<ImportScopeHandle>,
nextHandle lastLocalVariableHandle,
Unchecked.defaultof<LocalConstantHandle>,
s.StartOffset, s.EndOffset - s.StartOffset ) |>ignore

for localVariable in s.Locals do
lastLocalVariableHandle <- metadata.AddLocalVariable(LocalVariableAttributes.None, localVariable.Index, metadata.GetOrAddString(localVariable.Name))
)

match minfo.RootScope with
| None -> ()
Expand Down
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#'"
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 @@ -42,8 +42,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 @@ -64,8 +65,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
13 changes: 6 additions & 7 deletions src/fsharp/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4742,7 +4742,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta
let ilFieldDef = mkILStaticField (fspec.Name, fty, None, None, access)
let ilFieldDef =
match vref.LiteralValue with
| Some konst -> { ilFieldDef.WithHasDefault(true) with LiteralValue = Some(GenFieldInit m konst) }
| Some konst -> ilFieldDef.WithLiteralDefaultValue( Some (GenFieldInit m konst) )
| None -> ilFieldDef

let ilFieldDef =
Expand Down Expand Up @@ -6347,19 +6347,18 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
{ Name = ilFieldName
Type = ilPropType
Attributes = enum 0
Data = None
LiteralValue = literalValue
Data = None
LiteralValue = None
Offset = ilFieldOffset
Marshal = ilFieldMarshal
Marshal = None
CustomAttrs = mkILCustomAttrs (GenAttrs cenv eenv fattribs @ extraAttribs) }
let fdef =
fdef.WithAccess(access)
.WithStatic(isStatic)
.WithSpecialName(ilFieldName="value__" && tycon.IsEnumTycon)
.WithNotSerialized(ilNotSerialized)
.WithLiteral(fspec.LiteralValue.IsSome)
.WithHasDefault(literalValue.IsSome)
.WithHasFieldMarshal(ilFieldMarshal.IsSome)
.WithLiteralDefaultValue(literalValue)
.WithFieldMarshal(ilFieldMarshal)
yield fdef

if requiresExtraField then
Expand Down
Loading