Skip to content

Commit

Permalink
Merge pull request #1946 from kblohm/handleUserCancel
Browse files Browse the repository at this point in the history
WIP: Run final targets after user cancels with ctrl+c
  • Loading branch information
matthid authored May 21, 2018
2 parents 8640251 + e3242b1 commit 4ee2ee3
Show file tree
Hide file tree
Showing 11 changed files with 662 additions and 254 deletions.
13 changes: 4 additions & 9 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" />
</Exec>

<!-- Debug whats going on -->
<Message Importance="low" Text="calling paket restore with targetframework=$(TargetFramework) targetframeworks=$(TargetFrameworks)" />

<PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
<!-- if no hash has been done yet fall back to just reading in the files and comparing them -->
<PaketRestoreCachedHash Condition=" '$(PaketRestoreCachedHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
Expand All @@ -80,11 +77,9 @@
<!-- Step 2 Detect project specific changes -->
<ItemGroup>
<MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
<!-- Don't include all frameworks when msbuild explicitly asks for a single one -->
<MyTargetFrameworks Condition="'$(TargetFrameworks)' != '' AND '$(TargetFramework)' == '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
<MyTargetFrameworks Condition="'@(TargetFrameworks)' != '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
<PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths>
</ItemGroup>
<Message Importance="low" Text="MyTargetFrameworks=@(MyTargetFrameworks) PaketResolvedFilePaths=@(PaketResolvedFilePaths)" />
<PropertyGroup>
<PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
<!-- MyProject.fsproj.paket.references has the highest precedence -->
Expand All @@ -94,6 +89,7 @@
<!-- paket.references -->
<PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\paket.references</PaketOriginalReferencesFilePath>

<PaketResolvedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).$(TargetFramework).paket.resolved</PaketResolvedFilePath>
<DoAllResolvedFilesExist>false</DoAllResolvedFilesExist>
<DoAllResolvedFilesExist Condition="Exists(%(PaketResolvedFilePaths.Identity))">true</DoAllResolvedFilesExist>
<PaketRestoreRequired>true</PaketRestoreRequired>
Expand All @@ -116,7 +112,7 @@
<!-- Step 2 b detect relevant changes in project file (new targetframework) -->
<PropertyGroup Condition=" '$(DoAllResolvedFilesExist)' != 'true' ">
<PaketRestoreRequired>true</PaketRestoreRequired>
<PaketRestoreRequiredReason>target-framework '$(TargetFramework)' or '$(TargetFrameworks)' files @(PaketResolvedFilePaths)</PaketRestoreRequiredReason>
<PaketRestoreRequiredReason>target-framework '$(TargetFramework)' or '$(TargetFrameworks)'</PaketRestoreRequiredReason>
</PropertyGroup>

<!-- Step 3 Restore project specific stuff if required -->
Expand Down Expand Up @@ -144,9 +140,8 @@
</PaketReferencesFileLinesInfo>
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
<PrivateAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'true'">All</PrivateAssets>
<ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
</PackageReference>
</ItemGroup>

Expand Down
4 changes: 1 addition & 3 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,6 @@ Target.create "Release_GenerateDocs" (fun _ ->

Target.Description "Full Build & Test and publish results as artifacts."
Target.create "Release_BuildAndTest" ignore

open Fake.Core.TargetOperators

"CheckReleaseSecrets"
Expand Down Expand Up @@ -1683,6 +1682,5 @@ let prevDocs =
// A 'Release' includes a 'CheckReleaseSecrets'
"CheckReleaseSecrets"
==> "Release"

// start build
//start build
Target.runOrDefault "Default"
3 changes: 2 additions & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ nuget FSharp.Compiler.Service content: none
nuget Octokit
nuget System.Net.Http
nuget Microsoft.DotNet.PlatformAbstractions
nuget FSharp.Control.Reactive
// From FSharp.Compiler.Service, but manually managed because of rename
nuget System.ValueTuple copy_local: true, redirects:force

Expand Down Expand Up @@ -151,7 +152,7 @@ group netcore
nuget Newtonsoft.Json
nuget Paket.Core prerelease
nuget Mono.Cecil prerelease

nuget FSharp.Control.Reactive
// Testing
nuget Expecto >= 5.0

Expand Down
Loading

0 comments on commit 4ee2ee3

Please sign in to comment.