Skip to content

Commit

Permalink
convert to SDK projects
Browse files Browse the repository at this point in the history
  • Loading branch information
brettfo committed Dec 3, 2018
1 parent a7acf9f commit 61465f6
Show file tree
Hide file tree
Showing 301 changed files with 3,456 additions and 6,960 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
/debug
/Proto

# auto-generated during the build
global.json

# Patches that may have been generated by scripts.
# (These aren't generally useful to commit directly; if anything, they should be applied.)
scripts/*.patch
Expand Down Expand Up @@ -82,6 +85,8 @@ lib/bootstrap/4.1/*.xml
lib/bootstrap/4.1/fsharpc
lib/bootstrap/4.1/fsharpi
lib/bootstrap/4.1/policy*
obj/
bin/
aclocal.m4
Debug
Release
Expand Down
6 changes: 3 additions & 3 deletions .vsts-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
strategy:
maxParallel: 2
matrix:
release_default:
_command: ./mono/cibuild.sh
_args: release
dotnet_sdk:
_command: make
_args: Configuration=release
# disabled until it can be properly fixed
#release_fcs:
# _command: ./fcs/build.sh
Expand Down
1 change: 0 additions & 1 deletion DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ If you are behind a proxy server, NuGet client tool must be configured to use it

Where you should set proper proxy address, user name and password.


#### Resources

The primary technical guide to the core compiler code is [The F# Compiler Technical Guide](http://fsharp.github.io/2015/09/29/fsharp-compiler-guide.html). Please read and contribute to that guide.
2 changes: 1 addition & 1 deletion DotnetCLIToolsVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.403
2.1.500
1 change: 0 additions & 1 deletion DotnetCLIVersion.txt

This file was deleted.

13 changes: 4 additions & 9 deletions src/FSharp.Profiles.props → FSharp.Profiles.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<Project>

<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
<DefineConstants Condition="'$(MonoPackaging)' == 'true'">$(DefineConstants);CROSS_PLATFORM_COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
<DefineConstants>$(DefineConstants);BE_SECURITY_TRANSPARENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_LCIDFROMCODEPAGE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.6' or '$(TargetFramework)' == 'netcoreapp1.0'">
<PropertyGroup Condition="$(TargetFramework.StartsWith('netstandard')) OR $(TargetFramework.StartsWith('netcoreapp'))">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
<DefineConstants>$(DefineConstants);NETSTANDARD1_6</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_APP_DOMAINS</DefineConstants>
Expand All @@ -19,13 +19,11 @@
<DefineConstants>$(DefineConstants);FX_NO_CONVERTER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_DEFAULT_DEPENDENCY_TYPE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CORHOST_SIGNER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CRYPTO</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EVENTWAITHANDLE_IDISPOSABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_HEAPTERMINATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_LINKEDRESOURCES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_LOADER_OPTIMIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SIMPLIFIED_LOADER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PARAMETERIZED_THREAD_START</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PDB_READER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PDB_WRITER</DefineConstants>
Expand All @@ -42,16 +40,13 @@
<DefineConstants>$(DefineConstants);FX_NO_WEB_CLIENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WIN_REGISTRY</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WINFORMS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_INDENTED_TEXT_WRITER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_REDUCED_EXCEPTIONS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_REDUCED_CONSOLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFEMIT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_CONSOLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_GLOBALIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_JITTRACKING_ISSUE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_INDENTED_TEXT_WRITER</DefineConstants>
<DefineConstants Condition=" '$(FX_NO_LOADER)' != 'true' ">$(DefineConstants);FX_RESHAPED_REFLECTION_CORECLR</DefineConstants>
<DefineConstants>$(DefineConstants);FSI_TODO_NETCORE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_MSBUILD</DefineConstants>
<OtherFlags>$(OtherFlags) --simpleresolution</OtherFlags>
</PropertyGroup>

Expand Down
37 changes: 25 additions & 12 deletions FSharpBuild.Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Project>

<Import Project="build\targets\AssemblyVersions.props" />
<Import Project="build\targets\PackageVersions.props" />
<Import Project="build\targets\GitHash.props" />
<Import Project="build\targets\CommonPackages.targets" />

<!-- directory locations -->
Expand All @@ -9,19 +11,29 @@
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<FSharpSourcesRoot>$(RepoRoot)src</FSharpSourcesRoot>
<ToolsRoot>$(RepoRoot)Tools</ToolsRoot>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ProtoOutputPath>$(RepoRoot)Proto\net40\bin</ProtoOutputPath>
<ProtoOutputPath Condition="'$(OS)' != 'Unix'">$(RepoRoot)Proto\net40\bin</ProtoOutputPath>
<ProtoOutputPath Condition="'$(OS)' == 'Unix'">$(RepoRoot)Proto\coreclr\bin</ProtoOutputPath>
<ValueTupleImplicitPackageVersion>4.4.0</ValueTupleImplicitPackageVersion>
</PropertyGroup>

<!-- nuget -->
<PropertyGroup>
<!-- default NuGet package restore location -->
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(NUGET_PACKAGES)</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(MSBuildThisFileDirectory)packages</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' AND '$(OS)' == 'Windows_NT'">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' AND '$(OS)' != 'Windows_NT'">$(HOME)/.nuget/packages/</NuGetPackageRoot>
<!-- ensure there is a trailing slash -->
<NuGetPackageRoot Condition="!HasTrailingSlash('$(NuGetPackageRoot)') AND '$(OS)' == 'Windows_NT'">$(NuGetPackageRoot)\</NuGetPackageRoot>
<NuGetPackageRoot Condition="!HasTrailingSlash('$(NuGetPackageRoot)') AND '$(OS)' != 'Windows_NT'">$(NuGetPackageRoot)/</NuGetPackageRoot>
<!-- ensure all NuGet packages come from the `$(NuGetPackageRoot)` variable -->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>

<!-- mono -->
<PropertyGroup Condition="'$(OS)' == 'Unix'">
<MonoPackaging Condition="$(TargetFramework.StartsWith('net4'))">true</MonoPackaging>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net45'">/usr/lib/mono/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net46'">/usr/lib/mono/4.6-api</FrameworkPathOverride>
</PropertyGroup>

<!-- signing -->
Expand All @@ -32,15 +44,15 @@
<StrongNames>true</StrongNames>
<DelaySign>true</DelaySign>
</PropertyGroup>

<!-- mono -->
<PropertyGroup>
<MonoPackaging Condition="$(TargetFramework.StartsWith('net4')) and '$(OS)' == 'Unix'">true</MonoPackaging>
<PropertyGroup Condition="'$(MonoPackaging)' == 'true'">
<AssemblyOriginatorKeyFile>$(FSharpSourcesRoot)\fsharp\test.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<DefineConstants>STRONG_NAME_FSHARP_COMPILER_WITH_TEST_KEY;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<!-- localization -->
<PropertyGroup>
<EnableXlfLocalization Condition="'$(Configuration)' == 'Proto' or '$(MonoPackaging)' == 'true'">false</EnableXlfLocalization>
<EnableXlfLocalization Condition="'$(EnableXlfLocalization)' == '' AND ('$(Configuration)' == 'Proto' OR '$(MonoPackaging)' == 'true')">false</EnableXlfLocalization>
<UpdateXlfOnBuild Condition="'$(CI)' != '1'">true</UpdateXlfOnBuild>
</PropertyGroup>

Expand All @@ -53,10 +65,11 @@
</PropertyGroup>

<!-- SDK targets override -->
<PropertyGroup Condition="'$(Configuration)' != 'Proto'">
<FSharpPropsShim Condition="Exists('$(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props')">$(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props</FSharpPropsShim>
<FSharpTargetsShim Condition="Exists('$(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets')">$(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets</FSharpTargetsShim>
<FSharpOverridesTargetsShim Condition="Exists('$(ProtoOutputPath)\Microsoft.FSharp.Overrides.NetSdk.targets')">$(ProtoOutputPath)\Microsoft.FSharp.Overrides.NetSdk.targets</FSharpOverridesTargetsShim>
<PropertyGroup Condition="'$(Configuration)' != 'Proto' AND Exists('$(ProtoOutputPath)')">
<FSharpTargetsPath>$(ProtoOutputPath)\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSharpPropsShim>$(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props</FSharpPropsShim>
<FSharpTargetsShim>$(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets</FSharpTargetsShim>
<FSharpOverridesTargetsShim>$(ProtoOutputPath)\Microsoft.FSharp.Overrides.NetSdk.targets</FSharpOverridesTargetsShim>
</PropertyGroup>

</Project>
56 changes: 46 additions & 10 deletions FSharpBuild.Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
<Project>

<Import Project="FSharp.Profiles.props" />

<PropertyGroup>
<XlfLanguages>en;$(XlfLanguages)</XlfLanguages>
<TargetDotnetProfile Condition="$(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('netcoreapp'))">coreclr</TargetDotnetProfile>
<TargetDotnetProfile Condition="$(TargetFramework.StartsWith('net4'))">net40</TargetDotnetProfile>
<ActualOutputPath Condition="'$(Language)' != 'VB'">$(MSBuildProjectDirectory)\$(OutputPath)</ActualOutputPath>
<ActualOutputPath Condition="'$(Language)' == 'VB'">$(OutputPath)</ActualOutputPath>
<FinalOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin</FinalOutputPath>
<FinalIntermediateOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj</FinalIntermediateOutputPath>
</PropertyGroup>

<Target Name="HACK_CopyOutputsToTheProperLocation"
AfterTargets="AfterBuild"
Condition="'$(DisableOutputPathCopying)' != 'true'">
<PropertyGroup Condition="'$(UseAssetTargetFallback)' == 'true'">
<!--
HACK: Necessary because the `netstandard1.6` version of FSharp.Compiler.Private requires a package that isn't
necessary for `net46`, but the package has a requirement on `net462`. The reference is excluded from the build
during `net46`, but for purposes of restore needs to be present.
-->
<AssetTargetFallback>$(AssetTargetFallback);net462</AssetTargetFallback>
</PropertyGroup>

<PropertyGroup>
<CompileDependsOn>$(CompileDependsOn);CopyAndSubstituteTextFiles</CompileDependsOn>
</PropertyGroup>

<Target Name="CopyAndSubstituteTextFiles"
Inputs="@(CopyAndSubstituteText)"
Outputs="@(CopyAndSubstituteText->'$(OutDir)%(TargetFilename)')">
<PropertyGroup>
<_ReplacementText>$([System.IO.File]::ReadAllText('%(CopyAndSubstituteText.FullPath)'))</_ReplacementText>
<_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern1)', '%(CopyAndSubstituteText.Replacement1)'))</_ReplacementText>
<_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern2)', '%(CopyAndSubstituteText.Replacement2)'))</_ReplacementText>
</PropertyGroup>
<WriteLinesToFile File="$(OutDir)%(CopyAndSubstituteText.TargetFilename)" Lines="$(_ReplacementText)" Overwrite="true" />
<!-- Make sure it will get cleaned -->
<CreateItem Include="$(OutDir)%(CopyAndSubstituteText.TargetFilename)">
<Output TaskParameter="Include" ItemName="FileWrites" />
</CreateItem>
</Target>

<Target Name="ComputeFinalOutputPaths">
<!--
Ideally we'd set <OutputPath> to `$(Configuration)\[net40|coreclr]\bin`, but the calculation of `[net40|coreclr]`
depends on the `$(TargetFramework)` variable which is set by the individual project files, but by the time we have
Expand All @@ -22,6 +44,21 @@
The fix is to not set `$(Outputpath)` and simply copy stuff there after the fact.
-->

<PropertyGroup>
<TargetDotnetProfile Condition="$(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('netcoreapp'))">coreclr</TargetDotnetProfile>
<TargetDotnetProfile Condition="$(TargetFramework.StartsWith('net4'))">net40</TargetDotnetProfile>
<ActualOutputPath Condition="'$(Language)' != 'VB'">$(MSBuildProjectDirectory)\$(OutputPath)</ActualOutputPath>
<ActualOutputPath Condition="'$(Language)' == 'VB'">$(OutputPath)</ActualOutputPath>
<FinalOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin</FinalOutputPath>
<FinalIntermediateOutputPath>$(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj</FinalIntermediateOutputPath>
</PropertyGroup>
</Target>

<Target Name="HACK_CopyOutputsToTheProperLocation"
AfterTargets="AfterBuild"
DependsOnTargets="ComputeFinalOutputPaths"
Condition="'$(DisableOutputPathCopying)' != 'true'">

<ItemGroup>
<OutputFilesToCopy Include="$(ActualOutputPath)**" />
<IntermediateFilesToCopy Include="$(IntermediateOutputPath)\**" />
Expand All @@ -33,7 +70,6 @@
<Copy SourceFiles="@(IntermediateFilesToCopy)" DestinationFolder="$(FinalIntermediateOutputPath)\%(RecursiveDir)" />
</Target>

<Import Project="build\targets\AssemblyVersions.props" />
<Import Project="build\targets\ConvertPortablePdbs.targets" />
<Import Project="build\targets\GenerateAssemblyAttributes.targets" />
<Import Project="build\targets\GenerateInternalsVisibleTo.targets" />
Expand Down
Loading

0 comments on commit 61465f6

Please sign in to comment.