Skip to content

Commit

Permalink
tool restore
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Nov 22, 2019
1 parent d405ac4 commit a5dbc6c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 0 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@echo off

dotnet tool restore

.paket\paket.exe restore
if errorlevel 1 (
exit /b %errorlevel%
Expand Down
14 changes: 13 additions & 1 deletion build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ let stable =
| _ -> release


let runDotnet workingDir args =
let result =
ExecProcess (fun info ->
info.FileName <- dotnetExePath
info.WorkingDirectory <- workingDir
info.Arguments <- args) TimeSpan.MaxValue
if result <> 0 then
failwithf "dotnet %s failed" args

let testSuiteFilterFlakyTests = getEnvironmentVarAsBoolOrDefault "PAKET_TESTSUITE_FLAKYTESTS" false

let genFSAssemblyInfo (projectPath: string) =
Expand Down Expand Up @@ -186,13 +195,14 @@ let runCmdIn workDir exe =
let dotnet workDir = runCmdIn workDir "dotnet"

Target "DotnetRestore" (fun _ ->

//WORKAROUND dotnet restore with paket doesnt restore the PackageReference of SourceLink
// ref https://github.com/fsprojects/Paket/issues/2930
Paket.Restore (fun p ->
{ p with
Group = "NetCoreTools" })

runDotnet "." "tool restore"

DotNetCli.Restore (fun c ->
{ c with
Project = "Paket.sln"
Expand Down Expand Up @@ -274,6 +284,7 @@ Target "RunIntegrationTestsNetCore" (fun _ ->
TimeOut = TimeSpan.FromMinutes 60.
})
)

"Clean" ==> "DotnetPublish" ==> "RunIntegrationTestsNetCore"

// --------------------------------------------------------------------------------------
Expand Down Expand Up @@ -361,6 +372,7 @@ Target "RunIntegrationTests" (fun _ ->
Where = if testSuiteFilterFlakyTests then "cat==Flaky" else "cat!=Flaky"
TimeOut = TimeSpan.FromMinutes 40. })
)

"Clean" ==> "Build" ==> "RunIntegrationTests"


Expand Down
8 changes: 3 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#!/usr/bin/env bash
if test "$OS" = "Windows_NT"
then
dotnet tool restore

# use .Net
.paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
MSBuild=`pwd -W`/packages/build/RoslynTools.MSBuild/tools/msbuild/MSBuild.exe packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
MSBuild=`pwd -W`/packages/build/RoslynTools.MSBuild/tools/msbuild/MSBuild.exe packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
else
mono .paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
if [ $exit_code -ne 0 ]; then
certificate_count=$(certmgr -list -c Trust | grep X.509 | wc -l)
if [ $certificate_count -le 1 ]; then
echo "Couldn't download Paket. This might be because your Mono installation"
Expand All @@ -30,6 +28,6 @@ else
fi
# Note: the bundled MSBuild crashes hard on linux, so we still rely on the system-installed version
#export MSBuild=packages/build/RoslynTools.MSBuild/tools/msbuild/MSBuild.exe
mono packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
mono packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
fi

0 comments on commit a5dbc6c

Please sign in to comment.