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.9 #2137

Merged
merged 71 commits into from
Oct 13, 2018
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
f5ef276
Write the NUnit arguements to a temp file and pass that to NUnit console
BlythMeister Sep 27, 2018
da51bea
Reformat to be a try/finally
BlythMeister Sep 28, 2018
0c2bbf1
Merge branch 'nunitFileBasedAlways' of https://github.com/BlythMeiste…
matthid Oct 8, 2018
fb8cc82
start
matthid Oct 8, 2018
b0b4e66
Add unit test for #2114
matthid Oct 8, 2018
7885e3a
Update SpecFlow for Version 2.4
magicmonty Oct 1, 2018
28c1048
Merge branch 'release/next' of github.com:fsharp/FAKE into process_ap…
matthid Oct 9, 2018
ec29430
fix test on unix
matthid Oct 9, 2018
2be0565
update pr template
matthid Oct 9, 2018
688a556
simplify a bit
matthid Oct 9, 2018
206f883
cleanup of the new api
matthid Oct 9, 2018
04e6664
move stuff around and mark a lot of APIs internal
matthid Oct 9, 2018
5ba591f
try to fix tests
matthid Oct 9, 2018
8e1c5e8
Fix existing tests.
matthid Oct 9, 2018
773b082
Merge branch 'release/next' of github.com:fsharp/FAKE into process_ap…
matthid Oct 9, 2018
0e84da6
Fix some tests & oversights
matthid Oct 9, 2018
0f26575
Merge branch 'release/next' of github.com:fsharp/FAKE into process_ap…
matthid Oct 9, 2018
e9b8834
Merge pull request #2131 from fsharp/process_api_hook
matthid Oct 10, 2018
5c2a6b1
5.9
matthid Oct 10, 2018
6bdd02b
Merge branch 'release/next' of github.com:fsharp/FAKE into release/next
matthid Oct 10, 2018
8ada7fc
Merge branch 'SpecFlow' of https://github.com/magicmonty/FAKE into re…
matthid Oct 10, 2018
f912b37
add test for specflownext
matthid Oct 10, 2018
af6488e
paket update, fix test
matthid Oct 10, 2018
b36b39e
fix test
matthid Oct 10, 2018
40bf083
try multiple times
matthid Oct 10, 2018
0a4289d
update debugger settings for https://github.com/fsharp/FAKE/issues/2136
matthid Oct 10, 2018
fa6e530
Correct TeamCity publish named artifact
BlythMeister Oct 10, 2018
1956a03
Add report build problem to TeamCity
BlythMeister Oct 10, 2018
031ccfa
Tidy TeamCity listener match statement
BlythMeister Oct 10, 2018
5538310
Refactor all messages sent to TeamCity into TeamCityInternal
BlythMeister Oct 10, 2018
a6384b2
Seperate runInternal & handle error
BlythMeister Oct 10, 2018
b5c1c1a
Add class and file filter parameters to Fake.Testing.ReportGenerator
magicmonty Oct 2, 2018
236af89
Fake.DotNet.Testing.SpecFlow: Added tests and optimized API
magicmonty Oct 11, 2018
e82712f
Move tracing to better reflect real command line
magicmonty Oct 11, 2018
6d8fc32
Move tracing down, to better reflect mono invocation
magicmonty Oct 11, 2018
921f4cc
fix helper for a variable number of args
matthid Oct 11, 2018
b2854dc
Merge pull request #2120 from magicmonty/ReportGenerator
matthid Oct 11, 2018
ce3a2c7
Merge pull request #2138 from BlythMeister/teamcity
matthid Oct 11, 2018
c935bca
Merge pull request #2143 from magicmonty/SpecFlowTests
matthid Oct 11, 2018
79894c4
Fix test
matthid Oct 12, 2018
b9409d4
Update Fake.Testing.ReportGenerator.fs
matthid Oct 12, 2018
97c9d9c
Update Fake.DotNet.Testing.SpecFlow.fs
matthid Oct 12, 2018
4ac310e
Update Fake.Testing.ReportGenerator.fs
matthid Oct 12, 2018
f73b02c
Update Fake.Tools.Pickles and added Unit tests
magicmonty Oct 9, 2018
ae86e1f
Fix Tests
magicmonty Oct 12, 2018
3f11bde
Fix ArgumentHelper.checkIfMono
magicmonty Oct 12, 2018
f55d67c
Made checkIfMono a bit more elegant
magicmonty Oct 12, 2018
a686bd4
Correct publish artifact
BlythMeister Oct 12, 2018
bd00131
Add message to the build state update
BlythMeister Oct 12, 2018
e3a539e
Merge branch 'TargetContext' into FailureContext
BlythMeister Oct 12, 2018
26c11e1
Add helpers for update build status
BlythMeister Oct 11, 2018
6514d38
Merge pull request #2133 from magicmonty/Pickles
matthid Oct 12, 2018
4e7a30d
Merge pull request #2147 from BlythMeister/patch-5
matthid Oct 12, 2018
47e325d
Correct documentation
BlythMeister Oct 12, 2018
0471b4b
Add `CreateProcess.disableTraceCommand` and use it to hide `appveyor.…
matthid Oct 12, 2018
deddb21
print all stack traces in verbose mode, references https://github.com…
matthid Oct 12, 2018
6da9c67
next time we can fix https://github.com/fsharp/FAKE/issues/2136
matthid Oct 12, 2018
c7705ce
add BlackFox.Fake.BuildTask to docs /cc @vbfox
matthid Oct 12, 2018
73812cb
Docs & cleanup
matthid Oct 12, 2018
e902645
more docs
matthid Oct 12, 2018
b1b37b9
documentation
matthid Oct 12, 2018
e5cdbaf
Fix code docs
matthid Oct 13, 2018
b498bdb
workaround azure devops bug again.
matthid Oct 13, 2018
cb11b6e
ups
matthid Oct 13, 2018
6b9e62e
BuildState with message (#2139)
BlythMeister Oct 13, 2018
fe979ba
Merge pull request #2140 from BlythMeister/TargetContext
matthid Oct 13, 2018
f2240e3
Merge branch 'FailureContext' into fix_conflics
matthid Oct 13, 2018
9b7db84
Merge pull request #2150 from fsharp/fix_conflics
matthid Oct 13, 2018
6ab9fa0
set FAKE_DETAILED_ERRORS to true
matthid Oct 13, 2018
d45470c
change API a bit
matthid Oct 13, 2018
c974031
release notes 5.9.0
matthid Oct 13, 2018
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
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ If available, link to an existing issue this PR fixes. For example:

## TODO

Feel free to open the PR and ask for help

- [] New (API-)documentation for new features exist (Note: API-docs are enough, additional docs are in `help/markdown`)
- [] unit or integration test exists (or short reasoning why it doesn't make sense)

> Note: Consider using the `CreateProcess` API which can be tested more easily, see https://github.com/fsharp/FAKE/pull/2131/files#diff-4fb4a77e110fbbe8210205dfe022389b for an example (the changes in the `DotNet.Testing.NUnit` module)

- [] boy scout rule: "leave the code behind in a better state than you found it" (fix warnings, obsolete members or code-style in the places you worked in)
- [] (if new module) the module has been linked from the "Modules" menu, edit `help/templates/template.cshtml`, linking to the API-reference is fine.
- [] (if new module) the module is in the correct namespace
- [] (if new module) the module is added to Fake.sln (`dotnet sln Fake.sln add src/app/Fake.*/Fake.*.fsproj`)
Expand Down
23 changes: 17 additions & 6 deletions src/app/Fake.Core.Context/Context.fs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ type internal RuntimeContextWrapper(t: RuntimeContext) =
inherit System.MarshalByRefObject()
#endif
member x.Type = t
override x.ToString() =
match t with
| Fake f -> sprintf "Wrapper(ScriptFile=%s)" f.ScriptFile
| UnknownObj o -> sprintf "Wrapper(UnknownObj=%O)" o
| Unknown -> sprintf "Wrapper(Unknown)"


#if USE_ASYNC_LOCAL
open System.Threading
Expand All @@ -54,6 +60,7 @@ let private getDataDict() =
#endif

let private setContext (name:string) (o : obj) : unit =
//printfn "set context '%s' -> %A, threadId '%d'" name o System.Threading.Thread.CurrentThread.ManagedThreadId
#if USE_ASYNC_LOCAL
let d = getDataDict()
d.AddOrUpdate(name, o, fun _ old -> o) |> ignore
Expand All @@ -62,15 +69,17 @@ let private setContext (name:string) (o : obj) : unit =
#endif

let private getContext (name:string) : obj =
let result =
#if USE_ASYNC_LOCAL
let d = getDataDict()
match d.TryGetValue(name) with
| true, v -> v
| false, _ -> null
let d = getDataDict()
match d.TryGetValue(name) with
| true, v -> v
| false, _ -> null
#else
System.Runtime.Remoting.Messaging.CallContext.LogicalGetData(name)
System.Runtime.Remoting.Messaging.CallContext.LogicalGetData(name)
#endif

//printfn "get context '%s' -> '%A', threadId '%d'" name result System.Threading.Thread.CurrentThread.ManagedThreadId
result
let private fake_ExecutionType = "fake_context_execution_type"

let getExecutionContext () =
Expand All @@ -81,6 +90,8 @@ let getExecutionContext () =

let setExecutionContext (e:RuntimeContext) = setContext fake_ExecutionType (new RuntimeContextWrapper(e))

let removeExecutionContext () = setContext fake_ExecutionType null

let getFakeExecutionContext (e:RuntimeContext) =
match e with
| RuntimeContext.UnknownObj _
Expand Down
69 changes: 43 additions & 26 deletions src/app/Fake.Core.Process/CmdLineParsing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module internal CmdLineParsing =
let escapeCommandLineForShell (cmdLine:string) =
sprintf "'%s'" (cmdLine.Replace("'", "'\\''"))
let windowsArgvToCommandLine args =
let windowsArgvToCommandLine shorten args =
let escapeBackslashes (sb:System.Text.StringBuilder) (s:string) (lastSearchIndex:int) =
// Backslashes must be escaped if and only if they precede a double quote.
[ lastSearchIndex .. -1 .. 0]
Expand All @@ -14,25 +14,29 @@ module internal CmdLineParsing =

let sb = new System.Text.StringBuilder()
for (s:string) in args do
sb.Append('"') |> ignore
// Escape double quotes (") and backslashes (\).
let mutable searchIndex = 0

// Put this test first to support zero length strings.
let mutable quoteIndex = 0
while searchIndex < s.Length && quoteIndex >= 0 do
if shorten && s.Length > 0 && s.IndexOfAny([|' '; '\"'; '\\'; '\t'|]) < 0 then
sb.Append s |> ignore
sb.Append " " |> ignore
else
sb.Append('"') |> ignore
// Escape double quotes (") and backslashes (\).
let mutable searchIndex = 0

// Put this test first to support zero length strings.
let mutable quoteIndex = 0
while searchIndex < s.Length && quoteIndex >= 0 do

quoteIndex <- s.IndexOf('"', searchIndex)
if quoteIndex >= 0 then
sb.Append(s, searchIndex, quoteIndex - searchIndex) |> ignore
escapeBackslashes sb s (quoteIndex - 1)
sb.Append('\\') |> ignore
sb.Append('"') |> ignore
searchIndex <- quoteIndex + 1

sb.Append(s, searchIndex, s.Length - searchIndex) |> ignore
escapeBackslashes sb s (s.Length - 1)
sb.Append(@""" ") |> ignore
quoteIndex <- s.IndexOf('"', searchIndex)
if quoteIndex >= 0 then
sb.Append(s, searchIndex, quoteIndex - searchIndex) |> ignore
escapeBackslashes sb s (quoteIndex - 1)
sb.Append('\\') |> ignore
sb.Append('"') |> ignore
searchIndex <- quoteIndex + 1
sb.Append(s, searchIndex, s.Length - searchIndex) |> ignore
escapeBackslashes sb s (s.Length - 1)
sb.Append(@""" ") |> ignore

sb.ToString(0, System.Math.Max(0, sb.Length - 1))

Expand Down Expand Up @@ -100,23 +104,27 @@ module internal CmdLineParsing =
results.ToArray()

let toProcessStartInfo args =
let cmd = windowsArgvToCommandLine args
let cmd = windowsArgvToCommandLine true args
if Environment.isMono && Environment.isLinux then
// See https://bugzilla.xamarin.com/show_bug.cgi?id=19296
cmd.Replace("\\$", "\\\\$").Replace("\\`", "\\\\`")
else cmd

type FilePath = string

/// Helper functions for proper command line parsing
module Args =
let toWindowsCommandLine args = CmdLineParsing.windowsArgvToCommandLine args
/// Convert the given argument list to a conforming windows command line string, escapes parameter in quotes if needed (currently always but this might change).
let toWindowsCommandLine args = CmdLineParsing.windowsArgvToCommandLine true args
/// Escape the given argument list according to a unix shell (bash)
let toLinuxShellCommandLine args =
System.String.Join(" ", args |> Seq.map CmdLineParsing.escapeCommandLineForShell)

/// Read a windows command line string into its arguments
let fromWindowsCommandLine cmd = CmdLineParsing.windowsCommandLineToArgv cmd


/// Represents a list of arguments
type Arguments =
{ Args : string array }
internal { Args : string array }
static member Empty = { Args = [||] }
/// See https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
static member OfWindowsCommandLine cmd =
Expand All @@ -126,6 +134,15 @@ type Arguments =
member x.ToWindowsCommandLine = Args.toWindowsCommandLine x.Args
member x.ToLinuxShellCommandLine = Args.toLinuxShellCommandLine x.Args

static member OfArgs args = { Args = args }
/// Create a new arguments object from the given list of arguments
static member OfArgs (args:string seq) = { Args = args |> Seq.toArray }
/// Create a new arguments object from a given startinfo-conforming-escaped command line string.
static member OfStartInfo cmd = Arguments.OfWindowsCommandLine cmd
member internal x.ToStartInfo = CmdLineParsing.toProcessStartInfo x.Args
/// Create a new command line string which can be used in a ProcessStartInfo object.
member x.ToStartInfo = CmdLineParsing.toProcessStartInfo x.Args

module Arguments =
let withPrefix s (a:Arguments) =
Arguments.OfArgs(Seq.append s a.Args)
let append s (a:Arguments) =
Arguments.OfArgs(Seq.append a.Args s)
Loading