Skip to content
Merged
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
19 changes: 16 additions & 3 deletions tools/xabuild/XABuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static int Main ()
}

//Create a custom xabuild.exe.config
CreateConfig (paths);
var xml = CreateConfig (paths);

//Create link to .NETFramework and .NETPortable directory
foreach (var dir in Directory.GetDirectories (paths.SystemProfiles)) {
Expand All @@ -28,7 +28,19 @@ static int Main ()
}
}

return MSBuildApp.Main ();
int exitCode = MSBuildApp.Main ();
if (exitCode != 0) {
Console.WriteLine ($"MSBuildApp.Main exited with {exitCode}, xabuild configuration is:");

var settings = new XmlWriterSettings {
Indent = true,
NewLineOnAttributes = true,
};
using (var writer = XmlTextWriter.Create (Console.Out, settings)) {
xml.WriteTo (writer);
}
}
return exitCode;
} finally {
//NOTE: these are temporary files
foreach (var file in new [] { paths.MSBuildExeTempPath, paths.XABuildConfig }) {
Expand All @@ -39,7 +51,7 @@ static int Main ()
}
}

static void CreateConfig (XABuildPaths paths)
static XmlDocument CreateConfig (XABuildPaths paths)
{
var xml = new XmlDocument ();
xml.Load (paths.MSBuildConfig);
Expand Down Expand Up @@ -90,6 +102,7 @@ static void CreateConfig (XABuildPaths paths)
xml.Save (paths.XABuildConfig);

Environment.SetEnvironmentVariable ("MSBUILD_EXE_PATH", paths.MSBuildExeTempPath, EnvironmentVariableTarget.Process);
return xml;
}

/// <summary>
Expand Down