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

Build system cleanup #713

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 3 additions & 28 deletions DEVGUIDE.md
Expand Up @@ -53,20 +53,8 @@ See [TESTGUIDE.md](TESTGUIDE.md) for full details on how to run tests.

Prior to a **Debug** test run, you need to complete **all** of these steps:

msbuild src/fsharp-library-build.proj
msbuild src/fsharp-compiler-build.proj
msbuild src/fsharp-typeproviders-build.proj
msbuild src/fsharp-compiler-unittests-build.proj
msbuild src/fsharp-library-build.proj /p:TargetFramework=net20
msbuild src/fsharp-library-build.proj /p:TargetFramework=portable47
msbuild src/fsharp-library-build.proj /p:TargetFramework=portable7
msbuild src/fsharp-library-build.proj /p:TargetFramework=portable78
msbuild src/fsharp-library-build.proj /p:TargetFramework=portable259
msbuild src/fsharp-library-unittests-build.proj
msbuild src/fsharp-library-unittests-build.proj /p:TargetFramework=portable47
msbuild src/fsharp-library-unittests-build.proj /p:TargetFramework=portable7
msbuild src/fsharp-library-unittests-build.proj /p:TargetFramework=portable78
msbuild src/fsharp-library-unittests-build.proj /p:TargetFramework=portable259
msbuild src/fsharp-proto-build.proj
msbuild src/fsharp-all-the-things.proj
src\update.cmd debug -ngen
tests\BuildTestTools.cmd debug

Expand All @@ -78,20 +66,7 @@ Prior to a **Debug** test run, you need to complete **all** of these steps:

Prior to a **Release** test run, you need to do **all** of these:

msbuild src/fsharp-library-build.proj /p:Configuration=Release
msbuild src/fsharp-compiler-build.proj /p:Configuration=Release
msbuild src/fsharp-typeproviders-build.proj /p:Configuration=Release
msbuild src/fsharp-compiler-unittests-build.proj /p:Configuration=Release
msbuild src/fsharp-library-build.proj /p:TargetFramework=net20 /p:Configuration=Release
msbuild src/fsharp-library-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
msbuild src/fsharp-library-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
msbuild src/fsharp-library-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
msbuild src/fsharp-library-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
msbuild src/fsharp-library-unittests-build.proj /p:Configuration=Release
msbuild src/fsharp-library-unittests-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
msbuild src/fsharp-library-unittests-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
msbuild src/fsharp-library-unittests-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
msbuild src/fsharp-library-unittests-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
msbuild src/fsharp-all-the-things.proj /p:Configuration=Release
src\update.cmd release -ngen
tests\BuildTestTools.cmd release

Expand Down
37 changes: 2 additions & 35 deletions appveyor-build.cmd
Expand Up @@ -30,41 +30,8 @@ if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :failure
%_ngenexe% install Proto\net40\bin\fsc-proto.exe
@if ERRORLEVEL 1 echo Error: NGen of proto failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable47 build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable7 build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable78 build failed && goto :failure

%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library portable259 build failed && goto :failure

%_msbuildexe% src/fsharp-compiler-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler unittests build failed && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable47 && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable7 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable7 && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable78 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable78 && goto :failure

%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: library unittests build failed portable259 && goto :failure
%_msbuildexe% src/fsharp-all-the-things.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: compiler/libraries + unittests build failed && goto :failure

%_msbuildexe% vsintegration\fsharp-vsintegration-build.proj /p:Configuration=Release
@if ERRORLEVEL 1 echo Error: VS integration build failed && goto :failure
Expand Down
8 changes: 7 additions & 1 deletion src/FSharpSource.Settings.targets
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->

<!--
Include this BEFORE the bulk of the project file
-->

<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Tail calls on, even in debug -->
Expand Down Expand Up @@ -64,6 +69,7 @@
<PropertyGroup Condition="'$(Configuration)'=='Proto'">
<Optimize>true</Optimize>
<DefineConstants>DEBUG;NO_STRONG_NAMES;$(DefineConstants)</DefineConstants>
<FsBuildSuffix>-proto</FsBuildSuffix>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -76,7 +82,7 @@
<DefineConstants Condition="'$(VisualStudioVersion)'=='12.0' AND '$(ProjectLanguage)' == 'VisualBasic'">$(DefineConstants),VS_VERSION_DEV12=True</DefineConstants>
<DefineConstants Condition="'$(VisualStudioVersion)'=='12.0' AND '$(ProjectLanguage)' != 'VisualBasic'">$(DefineConstants);VS_VERSION_DEV12</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<MSBuildVersionSuffix>core</MSBuildVersionSuffix>
<MSBuildVersionSuffix Condition="'$(VisualStudioVersion)' == '12.0'">V12.0</MSBuildVersionSuffix>
Expand Down
84 changes: 46 additions & 38 deletions src/FSharpSource.targets
@@ -1,22 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->

<!--
Include this AFTER the bulk of the project file.
-->

<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IsPortableProfile Condition="'$(TargetFramework)' == 'portable47' or '$(TargetFramework)' == 'portable7' or '$(TargetFramework)' == 'portable78' or '$(TargetFramework)' == 'portable259'">true</IsPortableProfile>
<FSCoreVersion Condition="'$(TargetFramework)' != 'net20' and $(IsPortableProfile) != 'true'">4.4.0.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'net20'">2.4.0.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'portable7'">3.7.4.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'portable47'">3.47.4.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'portable78'">3.78.4.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'portable259'">3.259.4.9055</FSCoreVersion>
</PropertyGroup>
<Choose>
<PropertyGroup>
<IsPortableProfile Condition="'$(TargetFramework)' == 'portable47' or '$(TargetFramework)' == 'portable7' or '$(TargetFramework)' == 'portable78' or '$(TargetFramework)' == 'portable259'">true</IsPortableProfile>
<FSCoreVersion Condition="'$(TargetFramework)' != 'net20' and $(IsPortableProfile) != 'true'">4.4.0.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'net20'">2.4.0.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'portable7'">3.7.4.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'portable47'">3.47.4.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'portable78'">3.78.4.9055</FSCoreVersion>
<FSCoreVersion Condition="'$(TargetFramework)' == 'portable259'">3.259.4.9055</FSCoreVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Release' or '$(Configuration)' == 'VSDebug' or '$(Configuration)' == 'VSRelease' ">
<Choose>
<When Condition="'$(ProjectLanguage)' == 'FSharp'">
<Choose>
<When Condition="'$(AssemblyName)' == 'FSharp.Core'">
<PropertyGroup>
<PropertyGroup>
<OtherFlags>$(OtherFlags) --version:$(FSCoreVersion)</OtherFlags>
<OtherFlags>$(OtherFlags) --delaysign+ --keyfile:"$(FSharpSourcesRoot)\fsharp\msft.pubkey"</OtherFlags>
<DefineConstants>STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY;$(DefineConstants)</DefineConstants>
Expand Down Expand Up @@ -93,6 +98,8 @@
<PropertyGroup Condition="'$(Configuration)'=='Proto'">
<Optimize>true</Optimize>
<DefineConstants>DEBUG;NO_STRONG_NAMES;$(DefineConstants)</DefineConstants>
<DefineConstants>BUILDING_WITH_LKG;$(DefineConstants)</DefineConstants>
<BuildWith>LKG</BuildWith>
</PropertyGroup>

<!-- Always qualify the IntermediateOutputPath by the TargetFramework if any exists -->
Expand All @@ -102,8 +109,8 @@

<PropertyGroup>
<DefineConstants>$(DefineConstants);OPEN_BUILD</DefineConstants>
</PropertyGroup>
</PropertyGroup>

<PropertyGroup>
<NUnitVersion>2.6.4</NUnitVersion>
<NUnitFullVersion>2.6.4.14350</NUnitFullVersion>
Expand Down Expand Up @@ -205,8 +212,8 @@
<TargetFrameworkProfile>Profile47</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<!-- Target Portable Profile 7 -->

<!-- Target Portable Profile 7 -->
<PropertyGroup Condition="'$(TargetFramework)'=='portable7'">
<DefineConstants>$(DefineConstants);FSHARP_CORE_NETCORE_PORTABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FSHARP_CORE_NETCORE_PORTABLE7</DefineConstants>
Expand Down Expand Up @@ -235,11 +242,11 @@
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE</DefineConstants>
<TargetingNetCorePortable>true</TargetingNetCorePortable>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>

<!-- Target Portable Profile 78 -->
Expand Down Expand Up @@ -632,11 +639,9 @@

<!-- Build with LKG compiler (location is determined by Microsoft.FSharp.targets). The output compiler has suffix "-proto" -->
<PropertyGroup Condition=" '$(BuildWith)' == 'LKG' And '$(ProjectLanguage)' == 'FSharp' AND '$(STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY)' == 'true'">
<FsBuildSuffix>-proto</FsBuildSuffix>
<OutputPath>$(FSharpSourcesRoot)\..\vs\$(protoCLIDir)\bin</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(BuildWith)' == 'LKG' And '$(ProjectLanguage)' == 'FSharp' AND '$(STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY)' != 'true'">
<FsBuildSuffix>-proto</FsBuildSuffix>
<OutputPath>$(FSharpSourcesRoot)\..\$(Configuration)\$(protoCLIDir)\bin</OutputPath>
</PropertyGroup>

Expand Down Expand Up @@ -667,27 +672,27 @@
</When>
<When Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets') AND '$(BuildWith)' == 'LKG'">
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSCoreLKGPath Condition="Exists('$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll')">$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll</FSCoreLKGPath>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSCoreLKGPath Condition="Exists('$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll')">$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll</FSCoreLKGPath>
</PropertyGroup>
</When>
<When Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets') AND '$(BuildWith)' == 'LKG'">
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSCoreLKGPath Condition="Exists('$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\FSharp.Core.dll')">$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\FSharp.Core.dll</FSCoreLKGPath>
<FSCoreLKGPath Condition="Exists('$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll')">$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll</FSCoreLKGPath>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSCoreLKGPath Condition="Exists('$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\FSharp.Core.dll')">$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\FSharp.Core.dll</FSCoreLKGPath>
<FSCoreLKGPath Condition="Exists('$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll')">$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll</FSCoreLKGPath>
</PropertyGroup>
</When>
<When Condition="'$(BuildWith)' == 'LKG'">
<PropertyGroup>
<FSharpTargetsPath>..\lkg\FSharp-$(LkgVersion)\bin\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FscToolPath>$(FSharpSourcesRoot)\..\lkg\FSharp-$(LkgVersion)\bin</FscToolPath>
<FSCoreLKGPath>$(FSharpSourcesRoot)\..\lkg\FSharp-$(LkgVersion)\bin\FSharp.Core.dll</FSCoreLKGPath>
<FSharpTargetsPath>..\lkg\FSharp-$(LkgVersion)\bin\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FscToolPath>$(FSharpSourcesRoot)\..\lkg\FSharp-$(LkgVersion)\bin</FscToolPath>
<FSCoreLKGPath>$(FSharpSourcesRoot)\..\lkg\FSharp-$(LkgVersion)\bin\FSharp.Core.dll</FSCoreLKGPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
Expand All @@ -713,10 +718,13 @@

<Target Name="ValidateConfiguration">
<Error
Text="Configuration '$(Configuration)' is not one of the supported configurations: Debug, Release, Proto"
Text="Configuration '$(Configuration)' is not one of the supported configurations: Debug, Release, and sometimes Proto"
Condition="'$(Configuration)'!='Release' and '$(Configuration)'!='Debug' and '$(Configuration)'!='VSRelease' and '$(Configuration)'!='VSDebug' and '$(Configuration)'!='Proto'"/>
<Error
Text="TargetFramework '$(TargetFramework)' is not one of the supported configurations: 'empty', net20, net40, sl3-wp, sl5, sl5-compiler, portable47, portable7, portable78, portable259"
Text="Configuration 'Proto' is not supported for '$(MSBuildProjectFile)'"
Condition="'$(Configuration)'=='Proto' and '$(ProtoSupported)'!='true'"/>
<Error
Text="TargetFramework '$(TargetFramework)' is not one of the supported configurations: net20, net40, sl3-wp, sl5, sl5-compiler, portable47, portable7, portable78, portable259"
Condition="! ('$(TargetFramework)' == 'net40' or
'$(TargetFramework)' == 'net20' or
'$(TargetFramework)' == 'sl5' or
Expand All @@ -728,11 +736,11 @@
<Error
Text="TargetFramework '$(TargetFramework)' is only supported when building FSharp.Core.dll and FSharp.Core.Unittests.dll. All other components must be built with TargetFramework=net40"
Condition="'$(AssemblyName)' != 'FSharp.Core' and '$(AssemblyName)' != 'FSharp.Core.Unittests' and '$(TargetFramework)' != 'net40'"/>

</Target>

<!-- This build step copies files to the output folder while replacing build variables in the text of
those file. -->
those files. -->
<Target
Name="CustomCopyLocalFiles"
Inputs="@(CustomCopyLocal)"
Expand All @@ -747,14 +755,14 @@
</Target>

<Import Project="..\lkg\FSharp-$(LkgVersion)\bin\FSharp.SRGen.targets" />

<Target Name="ReorderCompileItems"
BeforeTargets="CoreCompile"
Condition="'$(GenerateTargetFrameworkAttribute)' == 'true' AND '$(AssemblyName)' == 'FSharp.Core'">
Condition="'$(GenerateTargetFrameworkAttribute)' == 'true' AND '$(AssemblyName)' == 'FSharp.Core'">
<ItemGroup>
<!-- Infrastructure puts AssemblyAttributes.fs at the beginning of the list and this will result and error when compiling FSharp.Core because all primitive types are not defined yet - fixup is required-->
<CompileAfter Include="@(CompileBefore)"/>
<CompileBefore Remove="@(CompileBefore)"/>
<!-- Infrastructure puts AssemblyAttributes.fs at the beginning of the list and this will result and error when compiling FSharp.Core because all primitive types are not defined yet - fixup is required-->
<CompileAfter Include="@(CompileBefore)"/>
<CompileBefore Remove="@(CompileBefore)"/>
</ItemGroup>
</Target>
<Target Name="BeforeBuild" BeforeTargets="Build">
Expand Down