Skip to content

Commit c27374e

Browse files
committed
Remove use of some obsolete F# FAKE 5 functions.
1 parent 590e576 commit c27374e

File tree

3 files changed

+28
-36
lines changed

3 files changed

+28
-36
lines changed

Source/Builder/Utils.fsx

+12-9
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ module Helpers =
311311

312312
let FindNuGetTool (cmdFileName : string) (nugetPackageName : string) (version : string option) =
313313
let probePath = if version.IsSome then version.Value else String.Empty
314-
Tools.findToolInSubPath cmdFileName (Folders.NuGetPackagePath @@ nugetPackageName @@ probePath)
314+
let fullPath = (Folders.NuGetPackagePath @@ nugetPackageName @@ probePath)
315+
ProcessUtils.tryFindFile [fullPath] cmdFileName
315316

316317
let shellExec cmdPath args workingDir =
317318
CreateProcess.fromRawCommandLine cmdPath args
@@ -335,13 +336,15 @@ module Helpers =
335336
| None -> failwithf "'%s' can't find" name
336337

337338
let encryptFile file secret =
338-
let secureFile = FindNuGetTool "secure-file.exe" "secure-file" (Some "1.0.31")
339-
let args = sprintf "-encrypt %s -secret %s" file secret
340-
shellExecSecret secureFile args "."
339+
let tool = FindNuGetTool "secure-file.exe" "secure-file" (Some "1.0.31")
340+
match tool with
341+
| Some exe -> let args = sprintf "-encrypt %s -secret %s" file secret
342+
shellExecSecret exe args "."
343+
| _ -> failwith "could not find secure-file.exe"
341344

342345
let decryptFile file secret =
343-
let secureFile = FindNuGetTool "secure-file.exe" "secure-file" (Some "1.0.31")
344-
let args = sprintf "-decrypt %s.enc -secret %s" file secret
345-
shellExecSecret secureFile args "."
346-
347-
346+
let tool = FindNuGetTool "secure-file.exe" "secure-file" (Some "1.0.31")
347+
match tool with
348+
| Some exe -> let args = sprintf "-decrypt %s.enc -secret %s" file secret
349+
shellExecSecret exe args "."
350+
| _ -> failwith "could not find secure-file.exe";

Source/Builder/build.fsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ let Files = Setup.Files(ProjectName, Folders)
7878
let BogusProject = NugetProject("Bogus", "Bogus Fake Data Generator for .NET", Folders)
7979
let TestProject = TestProject("Bogus.Tests", Folders)
8080

81+
let EnableSigning = true
8182

8283
Target.description "MAIN BUILD TASK"
8384
Target.create "dnx" (fun _ ->
@@ -161,9 +162,11 @@ Target.create "BuildInfo" (fun _ ->
161162

162163
Trace.trace "Writing Assembly Build Info"
163164

164-
MakeBuildInfo BogusProject Folders (fun bip ->
165-
{ bip with
166-
ExtraAttrs = MakeAttributes(BuildContext.IsTaggedBuild) } )
165+
let includeSnk = EnableSigning && BuildContext.IsTaggedBuild
166+
167+
let customAttributes = MakeAttributes(includeSnk)
168+
169+
MakeBuildInfo BogusProject Folders (fun bip -> { bip with ExtraAttrs = customAttributes } )
167170

168171
Xml.pokeInnerText BogusProject.ProjectFile "/Project/PropertyGroup/Version" BuildContext.FullVersion
169172

Source/Builder/build.fsx.lock

+10-24
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ NUGET
100100
FSharp.Core (>= 4.7.2)
101101
Newtonsoft.Json (>= 12.0.3)
102102
NuGet.Protocol (>= 5.6)
103-
Fake.DotNet.Testing.xUnit2 (5.20.2)
103+
Fake.DotNet.Testing.XUnit2 (5.20.2)
104104
Fake.Core.Process (>= 5.20.2)
105105
Fake.Core.String (>= 5.20.2)
106106
Fake.Core.Trace (>= 5.20.2)
@@ -174,16 +174,21 @@ NUGET
174174
System.Resources.Extensions (>= 4.6)
175175
System.Security.Permissions (>= 4.7)
176176
System.Threading.Tasks.Dataflow (>= 4.9)
177+
Microsoft.Build.Tasks.Git (1.0)
177178
Microsoft.Build.Utilities.Core (16.6)
178179
Microsoft.Build.Framework (>= 16.6)
179180
Microsoft.Win32.Registry (>= 4.3)
180181
System.Collections.Immutable (>= 1.5)
181182
System.Security.Permissions (>= 4.7)
182183
System.Text.Encoding.CodePages (>= 4.0.1)
183184
Microsoft.CSharp (4.7)
184-
Microsoft.DotNet.PlatformAbstractions (3.1.5)
185+
Microsoft.DotNet.PlatformAbstractions (3.1.6)
185186
Microsoft.NETCore.Platforms (3.1.1)
186187
Microsoft.NETCore.Targets (3.1)
188+
Microsoft.SourceLink.Common (1.0)
189+
Microsoft.SourceLink.GitHub (1.0)
190+
Microsoft.Build.Tasks.Git (>= 1.0)
191+
Microsoft.SourceLink.Common (>= 1.0)
187192
Microsoft.Win32.Primitives (4.3)
188193
Microsoft.NETCore.Platforms (>= 1.1)
189194
Microsoft.NETCore.Targets (>= 1.1)
@@ -195,12 +200,12 @@ NUGET
195200
System.Security.Principal.Windows (>= 4.7)
196201
Mono.Cecil (0.11.2)
197202
Mono.Posix.NETStandard (1.0)
198-
MSBuild.StructuredLogger (2.1.133)
203+
MSBuild.StructuredLogger (2.1.176)
199204
Microsoft.Build (>= 16.4)
200205
Microsoft.Build.Framework (>= 16.4)
201206
Microsoft.Build.Tasks.Core (>= 16.4)
202207
Microsoft.Build.Utilities.Core (>= 16.4)
203-
System.IO.Compression (>= 4.3)
208+
Microsoft.SourceLink.GitHub (>= 1.0)
204209
NETStandard.Library (2.0.3)
205210
Microsoft.NETCore.Platforms (>= 1.1)
206211
Newtonsoft.Json (12.0.3)
@@ -221,7 +226,7 @@ NUGET
221226
NuGet.Packaging (>= 5.6)
222227
System.Dynamic.Runtime (>= 4.3)
223228
NuGet.Versioning (5.6)
224-
Paket.Core (5.247.4)
229+
Paket.Core (5.249)
225230
Chessie (>= 0.6)
226231
Mono.Cecil (>= 0.10.0-beta6)
227232
Newtonsoft.Json (>= 10.0.3)
@@ -234,9 +239,6 @@ NUGET
234239
runtime.win-arm64.runtime.native.System.Data.SqlClient.sni (>= 4.4)
235240
runtime.win-x64.runtime.native.System.Data.SqlClient.sni (>= 4.4)
236241
runtime.win-x86.runtime.native.System.Data.SqlClient.sni (>= 4.4)
237-
runtime.native.System.IO.Compression (4.3.2)
238-
Microsoft.NETCore.Platforms (>= 1.1.1)
239-
Microsoft.NETCore.Targets (>= 1.1.3)
240242
runtime.win-arm64.runtime.native.System.Data.SqlClient.sni (4.4)
241243
runtime.win-x64.runtime.native.System.Data.SqlClient.sni (4.4)
242244
runtime.win-x86.runtime.native.System.Data.SqlClient.sni (4.4)
@@ -315,22 +317,6 @@ NUGET
315317
System.Runtime (>= 4.3)
316318
System.Text.Encoding (>= 4.3)
317319
System.Threading.Tasks (>= 4.3)
318-
System.IO.Compression (4.3)
319-
Microsoft.NETCore.Platforms (>= 1.1)
320-
runtime.native.System (>= 4.3)
321-
runtime.native.System.IO.Compression (>= 4.3)
322-
System.Buffers (>= 4.3)
323-
System.Collections (>= 4.3)
324-
System.Diagnostics.Debug (>= 4.3)
325-
System.IO (>= 4.3)
326-
System.Resources.ResourceManager (>= 4.3)
327-
System.Runtime (>= 4.3)
328-
System.Runtime.Extensions (>= 4.3)
329-
System.Runtime.Handles (>= 4.3)
330-
System.Runtime.InteropServices (>= 4.3)
331-
System.Text.Encoding (>= 4.3)
332-
System.Threading (>= 4.3)
333-
System.Threading.Tasks (>= 4.3)
334320
System.IO.FileSystem (4.3)
335321
Microsoft.NETCore.Platforms (>= 1.1)
336322
Microsoft.NETCore.Targets (>= 1.1)

0 commit comments

Comments
 (0)