Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
Condition=" '$(HostOS)' != 'Windows' "
Command="chmod +x $(OutputPath)bin\generator"
/>
<Exec
Condition=" '$(HostOS)' != 'Windows' "
Command="chmod +x $(OutputPath)bin\cross*"
/>
<Exec
Condition=" '$(HostOS)' != 'Windows' "
Command="chmod +x $(OutputPath)bin\llc"
/>
</Target>

<Target Name="Clean">
Expand Down
61 changes: 31 additions & 30 deletions src/Xamarin.Android.Build.Tasks/Tasks/Aapt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,36 +99,37 @@ bool RunAapt (string commandLine)
WindowStyle = ProcessWindowStyle.Hidden,
};

var proc = new Process ();
proc.OutputDataReceived += (sender, e) => {
if (e.Data != null)
LogEventsFromTextOutput (e.Data, MessageImportance.Normal);
else
stdout_completed.Set ();
};
proc.ErrorDataReceived += (sender, e) => {
if (e.Data != null)
LogEventsFromTextOutput (e.Data, MessageImportance.Normal);
else
stderr_completed.Set ();
};
proc.StartInfo = psi;
proc.Start ();
proc.BeginOutputReadLine ();
proc.BeginErrorReadLine ();
Token.Register (() => {
try {
proc.Kill ();
} catch (Exception) {
}
});
LogDebugMessage ("Executing {0}", commandLine);
proc.WaitForExit ();
if (psi.RedirectStandardError)
stderr_completed.WaitOne (TimeSpan.FromSeconds (30));
if (psi.RedirectStandardOutput)
stdout_completed.WaitOne (TimeSpan.FromSeconds (30));
return proc.ExitCode == 0;
using (var proc = new Process ()) {
proc.OutputDataReceived += (sender, e) => {
if (e.Data != null)
LogEventsFromTextOutput (e.Data, MessageImportance.Normal);
else
stdout_completed.Set ();
};
proc.ErrorDataReceived += (sender, e) => {
if (e.Data != null)
LogEventsFromTextOutput (e.Data, MessageImportance.Normal);
else
stderr_completed.Set ();
};
proc.StartInfo = psi;
proc.Start ();
proc.BeginOutputReadLine ();
proc.BeginErrorReadLine ();
Token.Register (() => {
try {
proc.Kill ();
} catch (Exception) {
}
});
LogDebugMessage ("Executing {0}", commandLine);
proc.WaitForExit ();
if (psi.RedirectStandardError)
stderr_completed.WaitOne (TimeSpan.FromSeconds (30));
if (psi.RedirectStandardOutput)
stdout_completed.WaitOne (TimeSpan.FromSeconds (30));
return proc.ExitCode == 0;
}
}

bool ExecuteForAbi (string cmd, string currentResourceOutputFile)
Expand Down
38 changes: 28 additions & 10 deletions src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ IEnumerable<Config> GetAotConfigs ()

bool RunAotCompiler (string assembliesPath, string aotCompiler, string aotOptions, string assembly, CancellationToken token)
{
var stdout_completed = new ManualResetEvent (false);
var stderr_completed = new ManualResetEvent (false);
var psi = new ProcessStartInfo () {
FileName = aotCompiler,
Arguments = aotOptions + " \"" + assembly + "\"",
Expand All @@ -453,16 +455,32 @@ bool RunAotCompiler (string assembliesPath, string aotCompiler, string aotOption
LogDebugMessage ("[AOT] MONO_PATH=\"{0}\" MONO_ENV_OPTIONS=\"{1}\" {2} {3}",
psi.EnvironmentVariables ["MONO_PATH"], psi.EnvironmentVariables ["MONO_ENV_OPTIONS"], psi.FileName, psi.Arguments);

var proc = new Process ();
proc.OutputDataReceived += OnAotOutputData;
proc.ErrorDataReceived += OnAotErrorData;
proc.StartInfo = psi;
proc.Start ();
proc.BeginOutputReadLine ();
proc.BeginErrorReadLine ();
token.Register (() => { try { proc.Kill (); } catch (Exception) {} });
proc.WaitForExit ();
return proc.ExitCode == 0;
using (var proc = new Process ()) {
proc.OutputDataReceived += (s, e) => {
if (e.Data != null)
OnAotOutputData (s, e);
else
stdout_completed.Set ();
};
proc.ErrorDataReceived += (s, e) => {
if (e.Data != null)
OnAotErrorData (s, e);
else
stderr_completed.Set ();
};
proc.StartInfo = psi;
proc.Start ();
proc.BeginOutputReadLine ();
proc.BeginErrorReadLine ();
token.Register (() => { try { proc.Kill (); } catch (Exception) { } });
proc.WaitForExit ();
if (psi.RedirectStandardError)
stderr_completed.WaitOne (TimeSpan.FromSeconds (30));
if (psi.RedirectStandardOutput)
stdout_completed.WaitOne (TimeSpan.FromSeconds (30));
return proc.ExitCode == 0;
}
GC.Collect ();
}

void OnAotOutputData (object sender, DataReceivedEventArgs e)
Expand Down
Loading