Skip to content

Commit

Permalink
Update build to FAKE 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Loic Denuziere committed Apr 13, 2019
1 parent 0ae94ac commit 5a7df92
Show file tree
Hide file tree
Showing 11 changed files with 1,042 additions and 357 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ obj/
/paket-files/
/.vscode/
nuget/*.paket.template
.paket/.store/
.paket/*.exe
.paket/paket
.paket/fake
179 changes: 147 additions & 32 deletions .paket/Paket.Restore.targets

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions .paket/paket.bootstrapper.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<Project ToolsVersion="15.0">

<Import Project="$(MSBuildThisFileDirectory)paket.bootstrapper.props" Condition="Exists('$(MSBuildThisFileDirectory)paket.bootstrapper.props')" />

<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory.TrimEnd('\\').TrimEnd('/'))</RepoRoot>

<PaketBootstrapperExe>$(RepoRoot)\paket.bootstrapper.exe</PaketBootstrapperExe>
<PaketBootstrapperExe Condition=" '$(OS)' != 'Windows_NT' ">$(RepoRoot)/paket.bootstrapper</PaketBootstrapperExe>
<PaketExe>$(RepoRoot)\paket.exe</PaketExe>
<PaketExe Condition=" '$(OS)' != 'Windows_NT' ">$(RepoRoot)/paket</PaketExe>
</PropertyGroup>

<Target Name="InstallPaketBootstrapper" Condition="Exists('$(PaketBootstrapperExe)') == false">
<Message Text='Installing paket.bootstrapper' Importance="High"/>
<PropertyGroup>
<InstallBootstrapperCommand>dotnet tool install paket.bootstrapper --tool-path "$(RepoRoot)"</InstallBootstrapperCommand>
<InstallBootstrapperCommand Condition=" '$(PaketBootstrapperVersion)' != '' ">$(InstallBootstrapperCommand) --version "[$(PaketBootstrapperVersion)]"</InstallBootstrapperCommand>
<InstallBootstrapperCommand Condition=" '$(PaketBootstrapperFeed)' != '' ">$(InstallBootstrapperCommand) --add-source "$(PaketBootstrapperFeed)"</InstallBootstrapperCommand>
<InstallBootstrapperCommand Condition=" '$(InstallBootstrapperOtherArgs)' != '' ">$(InstallBootstrapperCommand) $(InstallBootstrapperOtherArgs)"</InstallBootstrapperCommand>
</PropertyGroup>
<Exec Command="$(InstallBootstrapperCommand)" WorkingDirectory="$(RepoRoot)" />
</Target>

<Target Name="InstallPaket" DependsOnTargets="InstallPaketBootstrapper" Condition="Exists('$(PaketExe)') == false">
<Message Text='Running paket.bootstrapper to install paket' Importance="High"/>
<PropertyGroup>
<RunBootstrapperCommand>$(PaketBootstrapperExe) --as-tool --output-dir=$(RepoRoot)</RunBootstrapperCommand>
<RunBootstrapperCommand Condition=" Exists('$(RepoRoot)\paket.bootstrapper.exe.config') ">$(RunBootstrapperCommand) --config-file=$(RepoRoot)/paket.bootstrapper.exe.config</RunBootstrapperCommand>
<RunBootstrapperCommand Condition=" '$(RunBootstrapperOtherArgs)' != '' ">$(RunBootstrapperCommand) $(RunBootstrapperOtherArgs)</RunBootstrapperCommand>
</PropertyGroup>
<Exec Command='$(RunBootstrapperCommand)' WorkingDirectory="$(RepoRoot)" />
</Target>

<Target Name="Restore" DependsOnTargets="InstallPaket">
<Message Text='Paket ready, checking version:' Importance="High"/>
<Exec Command='$(PaketExe) --version' WorkingDirectory="$(RepoRoot)" />
</Target>

<Import Project="$(MSBuildThisFileDirectory)paket.bootstrapper.targets" Condition="Exists('$(MSBuildThisFileDirectory)paket.bootstrapper.targets')" />

</Project>
8 changes: 8 additions & 0 deletions .paket/paket.bootstrapper.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project ToolsVersion="15.0">

<PropertyGroup>
<PaketBootstrapperVersion>5.180.414</PaketBootstrapperVersion>
<PaketBootstrapperFeed>https://www.myget.org/F/paket-netcore-as-tool/api/v2</PaketBootstrapperFeed>
</PropertyGroup>

</Project>
Binary file removed .paket/paket.exe
Binary file not shown.
7 changes: 0 additions & 7 deletions WebSharper.Owin.Tests.SelfHost/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<Paket>True</Paket>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.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="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
Expand Down
8 changes: 4 additions & 4 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@echo off
setlocal

dotnet restore
if errorlevel 1 exit /b %errorlevel%

if not "%WsUpdate%"=="" (
.paket\paket.exe update -g wsbuild --no-install
if errorlevel 1 exit /b %errorlevel%
)

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

call paket-files\wsbuild\github.com\dotnet-websharper\build-script\WebSharper.Fake.cmd %*
call paket-files\wsbuild\github.com\dotnet-websharper\build-script\build.cmd %*
17 changes: 5 additions & 12 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#r "paket: groupref build //"
#load "paket-files/wsbuild/github.com/dotnet-websharper/build-script/WebSharper.Fake.fsx"
open Fake
open WebSharper.Fake

let targets =
WSTargets.Default (fun () -> GetSemVerOf "WebSharper" |> ComputeVersion)
|> MakeTargets

Target "Build" DoNothing
targets.BuildDebug ==> "Build"

Target "CI-Release" DoNothing
targets.CommitPublish ==> "CI-Release"

RunTargetOrDefault "Build"
LazyVersionFrom "WebSharper"
|> WSTargets.Default
|> MakeTargets
|> RunTargets
16 changes: 3 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
#!/bin/bash

set -e

paket() {
if [ "$OS" = "Windows_NT" ]; then
.paket/paket.exe "$@"
else
mono .paket/paket.exe "$@"
fi
}
dotnet restore

if [ "$WsUpdate" != "" ]; then
paket update -g wsbuild --no-install
.paket/paket update -g wsbuild --no-install
fi

paket restore

exec paket-files/wsbuild/github.com/dotnet-websharper/build-script/WebSharper.Fake.sh "$@"
. paket-files/wsbuild/github.com/dotnet-websharper/build-script/build.sh "$@"
17 changes: 12 additions & 5 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version 5.142.0
version 5.198.0
source https://api.nuget.org/v3/index.json
source https://daily.websharper.com/nuget

Expand All @@ -18,11 +18,18 @@ nuget Microsoft.Owin.StaticFiles 3.0.0
nuget FSharp.Core ~> 4.2.0

group build
framework: net45
framework: netstandard2.0
source https://api.nuget.org/v3/index.json

nuget FAKE
nuget Paket.Core 5.141.0
nuget Fake.Core.CommandLineParsing
nuget Fake.Core.Target
nuget Fake.IO.FileSystem
nuget Fake.DotNet.AssemblyInfoFile
nuget Fake.DotNet.Cli
nuget Fake.DotNet.MSBuild
nuget Fake.DotNet.Paket
nuget Fake.Tools.Git
nuget Paket.Core 5.198.0

group wsbuild
git https://github.com/dotnet-websharper/build-script
git https://github.com/dotnet-websharper/build-script fake5
Loading

0 comments on commit 5a7df92

Please sign in to comment.