Skip to content

Commit 7265992

Browse files
committed
global dotnet cli-tool
1 parent fd04162 commit 7265992

File tree

10 files changed

+452
-305
lines changed

10 files changed

+452
-305
lines changed

.paket/Paket.Restore.targets

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
<Output TaskParameter="ConsoleOutput" PropertyName="PaketRestoreLockFileHash" />
6161
</Exec>
6262

63-
<!-- Debug whats going on -->
64-
<Message Importance="low" Text="calling paket restore with targetframework=$(TargetFramework) targetframeworks=$(TargetFrameworks)" />
65-
6663
<PropertyGroup Condition="Exists('$(PaketRestoreCacheFile)') ">
6764
<!-- if no hash has been done yet fall back to just reading in the files and comparing them -->
6865
<PaketRestoreCachedHash Condition=" '$(PaketRestoreCachedHash)' == '' ">$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
@@ -80,11 +77,9 @@
8077
<!-- Step 2 Detect project specific changes -->
8178
<ItemGroup>
8279
<MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
83-
<!-- Don't include all frameworks when msbuild explicitly asks for a single one -->
84-
<MyTargetFrameworks Condition="'$(TargetFrameworks)' != '' AND '$(TargetFramework)' == '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
80+
<MyTargetFrameworks Condition="'@(TargetFrameworks)' != '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
8581
<PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths>
8682
</ItemGroup>
87-
<Message Importance="low" Text="MyTargetFrameworks=@(MyTargetFrameworks) PaketResolvedFilePaths=@(PaketResolvedFilePaths)" />
8883
<PropertyGroup>
8984
<PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
9085
<!-- MyProject.fsproj.paket.references has the highest precedence -->
@@ -94,6 +89,7 @@
9489
<!-- paket.references -->
9590
<PaketOriginalReferencesFilePath Condition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\paket.references</PaketOriginalReferencesFilePath>
9691

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

122118
<!-- Step 3 Restore project specific stuff if required -->
@@ -144,9 +140,8 @@
144140
</PaketReferencesFileLinesInfo>
145141
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
146142
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
147-
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
143+
<PrivateAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'true'">All</PrivateAssets>
148144
<ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
149-
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
150145
</PackageReference>
151146
</ItemGroup>
152147

Fake.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Fsc", "src/app/
141141
EndProject
142142
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fake.BuildServer.GitLab", "src/app/Fake.BuildServer.GitLab/Fake.BuildServer.GitLab.fsproj", "{F778A9E5-FC1A-4934-A6B9-98C84BE9A667}"
143143
EndProject
144+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "fake-cli", "src/app/fake-cli/fake-cli.fsproj", "{9E26B2AE-856A-42B6-9670-8766919F7D25}"
145+
EndProject
144146
Global
145147
GlobalSection(SolutionConfigurationPlatforms) = preSolution
146148
Debug|Any CPU = Debug|Any CPU
@@ -871,6 +873,18 @@ Global
871873
{F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x64.Build.0 = Release|x64
872874
{F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x86.ActiveCfg = Release|x86
873875
{F778A9E5-FC1A-4934-A6B9-98C84BE9A667}.Release|x86.Build.0 = Release|x86
876+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
877+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Debug|Any CPU.Build.0 = Debug|Any CPU
878+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Debug|x64.ActiveCfg = Debug|Any CPU
879+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Debug|x64.Build.0 = Debug|Any CPU
880+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Debug|x86.ActiveCfg = Debug|Any CPU
881+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Debug|x86.Build.0 = Debug|Any CPU
882+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Release|Any CPU.ActiveCfg = Release|Any CPU
883+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Release|Any CPU.Build.0 = Release|Any CPU
884+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Release|x64.ActiveCfg = Release|Any CPU
885+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Release|x64.Build.0 = Release|Any CPU
886+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Release|x86.ActiveCfg = Release|Any CPU
887+
{9E26B2AE-856A-42B6-9670-8766919F7D25}.Release|x86.Build.0 = Release|Any CPU
874888
EndGlobalSection
875889
GlobalSection(SolutionProperties) = preSolution
876890
HideSolutionNode = FALSE
@@ -938,6 +952,7 @@ Global
938952
{71259EF7-41FD-4068-BD85-E4C7F67EAC25} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A}
939953
{32A82EF2-BB35-40A2-9418-904ECFC1EF47} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A}
940954
{F778A9E5-FC1A-4934-A6B9-98C84BE9A667} = {901F162F-8925-4390-89C5-9EE2C343F744}
955+
{9E26B2AE-856A-42B6-9670-8766919F7D25} = {901F162F-8925-4390-89C5-9EE2C343F744}
941956
EndGlobalSection
942957
GlobalSection(ExtensibilityGlobals) = postSolution
943958
SolutionGuid = {058A0C5E-2216-4306-8AFB-0AE28320C26A}

build.fsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ nuget Fake.Windows.Chocolatey prerelease
3030
nuget Fake.Tools.Git prerelease
3131
nuget Mono.Cecil prerelease
3232
nuget Suave
33+
nuget Newtonsoft.Json
3334
nuget Octokit //"
3435
#endif
3536

@@ -49,6 +50,7 @@ open System.Reflection
4950
#r "Paket.Core.dll"
5051
#r "packages/build/System.Net.Http/lib/net46/System.Net.Http.dll"
5152
#r "packages/build/Octokit/lib/net45/Octokit.dll"
53+
#r "packages/build/Newtonsoft.Json/lib/net45/Newtonsoft.Json.dll"
5254
#I "packages/build/SourceLink.Fake/tools/"
5355

5456
#r "System.IO.Compression"
@@ -60,7 +62,7 @@ open System.Reflection
6062
//let execContext = Fake.Core.Context.FakeExecutionContext.Create false "build.fsx" []
6163
//Fake.Core.Context.setExecutionContext (Fake.Core.Context.RuntimeContext.Fake execContext)
6264
//#endif
63-
// #load "src/app/Fake.DotNet.FSFormatting/FSFormatting.fs"
65+
#load "src/app/Fake.DotNet.Cli/DotNet.fs"
6466
open System.IO
6567
open Fake.Api
6668
open Fake.Core
@@ -225,7 +227,8 @@ Trace.setBuildNumber nugetVersion
225227
//if current |> Seq.contains CoreTracing.defaultConsoleTraceListener |> not then
226228
// CoreTracing.setTraceListeners (CoreTracing.defaultConsoleTraceListener :: current)
227229

228-
let dotnetSdk = lazy DotNet.install DotNet.Release_2_1_4
230+
231+
let dotnetSdk = lazy DotNet.install DotNet.Release_2_1_300_RC1
229232
let inline dtntWorkDir wd =
230233
DotNet.Options.lift dotnetSdk.Value
231234
>> DotNet.Options.withWorkingDirectory wd
@@ -346,6 +349,7 @@ let common = [
346349
// New FAKE libraries
347350
let dotnetAssemblyInfos =
348351
[ "dotnet-fake", "Fake dotnet-cli command line tool"
352+
"fake-cli", "Fake global dotnet-cli command line tool"
349353
"Fake.Api.GitHub", "GitHub Client API Support via Octokit"
350354
"Fake.Api.HockeyApp", "HockeyApp Integration Support"
351355
"Fake.Api.Slack", "Slack Integration Support"

help/markdown/fake-gettingstarted.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ There are various ways to install FAKE 5
2323

2424
* Use it as dotnet tool: Add `<DotNetCliToolReference Include="dotnet-fake" Version="5.0.0*" />` to your dependencies and run `dotnet fake ...` instead of `fake ...`, see [this example](https://github.com/matthid/fake-bootstrap/blob/master/dotnet-fake.csproj)
2525

26+
* Install fake as a global dotnet tool: run `dotnet tool install fake-cli -g` to install fake globally or `dotnet tool install fake-cli --tool-path your_tool_path` to install fake into `your_tool_path`. Pass `--version` to install a specific version of fake.
27+
<div class="alert alert-info">
28+
<h5>INFO</h5>
29+
<p>To install a pre-release version, you have to specify the <code>--version</code> parameter. For example <code>--version=5.0.0-rc013</code></p>
30+
</div>
31+
2632
* Bootstrap via shell script (fake.cmd/fake.sh),
2733
see this [example project](https://github.com/matthid/fake-bootstrap)
2834
<div class="alert alert-warning">
@@ -37,7 +43,6 @@ There are various ways to install FAKE 5
3743
Once `fake` is available you can start creating your script:
3844

3945
* Create a new file `myscript.fsx` with the following contents:
40-
4146
```fsharp
4247
#r "paket:
4348
nuget Fake.Core.Target prerelease"

paket.dependencies

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ group Build
9595
nuget SourceLink.Fake
9696
nuget ILRepack
9797
nuget RoslynTools.ReferenceAssemblies
98-
98+
nuget Newtonsoft.Json
9999
github fsharp/FAKE modules/Octokit/Octokit.fsx
100100

101101
// [ FAKE GROUP ]
@@ -133,7 +133,7 @@ group NetcoreBuild
133133
nuget Fake.Tools.Git prerelease
134134
nuget Mono.Cecil prerelease
135135
nuget Octokit
136-
136+
nuget Newtonsoft.Json
137137
group netcore
138138
//source https://ci.appveyor.com/nuget/paket
139139
source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)