Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5.14.0 #2318

Merged
merged 21 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release Notes

## 5.14.0-alpha - tbd

* BREAKING: Renamed `NuGet.feedUrl` to `NuGet.galleryV1` and marked it as obsolete. Added `galleryV2` and `galleryV3` - https://github.com/fsharp/FAKE/issues/2323
* ENHANCEMENT: Fake 5 now supports native libraries (like SQL and SQLite NuGet packages) - https://github.com/fsharp/FAKE/issues/2007
* BUGFIX: DotNet.exec (dotnet installer) fails when username has a blank - https://github.com/fsharp/FAKE/issues/2319
* BUGFIX: Error when invoking fake run with different casings - https://github.com/fsharp/FAKE/issues/2314
* BUGFIX: Potential fix for incorrect console colors after running fake - https://github.com/fsharp/FAKE/issues/2173
* DOCS: Document difference between `@@` and `</>` as well as `Path.combineTrimEnd` and `Path.combine` - https://github.com/fsharp/FAKE/issues/2329

## 5.13.7 - 2019-05-11

* BUGFIX: Xamarin Android x86_64 build fails - https://github.com/fsharp/FAKE/issues/2313
Expand Down
8 changes: 5 additions & 3 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ if buildLegacy then

// Release stuff ('FastRelease' is to release after running 'Default')
(if fromArtifacts then "PrepareArtifacts" else "EnsureTestsRun")
=?> ("DotNetCorePushChocolateyPackage", Environment.isWindows)
=?> ("DotNetCorePushChocolateyPackage", Environment.isWindows && chocosource <> "disabled")
==> "FastRelease"
"EnsureTestsRun" ?=> "DotNetCorePushChocolateyPackage"

Expand All @@ -1309,9 +1309,11 @@ if buildLegacy then
"EnsureTestsRun" ?=> "ReleaseDocs"

(if fromArtifacts then "PrepareArtifacts" else "EnsureTestsRun")
==> "DotNetCorePushNuGet"
=?> ("DotNetCorePushNuGet", nugetsource <> "disabled")
==> "FastRelease"
"EnsureTestsRun" ?=> "DotNetCorePushNuGet"

if nugetsource <> "disabled" then
ignore ("EnsureTestsRun" ?=> "DotNetCorePushNuGet")


// Gitlab staging (myget release)
Expand Down
23 changes: 23 additions & 0 deletions integrationtests/i002007-native-libs/before/build.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#r "paket:
nuget Fake.Core.Target
nuget System.Data.SQLite.Core //"
#load "./.fake/build.fsx/intellisense.fsx"

open Fake.Core
open System.Data.SQLite

let openConn (path:string) =
let builder = SQLiteConnectionStringBuilder()
builder.DataSource <- path
let conn = new SQLiteConnection(builder.ToString())
conn.OpenAndReturn()

// Default target
Target.create "Default" (fun _ ->
Trace.trace "Hello World from FAKE"
use conn = openConn "temp.db"
()
)

// start build
Target.runOrDefault "Default"
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,4 @@ group netcore
nuget System.Runtime.Loader
nuget System.IO.FileSystem.Watcher
nuget System.Data.SqlClient
nuget Microsoft.SqlServer.SqlManagementObjects
nuget Microsoft.SqlServer.SqlManagementObjects
4,777 changes: 2,398 additions & 2,379 deletions paket.lock

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions src/app/Fake.Core.Process/CmdLineParsing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,31 @@ type Arguments =
CmdLineParsing.toProcessStartInfo x.Args

module Arguments =
let toWindowsCommandLine (a:Arguments) = a.ToWindowsCommandLine
let toLinuxShellCommandLine (a:Arguments) = a.ToLinuxShellCommandLine
let toStartInfo (a:Arguments) = a.ToStartInfo
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably should add some comments here.


let withPrefix (s:string seq) (a:Arguments) =
Arguments.OfArgs(Seq.append s a.Args)
let append s (a:Arguments) =
Arguments.OfArgs(Seq.append a.Args s)

/// Append an argument prefixed by another if the value is Some.
let appendOption (paramName:string) (paramValue:string option) (a:Arguments) =
match paramValue with
| Some x -> a |> append [ paramName; x ]
| None -> a

/// Append an argument to a command line if a condition is true.
let appendIf value paramName (a:Arguments) =
if value then a |> append [ paramName ]
else a

/// Append an argument prefixed by another if the value is not null or empty
let appendNotEmpty paramName paramValue (a:Arguments) =
if String.isNullOrEmpty paramValue then a
else a |> append [ paramName; paramValue ]

let toList (a:Arguments) =
a.Args |> Array.toList

Expand Down
6 changes: 3 additions & 3 deletions src/app/Fake.Core.Process/Process.fs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ module Process =
let UseDefaults = id

/// [omit]
[<Obsolete "Use the Arguments and Args modules/types instead">]
[<Obsolete "Use the Arguments.appendNotEmpty and the Args modules/types instead.">]
let stringParam (paramName, paramValue) =
if String.isNullOrEmpty paramValue then None
else Some(paramName, paramValue)
Expand All @@ -719,14 +719,14 @@ module Process =
let multipleStringParams paramName = Seq.map (fun x -> stringParam (paramName, x)) >> Seq.toList

/// [omit]
[<Obsolete "Use the Arguments and Args modules/types instead">]
[<Obsolete "Use the Arguments.appendOption and Args modules/types instead">]
let optionParam (paramName, paramValue) =
match paramValue with
| Some x -> Some(paramName, x.ToString())
| None -> None

/// [omit]
[<Obsolete "Use the Arguments and Args modules/types instead">]
[<Obsolete "Use the Arguments.appendIf and Args modules/types instead">]
let boolParam (paramName, paramValue) =
if paramValue then Some(paramName, null)
else None
Expand Down
69 changes: 42 additions & 27 deletions src/app/Fake.DotNet.Cli/DotNet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,18 @@ module DotNet =
type InstallerOptions =
{
/// Always download install script (otherwise install script is cached in temporary folder)
AlwaysDownload: bool;
AlwaysDownload: bool
/// Download installer from this github branch
Branch: string;
Branch: string
// Use the given directory to download the script into. If None the temp-dir is used
CustomDownloadDir: string option
}

/// Parameter default values.
static member Default = {
AlwaysDownload = false
Branch = "master"
CustomDownloadDir = None
}

/// Download .NET Core SDK installer
Expand All @@ -152,14 +155,16 @@ module DotNet =
let getInstallerUrl = if Environment.isUnix then getBashDotNetCliInstallerUrl else getPowershellDotNetCliInstallerUrl
let scriptName =
sprintf "dotnet_install_%s.%s" (md5 (Encoding.ASCII.GetBytes(param.Branch))) ext
let tempInstallerScript = Path.GetTempPath() @@ scriptName
let tempDir =
match param.CustomDownloadDir with
| None -> Path.GetTempPath()
| Some d -> d
let tempInstallerScript = tempDir @@ scriptName

// maybe download installer script
match param.AlwaysDownload || not(File.Exists(tempInstallerScript)) with
| true ->
let url = getInstallerUrl param.Branch
downloadDotNetInstallerFromUrl url tempInstallerScript
| _ -> ()
if param.AlwaysDownload || not(File.Exists(tempInstallerScript)) then
let url = getInstallerUrl param.Branch
downloadDotNetInstallerFromUrl url tempInstallerScript

tempInstallerScript

Expand Down Expand Up @@ -195,6 +200,8 @@ module DotNet =
Version: CliVersion
/// Custom installation directory (for local build installation)
CustomInstallDir: string option
/// Always download and run the installer, ignore potentiall existing installations.
ForceInstall : bool
/// Architecture
Architecture: CliArchitecture
/// Include symbols in the installation (Switch does not work yet. Symbols zip is not being uploaded yet)
Expand All @@ -211,6 +218,7 @@ module DotNet =
Channel = None
Version = Latest
CustomInstallDir = None
ForceInstall = false
Architecture = Auto
DebugSymbols = false
DryRun = false
Expand Down Expand Up @@ -441,7 +449,7 @@ module DotNet =
let versionParamValue =
match param.Version with
| Latest -> "latest"
| Lkg -> "lkg"
| Lkg -> "coherent"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should add a new case instead of changing the existing one

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making a breaking change instead... (Just like the sdk guys did)

| Version ver -> ver
| GlobalJson -> getSDKVersionFromGlobalJson()

Expand All @@ -458,17 +466,16 @@ module DotNet =
| Auto -> None
| X86 -> Some "x86"
| X64 -> Some "x64"
[
Process.boolParam ("Verbose", true)
Process.stringParam ("Channel", channelParamValue)
Process.stringParam ("Version", versionParamValue)
Process.optionParam ("Architecture", architectureParamValue)
Process.stringParam ("InstallDir", defaultArg param.CustomInstallDir defaultUserInstallDir)
Process.boolParam ("DebugSymbols", param.DebugSymbols)
Process.boolParam ("DryRun", param.DryRun)
Process.boolParam ("NoPath", param.NoPath)
] |> Process.parametersToString "-" " "

Arguments.Empty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should add some docs around this new feature.

|> Arguments.appendIf true "-Verbose"
|> Arguments.appendNotEmpty "-Channel" channelParamValue
|> Arguments.appendNotEmpty "-Version" versionParamValue
|> Arguments.appendOption "-Architecture" architectureParamValue
|> Arguments.appendNotEmpty "-InstallDir" (defaultArg param.CustomInstallDir defaultUserInstallDir)
|> Arguments.appendIf param.DebugSymbols "-DebugSymbols"
|> Arguments.appendIf param.DryRun "-DryRun"
|> Arguments.appendIf param.NoPath "-NoPath"

/// dotnet restore verbosity
type Verbosity =
Expand Down Expand Up @@ -816,7 +823,8 @@ module DotNet =
| CliVersion.Latest -> None, false
| CliVersion.GlobalJson -> Some (getSDKVersionFromGlobalJson()), true

let dotnetInstallations = findPossibleDotnetCliPaths (Some dir)
let dotnetInstallations =
if param.ForceInstall then Seq.empty else findPossibleDotnetCliPaths (Some dir)

let existingDotNet =
match checkVersion with
Expand Down Expand Up @@ -864,21 +872,28 @@ module DotNet =
()
let exitCode =
let args, fileName =
let installArgs = buildDotNetCliInstallArgs param
if Environment.isUnix then
let args = sprintf "%s %s" installScript (buildDotNetCliInstallArgs param)
let args = installArgs |> Arguments.withPrefix [ installScript ]
//let args = sprintf "%s %s" installScript (buildDotNetCliInstallArgs param)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment can be removed

args, "bash" // Otherwise we need to set the executable flag!
else
let command = installArgs |> Arguments.withPrefix [ installScript ]
let args =
sprintf
"-ExecutionPolicy Bypass -NoProfile -NoLogo -NonInteractive -Command \"%s %s; if (-not $?) { exit -1 };\""
installScript
(buildDotNetCliInstallArgs param)
Arguments.Empty
|> Arguments.appendNotEmpty "-ExecutionPolicy" "ByPass"
|> Arguments.appendIf true "-NoProfile"
|> Arguments.appendIf true "-NoLogo"
|> Arguments.appendIf true "-NonInteractive"
// Note: The & is required when the script path contains spaces, see https://stackoverflow.com/questions/45760457/how-to-run-a-powershell-script-with-white-spaces-in-path-from-command-line
// powershell really is a waste of time
|> Arguments.appendNotEmpty "-Command" (sprintf "& %s; if (-not $?) { exit -1 };" command.ToWindowsCommandLine)
args, "powershell"
Process.execSimple (fun info ->
{ info with
FileName = fileName
WorkingDirectory = Path.GetTempPath()
Arguments = args }
WorkingDirectory = Path.GetDirectoryName fileName
Arguments = args.ToStartInfo }
) TimeSpan.MaxValue

if exitCode <> 0 then
Expand Down
4 changes: 2 additions & 2 deletions src/app/Fake.DotNet.ILMerge/ILMerge.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// ### Sample
///
/// Target.create "ILMerge" (fun _ ->
/// let target = !!./bin/Release/*.exe" |> Seq.head
/// let target = !!"./bin/Release/*.exe" |> Seq.head
/// let out = "./bin" @@ (Path.GetFileName target)
/// ILMerge.run
/// { ILMerge.Params.Create() with DebugInfo = true
Expand Down Expand Up @@ -181,4 +181,4 @@ let run parameters outputFile primaryAssembly =
failwithf "'ILMerge %s' failed." (String.separated " " args)
__.MarkSuccess()
else
raise <| NotSupportedException("ILMerge is currently not supported on mono")
raise <| NotSupportedException("ILMerge is currently not supported on mono")
7 changes: 5 additions & 2 deletions src/app/Fake.DotNet.NuGet/NuGet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,10 @@ let getNuspecProperties (nuspec : string) =
// |> getNuspecProperties

/// Default NuGet feed
let feedUrl = "http://go.microsoft.com/fwlink/?LinkID=206669"
[<Obsolete "This V1 NuGet feed url most likely doesn't work. Please consider using v3 nuget feed via `NuGet.galleryV3`.">]
let galleryV1 = "http://go.microsoft.com/fwlink/?LinkID=206669"
let galleryV2 = "https://www.nuget.org/api/v2/"
let galleryV3 = "https://api.nuget.org/v3/index.json"

// TODO: Note that this is stolen from paket code. We might want to move that into a shared FAKE library..., see https://github.com/fsprojects/Paket/blob/06ef22ba79896cd9f2a2e2eefccde08b09ab7656/src/Paket.Core/Utils.fs
#if NETSTANDARD
Expand Down Expand Up @@ -735,7 +738,7 @@ let private webClient = new WebClient()

/// [omit]
let discoverRepoUrl =
lazy (let resp = webClient.DownloadString(feedUrl)
lazy (let resp = webClient.DownloadString(galleryV1)
let doc = Xml.createDoc resp
doc.["service"].GetAttribute("xml:base"))

Expand Down
2 changes: 1 addition & 1 deletion src/app/Fake.IO.FileSystem/FileSystemOperators.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Fake.IO
open System.IO

module FileSystemOperators =
/// Combines two path strings using Path.Combine
/// Combines two path strings using Path.Combine. Trims leading slashes of the right operand. This makes `"/test" @@ "/sub"` return `/test/sub`
let inline (@@) path1 path2 = Path.combineTrimEnd path1 path2
/// Combines two path strings using Path.Combine
let inline (</>) path1 path2 = Path.combine path1 path2
2 changes: 1 addition & 1 deletion src/app/Fake.IO.FileSystem/Path.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ open System.IO
open System.Collections.Generic
open System.Collections.Concurrent

/// Combines two path strings using Path.Combine
/// Combines two path strings using Path.Combine. Trims leading slashes of path2. This makes `combineTrimEnd "/test" "/sub"` return `/test/sub`
let inline combineTrimEnd path1 (path2 : string) = Path.Combine(path1, path2.TrimStart [| '\\'; '/' |])
/// Combines two path strings using Path.Combine
let inline combine path1 path2 = Path.Combine(path1, path2)
Expand Down
Loading