Skip to content

Commit 95bfc9e

Browse files
committed
Fixup/cleanup/refactorings to build infra
1 parent 005d0e9 commit 95bfc9e

31 files changed

+232
-357
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ src/*.userprefs
1111
src/fsharp/FSStrings.resources
1212
lkg
1313
packages
14-
packages
1514
src/fsharp/FSharp.Build/*.resx
1615
src/fsharp/FSharp.Build-proto/*.resx
1716
src/fsharp/FSharp.Build-proto/*.resources

appveyor-build.cmd

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ set APPVEYOR_CI=1
55
:: Check prerequisites
66
if not '%VisualStudioVersion%' == '' goto vsversionset
77
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
8+
if exist "%ProgramFiles%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
89
if not '%VisualStudioVersion%' == '' goto vsversionset
910
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
11+
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
12+
1013
:vsversionset
11-
if '%VisualStudioVersion%' == '' echo Error: Could not find a Visual Studio Installed.MSBuild.exe. Please see http://www.visualstudio.com/en-us/news/vs2015-vs.aspx. && goto :eof
14+
if '%VisualStudioVersion%' == '' echo Error: Could not find an installation of Visual Studio && goto :eof
1215

13-
if '%VisualStudioVersion%'=='14.0' set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
14-
if '%VisualStudioVersion%'=='12.0' set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
15-
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. Please see http://www.microsoft.com/en-us/download/details.aspx?id=40760. && goto :eof
16+
if exist "%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
17+
if exist "%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
18+
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. && goto :eof
1619

1720
set _ngenexe="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe"
1821
if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :eof
@@ -24,17 +27,14 @@ if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :eof
2427
%_msbuildexe% src\fsharp-proto-build.proj
2528
@if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :eof
2629

27-
%_ngenexe% install proto\net40\bin\FSharp.Compiler-proto.dll
28-
%_ngenexe% install proto\net40\bin\fsharp.core.dll
29-
%_ngenexe% install proto\net40\bin\FSharp.Build-proto.dll
3030
%_ngenexe% install Proto\net40\bin\fsc-proto.exe
3131
@if ERRORLEVEL 1 echo Error: NGen of proto failed && goto :eof
3232

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

3636
%_msbuildexe% src/fsharp-compiler-build.proj /p:Configuration=Release
37-
@if ERRORLEVEL 1 echo Error: compile Release build failed && goto :eof
37+
@if ERRORLEVEL 1 echo Error: compiler build failed && goto :eof
3838

3939
%_msbuildexe% src/fsharp-library-build.proj /p:TargetFramework=portable47 /p:Configuration=Release
4040
@if ERRORLEVEL 1 echo Error: library portable47 build failed && goto :eof
@@ -65,11 +65,12 @@ if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :eof
6565
%_msbuildexe% src/fsharp-library-unittests-build.proj /p:TargetFramework=portable259 /p:Configuration=Release
6666
@if ERRORLEVEL 1 echo Error: library unittests build failed portable259 && goto :eof
6767

68+
6869
%_msbuildexe% vsintegration\fsharp-vsintegration-build.proj /p:TargetFramework=net40 /p:Configuration=Release
69-
@if ERRORLEVEL 1 echo Error: library unittests build failed vsintegration-unittests && goto :eof
70+
@if ERRORLEVEL 1 echo Error: VS integration build failed && goto :eof
7071

7172
%_msbuildexe% vsintegration\fsharp-vsintegration-unittests-build.proj /p:TargetFramework=net40 /p:Configuration=Release
72-
@if ERRORLEVEL 1 echo Error: library unittests build failed vsintegration-unittests && goto :eof
73+
@if ERRORLEVEL 1 echo Error: VS integration unit tests build failed && goto :eof
7374

7475
@echo on
7576
call src\update.cmd release -ngen

src/FSharpSource.Settings.targets

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,14 @@
7171
<OutputPath Condition="'$(OutputPath)' == ''">bin\$(Configuration)</OutputPath>
7272
<WarningLevel Condition=" '$(WarningLevel)' == '' ">3</WarningLevel>
7373
</PropertyGroup>
74+
75+
<PropertyGroup>
76+
<DefineConstants Condition="'$(VisualStudioVersion)'=='12.0' AND '$(ProjectLanguage)' == 'VisualBasic'">$(DefineConstants),VS_VERSION_DEV12=True</DefineConstants>
77+
<DefineConstants Condition="'$(VisualStudioVersion)'=='12.0' AND '$(ProjectLanguage)' != 'VisualBasic'">$(DefineConstants);VS_VERSION_DEV12</DefineConstants>
78+
</PropertyGroup>
79+
80+
<PropertyGroup>
81+
<MSBuildVersionSuffix>core</MSBuildVersionSuffix>
82+
<MSBuildVersionSuffix Condition="'$(VisualStudioVersion)' == '12.0'">V12.0</MSBuildVersionSuffix>
83+
</PropertyGroup>
7484
</Project>

src/FSharpSource.msbuildreferences.targets

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/FSharpSource.targets

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
</Otherwise>
6565
</Choose>
6666

67-
<Import Project="FSharpSource.msbuildreferences.targets" />
68-
6967
<!-- For the proto build, portable and Silverlight framework implementations, we don't use strong names. -->
7068
<!-- For Silverlight, there is no way to disable strong name verification, so using the Microsoft name is not possible -->
7169
<PropertyGroup Condition="'$(StrongNames)' != 'true'">
@@ -97,6 +95,13 @@
9795

9896
<PropertyGroup>
9997
<DefineConstants>$(DefineConstants);OPEN_BUILD</DefineConstants>
98+
</PropertyGroup>
99+
100+
<PropertyGroup>
101+
<NUnitVersion>2.6.3</NUnitVersion>
102+
<NUnitFullVersion>2.6.3.13283</NUnitFullVersion>
103+
<NUnitLibDir>$(FSharpSourcesRoot)\..\packages\NUnit.$(NUnitVersion)\lib\</NUnitLibDir>
104+
<NunitToolsLibDir>$(FSharpSourcesRoot)\..\packages\NUnit.Runners.$(NUnitVersion)\tools\lib\</NunitToolsLibDir>
100105
</PropertyGroup>
101106

102107
<!-- v2.0-specific flags -->
@@ -724,7 +729,7 @@
724729
Outputs="@(CustomCopyLocal->'$(OutDir)%(TargetFilename)')"
725730
Condition="'$(targetCLIDir)'!='Silverlight/4.0/'"
726731
>
727-
<Exec Command="$(FSharpSourcesRoot)\fsharp\FSharp.Build\subst.exe &quot;%(CustomCopyLocal.FullPath)&quot; {FinalDir} &quot;$([System.IO.Path]::GetFullPath('$(OutputPath)'))\&quot; {LkgVersion} $(LkgVersion) {BuildSuffix} &quot;$(FsBuildSuffix)&quot; {FSharpTargetsDir} &quot;%24(MSBuildThisFileDirectory)&quot; &gt; $(OutDir)%(CustomCopyLocal.TargetFilename) "/>
732+
<Exec Command="$(FSharpSourcesRoot)\fsharp\FSharp.Build\subst.exe &quot;%(CustomCopyLocal.FullPath)&quot; {VisualStudioVersion} $(VisualStudioVersion) {FinalDir} &quot;$([System.IO.Path]::GetFullPath('$(OutputPath)'))\&quot; {LkgVersion} $(LkgVersion) {BuildSuffix} &quot;$(FsBuildSuffix)&quot; {FSharpTargetsDir} &quot;%24(MSBuildThisFileDirectory)&quot; &gt; $(OutDir)%(CustomCopyLocal.TargetFilename) "/>
728733
<!-- Make sure it will get cleaned -->
729734
<CreateItem Include="$(OutDir)%(CustomCopyLocal.TargetFilename)">
730735
<Output TaskParameter="Include" ItemName="FileWrites"/>
@@ -745,11 +750,4 @@
745750
<Target Name="BeforeBuild" BeforeTargets="Build">
746751
<Exec Command=".\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages" WorkingDirectory="$(FSharpSourcesRoot)\.."/>
747752
</Target>
748-
749-
<Target Name="BeforeResolveReferences">
750-
<CreateProperty Value="$(ProjectDir)..\..\..\packages\NUnit.2.6.3\lib\;$(ProjectDir)..\..\..\packages\NUnit.Runners.2.6.3\tools\lib\;$(AssemblySearchPaths)">
751-
<Output TaskParameter="Value"
752-
PropertyName="AssemblySearchPaths" />
753-
</CreateProperty>
754-
</Target>
755753
</Project>

src/fsharp/FSharp.Build/FSharp.Build.fsproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
<ItemGroup>
4545
<Reference Include="mscorlib" />
4646
<Reference Include="System" />
47-
<Reference Include="$(MsBuild_FrameworkReference)" />
48-
<Reference Include="$(MsBuild_EngineReference)" />
49-
<Reference Include="$(MsBuild_Reference)" />
50-
<Reference Include="$(MsBuild_UtilitiesReference)" />
51-
<Reference Include="$(MsBuild_TaskReference)" />
47+
<Reference Include="Microsoft.Build.Framework, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
48+
<Reference Include="Microsoft.Build.Engine, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
49+
<Reference Include="Microsoft.Build, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
50+
<Reference Include="Microsoft.Build.Utilities.$(MSBuildVersionSuffix)" />
51+
<Reference Include="Microsoft.Build.Tasks.$(MSBuildVersionSuffix)" />
5252
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
5353
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
5454
<Name>FSharp.Core</Name>

src/fsharp/FSharp.Compiler.Unittests/FSharp.Compiler.Unittests.fsproj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@
4343
<WarningLevel>3</WarningLevel>
4444
</PropertyGroup>
4545
<ItemGroup>
46-
<!-- need full name and SpecificVersion = true in order to convince msbuild to allow this reference when targeting portable47 -->
47-
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'" >
48-
<SpecificVersion>true</SpecificVersion>
49-
<HintPath>$(FSharpSourcesRoot)\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
46+
<Reference Include="nunit.framework" >
47+
<Private>True</Private>
48+
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
5049
</Reference>
51-
<Reference Include="NUnitFramework" Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl3-wp'" />
5250
</ItemGroup>
5351
<ItemGroup Condition="!$(TargetFramework.Contains('portable'))">
5452
<Reference Include="mscorlib" />

src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,11 @@
528528
<Reference Include="System.Windows.Forms" />
529529
<Reference Include="System.Runtime.Remoting" />
530530
<Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
531-
<Reference Include="$(MsBuild_FrameworkReference)" />
532-
<Reference Include="$(MsBuild_EngineReference)" />
533-
<Reference Include="$(MsBuild_Reference)" />
534-
<Reference Include="$(MsBuild_UtilitiesReference)" />
535-
<Reference Include="$(MsBuild_TaskReference)" />
531+
<Reference Include="Microsoft.Build.Framework, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
532+
<Reference Include="Microsoft.Build.Engine, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
533+
<Reference Include="Microsoft.Build, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
534+
<Reference Include="Microsoft.Build.Utilities.$(MSBuildVersionSuffix)" />
535+
<Reference Include="Microsoft.Build.Tasks.$(MSBuildVersionSuffix)" />
536536
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
537537
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
538538
<Name>FSharp.Core</Name>

src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
<DefineConstants Condition=" '$(TargetFramework)' == 'sl5' ">$(DefineConstants);SILVERLIGHT</DefineConstants>
2626
<DefineConstants>$(DefineConstants);EXTENSIONTYPING;$(TargetFramework.ToLower())</DefineConstants>
2727
</PropertyGroup>
28-
<PropertyGroup>
29-
<DefineConstants Condition=" '$(VisualStudioVersion)' == '12.0' ">$(DefineConstants);FX_4_3_1_0</DefineConstants>
30-
<DefineConstants Condition=" '$(VisualStudioVersion)' == '14.0' ">$(DefineConstants);FX_4_4_0_0</DefineConstants>
31-
</PropertyGroup>
3228
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
3329
<DebugSymbols>true</DebugSymbols>
3430
<DebugType>full</DebugType>
@@ -48,9 +44,10 @@
4844
</PropertyGroup>
4945
<ItemGroup>
5046
<!-- need full name and SpecificVersion = true in order to convince msbuild to allow this reference when targeting portable47 -->
51-
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'" >
47+
<Reference Include="nunit.framework, Version=$(NUnitFullVersion), Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'" >
5248
<SpecificVersion>true</SpecificVersion>
53-
<HintPath>$(FSharpSourcesRoot)\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
49+
<Private>True</Private>
50+
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
5451
</Reference>
5552
<Reference Include="NUnitFramework" Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl3-wp'" />
5653
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
@@ -109,10 +106,4 @@
109106
<Compile Include="SurfaceArea.$(TargetFramework).fs" />
110107
</ItemGroup>
111108
<Import Project="$(FSharpSourcesRoot)\FSharpSource.targets" />
112-
<Target Name="BeforeResolveReferences" Condition="'$(UseNugetPackages)'=='true'">
113-
<CreateProperty Value="$(ProjectDir)..\..\..\packages\NUnit.2.6.3\lib\;$(ProjectDir)..\..\..\packages\NUnit.Runners.2.6.3\tools\lib\;$(AssemblySearchPaths)">
114-
<Output TaskParameter="Value"
115-
PropertyName="AssemblySearchPath" />
116-
</CreateProperty>
117-
</Target>
118109
</Project>

src/fsharp/FSharp.LanguageService.Compiler/FSharp.LanguageService.Compiler.fsproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,11 @@
473473
<Reference Include="System.Windows.Forms" />
474474
<Reference Include="System.Runtime.Remoting" />
475475
<Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
476-
<Reference Include="$(MsBuild_FrameworkReference)" />
477-
<Reference Include="$(MsBuild_EngineReference)" />
478-
<Reference Include="$(MsBuild_Reference)" />
479-
<Reference Include="$(MsBuild_UtilitiesReference)" />
480-
<Reference Include="$(MsBuild_TaskReference)" />
476+
<Reference Include="Microsoft.Build.Framework, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
477+
<Reference Include="Microsoft.Build.Engine, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
478+
<Reference Include="Microsoft.Build, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
479+
<Reference Include="Microsoft.Build.Utilities.$(MSBuildVersionSuffix)" />
480+
<Reference Include="Microsoft.Build.Tasks.$(MSBuildVersionSuffix)" />
481481
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj" >
482482
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
483483
<Name>FSharp.Core</Name>

0 commit comments

Comments
 (0)