Skip to content

Commit

Permalink
Remove use of some obsolete F# FAKE 5 functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
bchavez committed Aug 2, 2020
1 parent 590e576 commit c27374e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 36 deletions.
21 changes: 12 additions & 9 deletions Source/Builder/Utils.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ module Helpers =

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

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

let encryptFile file secret =
let secureFile = FindNuGetTool "secure-file.exe" "secure-file" (Some "1.0.31")
let args = sprintf "-encrypt %s -secret %s" file secret
shellExecSecret secureFile args "."
let tool = FindNuGetTool "secure-file.exe" "secure-file" (Some "1.0.31")
match tool with
| Some exe -> let args = sprintf "-encrypt %s -secret %s" file secret
shellExecSecret exe args "."
| _ -> failwith "could not find secure-file.exe"

let decryptFile file secret =
let secureFile = FindNuGetTool "secure-file.exe" "secure-file" (Some "1.0.31")
let args = sprintf "-decrypt %s.enc -secret %s" file secret
shellExecSecret secureFile args "."


let tool = FindNuGetTool "secure-file.exe" "secure-file" (Some "1.0.31")
match tool with
| Some exe -> let args = sprintf "-decrypt %s.enc -secret %s" file secret
shellExecSecret exe args "."
| _ -> failwith "could not find secure-file.exe";
9 changes: 6 additions & 3 deletions Source/Builder/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ let Files = Setup.Files(ProjectName, Folders)
let BogusProject = NugetProject("Bogus", "Bogus Fake Data Generator for .NET", Folders)
let TestProject = TestProject("Bogus.Tests", Folders)

let EnableSigning = true

Target.description "MAIN BUILD TASK"
Target.create "dnx" (fun _ ->
Expand Down Expand Up @@ -161,9 +162,11 @@ Target.create "BuildInfo" (fun _ ->

Trace.trace "Writing Assembly Build Info"

MakeBuildInfo BogusProject Folders (fun bip ->
{ bip with
ExtraAttrs = MakeAttributes(BuildContext.IsTaggedBuild) } )
let includeSnk = EnableSigning && BuildContext.IsTaggedBuild

let customAttributes = MakeAttributes(includeSnk)

MakeBuildInfo BogusProject Folders (fun bip -> { bip with ExtraAttrs = customAttributes } )

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

Expand Down
34 changes: 10 additions & 24 deletions Source/Builder/build.fsx.lock
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ NUGET
FSharp.Core (>= 4.7.2)
Newtonsoft.Json (>= 12.0.3)
NuGet.Protocol (>= 5.6)
Fake.DotNet.Testing.xUnit2 (5.20.2)
Fake.DotNet.Testing.XUnit2 (5.20.2)
Fake.Core.Process (>= 5.20.2)
Fake.Core.String (>= 5.20.2)
Fake.Core.Trace (>= 5.20.2)
Expand Down Expand Up @@ -174,16 +174,21 @@ NUGET
System.Resources.Extensions (>= 4.6)
System.Security.Permissions (>= 4.7)
System.Threading.Tasks.Dataflow (>= 4.9)
Microsoft.Build.Tasks.Git (1.0)
Microsoft.Build.Utilities.Core (16.6)
Microsoft.Build.Framework (>= 16.6)
Microsoft.Win32.Registry (>= 4.3)
System.Collections.Immutable (>= 1.5)
System.Security.Permissions (>= 4.7)
System.Text.Encoding.CodePages (>= 4.0.1)
Microsoft.CSharp (4.7)
Microsoft.DotNet.PlatformAbstractions (3.1.5)
Microsoft.DotNet.PlatformAbstractions (3.1.6)
Microsoft.NETCore.Platforms (3.1.1)
Microsoft.NETCore.Targets (3.1)
Microsoft.SourceLink.Common (1.0)
Microsoft.SourceLink.GitHub (1.0)
Microsoft.Build.Tasks.Git (>= 1.0)
Microsoft.SourceLink.Common (>= 1.0)
Microsoft.Win32.Primitives (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
Expand All @@ -195,12 +200,12 @@ NUGET
System.Security.Principal.Windows (>= 4.7)
Mono.Cecil (0.11.2)
Mono.Posix.NETStandard (1.0)
MSBuild.StructuredLogger (2.1.133)
MSBuild.StructuredLogger (2.1.176)
Microsoft.Build (>= 16.4)
Microsoft.Build.Framework (>= 16.4)
Microsoft.Build.Tasks.Core (>= 16.4)
Microsoft.Build.Utilities.Core (>= 16.4)
System.IO.Compression (>= 4.3)
Microsoft.SourceLink.GitHub (>= 1.0)
NETStandard.Library (2.0.3)
Microsoft.NETCore.Platforms (>= 1.1)
Newtonsoft.Json (12.0.3)
Expand All @@ -221,7 +226,7 @@ NUGET
NuGet.Packaging (>= 5.6)
System.Dynamic.Runtime (>= 4.3)
NuGet.Versioning (5.6)
Paket.Core (5.247.4)
Paket.Core (5.249)
Chessie (>= 0.6)
Mono.Cecil (>= 0.10.0-beta6)
Newtonsoft.Json (>= 10.0.3)
Expand All @@ -234,9 +239,6 @@ NUGET
runtime.win-arm64.runtime.native.System.Data.SqlClient.sni (>= 4.4)
runtime.win-x64.runtime.native.System.Data.SqlClient.sni (>= 4.4)
runtime.win-x86.runtime.native.System.Data.SqlClient.sni (>= 4.4)
runtime.native.System.IO.Compression (4.3.2)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
runtime.win-arm64.runtime.native.System.Data.SqlClient.sni (4.4)
runtime.win-x64.runtime.native.System.Data.SqlClient.sni (4.4)
runtime.win-x86.runtime.native.System.Data.SqlClient.sni (4.4)
Expand Down Expand Up @@ -315,22 +317,6 @@ NUGET
System.Runtime (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.IO.Compression (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
runtime.native.System (>= 4.3)
runtime.native.System.IO.Compression (>= 4.3)
System.Buffers (>= 4.3)
System.Collections (>= 4.3)
System.Diagnostics.Debug (>= 4.3)
System.IO (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Runtime.Handles (>= 4.3)
System.Runtime.InteropServices (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Threading (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.IO.FileSystem (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
Expand Down

0 comments on commit c27374e

Please sign in to comment.