Skip to content

Commit

Permalink
[MSBuild] Complete fix for mono#2226 - Platform value in MSBuild not …
Browse files Browse the repository at this point in the history
…the same as VS
  • Loading branch information
mhutch committed Feb 21, 2012
1 parent f5945b8 commit 37528ee
Showing 1 changed file with 12 additions and 9 deletions.
Expand Up @@ -153,14 +153,24 @@ public override void Dispose ()
Runtime.SystemAssemblyService.DefaultRuntimeChanged -= OnDefaultRuntimeChanged;
}

//for some reason, MD internally handles "AnyCPU" as "", but we need to be explicit when
//passing it to the build engine
static string GetExplicitPlatform (SolutionItemConfiguration configObject)
{
if (string.IsNullOrEmpty (configObject.Platform)) {
return "AnyCPU";
}
return configObject.Platform;
}

IEnumerable<string> IAssemblyReferenceHandler.GetAssemblyReferences (ConfigurationSelector configuration)
{
if (useXBuild) {
// Get the references list from the msbuild project
SolutionEntityItem item = (SolutionEntityItem) Item;
RemoteProjectBuilder builder = GetProjectBuilder ();
SolutionItemConfiguration configObject = item.GetConfiguration (configuration);
foreach (string s in builder.GetAssemblyReferences (configObject.Name, configObject.Platform))
foreach (string s in builder.GetAssemblyReferences (configObject.Name, GetExplicitPlatform (configObject)))
yield return s;
}
else {
Expand All @@ -184,14 +194,7 @@ public override BuildResult RunTarget (IProgressMonitor monitor, string target,

LogWriter logWriter = new LogWriter (monitor.Log);
RemoteProjectBuilder builder = GetProjectBuilder ();

//for some reason, MD internally handles "AnyCPU" as "", but we need to be explicit when
//passing it to the build engine
var platform = configObject.Platform;
if (platform.Length == 0)
platform = "AnyCPU";

MSBuildResult[] results = builder.RunTarget (target, configObject.Name, configObject.Platform,
MSBuildResult[] results = builder.RunTarget (target, configObject.Name, GetExplicitPlatform (configObject),
logWriter, verbosity);
System.Runtime.Remoting.RemotingServices.Disconnect (logWriter);

Expand Down

0 comments on commit 37528ee

Please sign in to comment.