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

Migrate to F# 4.0 #170

Merged
merged 6 commits into from
Jul 19, 2015
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
Binary file added .paket/paket.bootstrapper.exe
Binary file not shown.
38 changes: 38 additions & 0 deletions .paket/paket.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
<!-- Download Paket.exe if it does not already exist -->
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
</PropertyGroup>
<PropertyGroup>
<!-- Paket command -->
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketExePath)</PaketCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketBootStrapperExePath)</PaketBootStrapperCommand>
<!-- Commands -->
<PaketReferences Condition="!Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectDirectory)\paket.references</PaketReferences>
<PaketReferences Condition="Exists('$(MSBuildProjectFullPath).paket.references')">$(MSBuildProjectFullPath).paket.references</PaketReferences>
<RestoreCommand>$(PaketCommand) restore --references-files "$(PaketReferences)"</RestoreCommand>
<DownloadPaketCommand>$(PaketBootStrapperCommand)</DownloadPaketCommand>
<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">RestorePackages; $(BuildDependsOn);</BuildDependsOn>
</PropertyGroup>
<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate paket.exe -->
<Error Condition="'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')" Text="Unable to locate '$(PaketExePath)'" />
<MsBuild Targets="DownloadPaket" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)" />
</Target>
<Target Name="DownloadPaket">
<Exec Command="$(DownloadPaketCommand)" IgnoreStandardErrorWarningFormat="true" Condition=" '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(PaketRootPath)" Condition="Exists('$(PaketReferences)')" />
</Target>
</Project>
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 1.8.0-beta - 19-07-2015
* Migrate to F# 4.0 ([#170](https://github.com/dungpa/fantomas/pull/170))

#### 1.7.0 - 10-06-2015
* Print attributes on member arguments ([#168](https://github.com/dungpa/fantomas/pull/168))
* Do not misrecognize "then" blocks in explicit constructors ([#168](https://github.com/dungpa/fantomas/pull/168))
Expand Down
13 changes: 9 additions & 4 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
@echo off
cls
if not exist packages\FAKE\tools\Fake.exe (
src\.nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion
.paket\paket.bootstrapper.exe
if errorlevel 1 (
exit /b %errorlevel%
)

.paket\paket.exe restore
if errorlevel 1 (
exit /b %errorlevel%
)

packages\FAKE\tools\FAKE.exe build.fsx %*
6 changes: 0 additions & 6 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ Target "Clean" (fun _ ->
CleanDirs ["bin"; "nuget"]
)

Target "RestorePackages" (fun _ ->
!! "./**/packages.config"
|> Seq.iter (RestorePackage (fun p -> { p with OutputPath = "src/packages"; ToolPath = "src/.nuget/NuGet.exe" }))
)

Target "AssemblyInfo" (fun _ ->
let shared =
[ Attribute.Product project
Expand Down Expand Up @@ -121,7 +116,6 @@ Target "PublishNuGet" (fun _ ->
Target "All" DoNothing

"Clean"
==> "RestorePackages"
==> "AssemblyInfo"
==> "Build"
==> "UnitTests"
Expand Down
36 changes: 31 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
#!/bin/bash
#!/usr/bin/env bash
if test "$OS" = "Windows_NT"
then
# use .Net

if [ ! -e packages/FAKE/tools/FAKE.exe ]; then
mono src/.nuget/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion
fi
.paket/paket.bootstrapper.exe prerelease
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi

mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
.paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi

packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
else
# use mono
mono .paket/paket.bootstrapper.exe prerelease
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi

mono .paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
fi
7 changes: 7 additions & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source https://www.nuget.org/api/v2/

nuget FAKE
nuget Nuget.CommandLine
nuget FsCheck.Nunit 1.0.0 framework: >= net45
nuget FSharp.Compiler.Service 0.0.73 framework: >= net45
nuget FsUnit 1.3.0.1 framework: >= net45
15 changes: 15 additions & 0 deletions paket.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
NUGET
remote: https://www.nuget.org/api/v2
specs:
FAKE (3.36.0)
FsCheck (1.0.0) - framework: >= net45
FsCheck.Nunit (1.0.0) - framework: >= net45
FsCheck (>= 1.0.0)
NUnit (>= 2.6.3)
NUnit.Runners (>= 2.6.3)
FSharp.Compiler.Service (1.4.0-beta) - framework: >= net45
FsUnit (1.3.0.1) - framework: >= net45
NUnit (>= 2.6.3)
NuGet.CommandLine (2.8.5)
NUnit (2.6.3) - framework: >= net45
NUnit.Runners (2.6.4)
6 changes: 0 additions & 6 deletions src/.nuget/NuGet.Config

This file was deleted.

Binary file removed src/.nuget/NuGet.exe
Binary file not shown.
136 changes: 0 additions & 136 deletions src/.nuget/NuGet.targets

This file was deleted.

6 changes: 3 additions & 3 deletions src/Fantomas.Cmd/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("Fantomas")>]
[<assembly: AssemblyProductAttribute("Fantomas")>]
[<assembly: AssemblyDescriptionAttribute("Source code formatting tool for F#")>]
[<assembly: AssemblyVersionAttribute("1.7.0")>]
[<assembly: AssemblyFileVersionAttribute("1.7.0")>]
[<assembly: AssemblyVersionAttribute("1.8.0")>]
[<assembly: AssemblyFileVersionAttribute("1.8.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "1.7.0"
let [<Literal>] Version = "1.8.0"
22 changes: 13 additions & 9 deletions src/Fantomas.Cmd/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="2.0.0.0" newVersion="4.3.0.0" />
<bindingRedirect oldVersion="2.3.5.0" newVersion="4.3.0.0" />
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="2.0.0.0" newVersion="4.3.0.0" />
<bindingRedirect oldVersion="2.3.5.0" newVersion="4.3.0.0" />
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.3.13283" newVersion="2.6.3.13283" />
</dependentAssembly>
</assemblyBinding></runtime>
</configuration>
Loading