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

Correct waiting for android packaging and fix for mono processes encoding #1275

Merged
merged 1 commit into from
Jun 19, 2016
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions src/app/FakeLib/ProcessHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ let start (proc : Process) =
if isMono && proc.StartInfo.FileName.ToLowerInvariant().EndsWith(".exe") then
proc.StartInfo.Arguments <- "--debug \"" + proc.StartInfo.FileName + "\" " + proc.StartInfo.Arguments
proc.StartInfo.FileName <- monoPath
if isMono then
proc.StartInfo.StandardOutputEncoding <- Encoding.UTF8
proc.StartInfo.StandardErrorEncoding <- Encoding.UTF8

proc.Start() |> ignore
startedProcesses.Add(proc.Id, proc.StartTime) |> ignore
Expand Down Expand Up @@ -66,9 +69,6 @@ let ExecProcessWithLambdas configProcessStartInfoF (timeOut : TimeSpan) silent e
if silent then
proc.StartInfo.RedirectStandardOutput <- true
proc.StartInfo.RedirectStandardError <- true
if isMono then
proc.StartInfo.StandardOutputEncoding <- Encoding.UTF8
proc.StartInfo.StandardErrorEncoding <- Encoding.UTF8
proc.ErrorDataReceived.Add(fun d ->
if d.Data <> null then errorF d.Data)
proc.OutputDataReceived.Add(fun d ->
Expand Down
10 changes: 8 additions & 2 deletions src/app/FakeLib/XamarinHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ open System.Xml
open System.Text

let private executeCommand command args =
Shell.Exec(command, args)
|> fun result -> if result <> 0 then failwithf "%s exited with error %d" command result
ExecProcessAndReturnMessages (fun p ->
p.FileName <- command
p.Arguments <- args
) TimeSpan.MaxValue
|> fun result ->
let output = String.Join (Environment.NewLine, result.Messages)
tracefn "Process output: \r\n%A" output
if result.ExitCode <> 0 then failwithf "%s exited with error %d" command result.ExitCode

/// The package restore paramater type
type XamarinComponentRestoreParams = {
Expand Down