-
Notifications
You must be signed in to change notification settings - Fork 587
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
Release 5.14.0 #2318
Changes from 17 commits
55d0ab6
cecc721
93084ff
9789bb0
0c8eebe
ec380d4
a13e0e6
9a4ceb4
3ef27d5
e1ff214
3be82ac
797ddae
8a6036c
8363549
2418e69
8016aad
182fe09
13835d3
62db0e9
a56f9d9
6008dc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
||
|
@@ -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) | ||
|
@@ -211,6 +218,7 @@ module DotNet = | |
Channel = None | ||
Version = Latest | ||
CustomInstallDir = None | ||
ForceInstall = false | ||
Architecture = Auto | ||
DebugSymbols = false | ||
DryRun = false | ||
|
@@ -441,7 +449,7 @@ module DotNet = | |
let versionParamValue = | ||
match param.Version with | ||
| Latest -> "latest" | ||
| Lkg -> "lkg" | ||
| Lkg -> "coherent" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() | ||
|
||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 = | ||
|
@@ -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 | ||
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
There was a problem hiding this comment.
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.