Skip to content

Commit

Permalink
Fixup/cleanup/refactorings to build infra
Browse files Browse the repository at this point in the history
  • Loading branch information
latkin committed Feb 10, 2015
1 parent 005d0e9 commit 95bfc9e
Show file tree
Hide file tree
Showing 31 changed files with 232 additions and 357 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ src/*.userprefs
src/fsharp/FSStrings.resources
lkg
packages
packages
src/fsharp/FSharp.Build/*.resx
src/fsharp/FSharp.Build-proto/*.resx
src/fsharp/FSharp.Build-proto/*.resources
Expand Down
21 changes: 11 additions & 10 deletions appveyor-build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ set APPVEYOR_CI=1
:: Check prerequisites
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if exist "%ProgramFiles%\Microsoft Visual Studio 14.0\common7\ide\devenv.exe" set VisualStudioVersion=14.0
if not '%VisualStudioVersion%' == '' goto vsversionset
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" set VisualStudioVersion=12.0

:vsversionset
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
if '%VisualStudioVersion%' == '' echo Error: Could not find an installation of Visual Studio && goto :eof

if '%VisualStudioVersion%'=='14.0' set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
if '%VisualStudioVersion%'=='12.0' set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
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
if exist "%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles(x86)%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if exist "%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe" set _msbuildexe="%ProgramFiles%\MSBuild\%VisualStudioVersion%\Bin\MSBuild.exe"
if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. && goto :eof

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

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

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

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

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


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

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

@echo on
call src\update.cmd release -ngen
Expand Down
10 changes: 10 additions & 0 deletions src/FSharpSource.Settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,14 @@
<OutputPath Condition="'$(OutputPath)' == ''">bin\$(Configuration)</OutputPath>
<WarningLevel Condition=" '$(WarningLevel)' == '' ">3</WarningLevel>
</PropertyGroup>

<PropertyGroup>
<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>
</PropertyGroup>
</Project>
30 changes: 0 additions & 30 deletions src/FSharpSource.msbuildreferences.targets

This file was deleted.

18 changes: 8 additions & 10 deletions src/FSharpSource.targets
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
</Otherwise>
</Choose>

<Import Project="FSharpSource.msbuildreferences.targets" />

<!-- For the proto build, portable and Silverlight framework implementations, we don't use strong names. -->
<!-- For Silverlight, there is no way to disable strong name verification, so using the Microsoft name is not possible -->
<PropertyGroup Condition="'$(StrongNames)' != 'true'">
Expand Down Expand Up @@ -97,6 +95,13 @@

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

<PropertyGroup>
<NUnitVersion>2.6.3</NUnitVersion>
<NUnitFullVersion>2.6.3.13283</NUnitFullVersion>
<NUnitLibDir>$(FSharpSourcesRoot)\..\packages\NUnit.$(NUnitVersion)\lib\</NUnitLibDir>
<NunitToolsLibDir>$(FSharpSourcesRoot)\..\packages\NUnit.Runners.$(NUnitVersion)\tools\lib\</NunitToolsLibDir>
</PropertyGroup>

<!-- v2.0-specific flags -->
Expand Down Expand Up @@ -724,7 +729,7 @@
Outputs="@(CustomCopyLocal->'$(OutDir)%(TargetFilename)')"
Condition="'$(targetCLIDir)'!='Silverlight/4.0/'"
>
<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) "/>
<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) "/>
<!-- Make sure it will get cleaned -->
<CreateItem Include="$(OutDir)%(CustomCopyLocal.TargetFilename)">
<Output TaskParameter="Include" ItemName="FileWrites"/>
Expand All @@ -745,11 +750,4 @@
<Target Name="BeforeBuild" BeforeTargets="Build">
<Exec Command=".\.nuget\NuGet.exe restore packages.config -PackagesDirectory packages" WorkingDirectory="$(FSharpSourcesRoot)\.."/>
</Target>

<Target Name="BeforeResolveReferences">
<CreateProperty Value="$(ProjectDir)..\..\..\packages\NUnit.2.6.3\lib\;$(ProjectDir)..\..\..\packages\NUnit.Runners.2.6.3\tools\lib\;$(AssemblySearchPaths)">
<Output TaskParameter="Value"
PropertyName="AssemblySearchPaths" />
</CreateProperty>
</Target>
</Project>
10 changes: 5 additions & 5 deletions src/fsharp/FSharp.Build/FSharp.Build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="$(MsBuild_FrameworkReference)" />
<Reference Include="$(MsBuild_EngineReference)" />
<Reference Include="$(MsBuild_Reference)" />
<Reference Include="$(MsBuild_UtilitiesReference)" />
<Reference Include="$(MsBuild_TaskReference)" />
<Reference Include="Microsoft.Build.Framework, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build.Engine, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build.Utilities.$(MSBuildVersionSuffix)" />
<Reference Include="Microsoft.Build.Tasks.$(MSBuildVersionSuffix)" />
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
<Name>FSharp.Core</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@
<WarningLevel>3</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- need full name and SpecificVersion = true in order to convince msbuild to allow this reference when targeting portable47 -->
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'" >
<SpecificVersion>true</SpecificVersion>
<HintPath>$(FSharpSourcesRoot)\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework" >
<Private>True</Private>
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="NUnitFramework" Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl3-wp'" />
</ItemGroup>
<ItemGroup Condition="!$(TargetFramework.Contains('portable'))">
<Reference Include="mscorlib" />
Expand Down
10 changes: 5 additions & 5 deletions src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -528,11 +528,11 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="$(MsBuild_FrameworkReference)" />
<Reference Include="$(MsBuild_EngineReference)" />
<Reference Include="$(MsBuild_Reference)" />
<Reference Include="$(MsBuild_UtilitiesReference)" />
<Reference Include="$(MsBuild_TaskReference)" />
<Reference Include="Microsoft.Build.Framework, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build.Engine, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build.Utilities.$(MSBuildVersionSuffix)" />
<Reference Include="Microsoft.Build.Tasks.$(MSBuildVersionSuffix)" />
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
<Name>FSharp.Core</Name>
Expand Down
15 changes: 3 additions & 12 deletions src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
<DefineConstants Condition=" '$(TargetFramework)' == 'sl5' ">$(DefineConstants);SILVERLIGHT</DefineConstants>
<DefineConstants>$(DefineConstants);EXTENSIONTYPING;$(TargetFramework.ToLower())</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition=" '$(VisualStudioVersion)' == '12.0' ">$(DefineConstants);FX_4_3_1_0</DefineConstants>
<DefineConstants Condition=" '$(VisualStudioVersion)' == '14.0' ">$(DefineConstants);FX_4_4_0_0</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand All @@ -48,9 +44,10 @@
</PropertyGroup>
<ItemGroup>
<!-- need full name and SpecificVersion = true in order to convince msbuild to allow this reference when targeting portable47 -->
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'" >
<Reference Include="nunit.framework, Version=$(NUnitFullVersion), Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'" >
<SpecificVersion>true</SpecificVersion>
<HintPath>$(FSharpSourcesRoot)\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="NUnitFramework" Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl3-wp'" />
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
Expand Down Expand Up @@ -109,10 +106,4 @@
<Compile Include="SurfaceArea.$(TargetFramework).fs" />
</ItemGroup>
<Import Project="$(FSharpSourcesRoot)\FSharpSource.targets" />
<Target Name="BeforeResolveReferences" Condition="'$(UseNugetPackages)'=='true'">
<CreateProperty Value="$(ProjectDir)..\..\..\packages\NUnit.2.6.3\lib\;$(ProjectDir)..\..\..\packages\NUnit.Runners.2.6.3\tools\lib\;$(AssemblySearchPaths)">
<Output TaskParameter="Value"
PropertyName="AssemblySearchPath" />
</CreateProperty>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,11 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="$(MsBuild_FrameworkReference)" />
<Reference Include="$(MsBuild_EngineReference)" />
<Reference Include="$(MsBuild_Reference)" />
<Reference Include="$(MsBuild_UtilitiesReference)" />
<Reference Include="$(MsBuild_TaskReference)" />
<Reference Include="Microsoft.Build.Framework, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build.Engine, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build.Utilities.$(MSBuildVersionSuffix)" />
<Reference Include="Microsoft.Build.Tasks.$(MSBuildVersionSuffix)" />
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj" >
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
<Name>FSharp.Core</Name>
Expand Down
8 changes: 4 additions & 4 deletions src/fsharp/ReferenceResolution.fs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ module internal MSBuildResolver =

let SupportedNetFrameworkVersions = set [ Net20; Net30; Net35; Net40; Net45; Net451; (*SL only*) "v5.0" ]

#if FX_ATLEAST_45
let GetPathToDotNetFramework(v) =
#if FX_ATLEAST_45
let v =
match v with
| Net11 -> Some TargetDotNetFrameworkVersion.Version11
Expand All @@ -115,13 +115,13 @@ module internal MSBuildResolver =
| x -> [x]
| _ -> []
#else
let GetPathToDotNetFramework(_) =
// FX_ATLEAST_45 is not defined for step when we build compiler with proto compiler.
ignore v
[]
#endif

#if FX_ATLEAST_45
let DeriveTargetFrameworkDirectoriesFor40Plus(version) =
#if FX_ATLEAST_45
// starting with .Net 4.0, the runtime dirs (WindowsFramework) are never used by MSBuild RAR
let v =
match version with
Expand All @@ -136,8 +136,8 @@ module internal MSBuildResolver =
| x -> [x]
| None -> []
#else
let DeriveTargetFrameworkDirectoriesFor40Plus(_) =
// FX_ATLEAST_45 is not defined for step when we build compiler with proto compiler.
ignore version
[]
#endif

Expand Down
16 changes: 1 addition & 15 deletions src/fsharp/ast.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1706,20 +1706,6 @@ let ParseAssemblyCodeType s m =
IL.EcmaILGlobals.typ_Object
#endif

#if BUILDING_PROTO
let last (source : seq<_>) =
use e = source.GetEnumerator()
if e.MoveNext() then
let mutable res = e.Current
while (e.MoveNext()) do res <- e.Current
res
else
raise (new System.InvalidOperationException())
#else
let last = Seq.last
#endif


//------------------------------------------------------------------------
// AST constructors
//------------------------------------------------------------------------
Expand Down Expand Up @@ -1755,7 +1741,7 @@ let mkSynDotBrackSeqSliceGet m mDot arr (argslist:list<SynIndexerArg>) =
| SynIndexerArg.One x -> yield x
| _ -> () ]
if notsliced.Length = argslist.Length then
SynExpr.DotIndexedGet(arr,[SynIndexerArg.One (SynExpr.Tuple(notsliced,[],unionRanges (Seq.head notsliced).Range (last notsliced).Range))],mDot,m)
SynExpr.DotIndexedGet(arr,[SynIndexerArg.One (SynExpr.Tuple(notsliced,[],unionRanges (List.head notsliced).Range (List.last notsliced).Range))],mDot,m)
else
SynExpr.DotIndexedGet(arr,argslist,mDot,m)

Expand Down
Loading

0 comments on commit 95bfc9e

Please sign in to comment.