Skip to content

Commit

Permalink
Merge pull request dotnet#758 from radical/mono-fixes
Browse files Browse the repository at this point in the history
Fix mono/osx build and tests
  • Loading branch information
rainersigwald authored Jul 8, 2016
2 parents 00c04c8 + e190a6f commit 0242a62
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
16 changes: 8 additions & 8 deletions src/Shared/FrameworkLocationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1358,8 +1358,8 @@ public virtual string GetPathToDotNetFramework(DotNetFrameworkArchitecture archi
if (NativeMethodsShared.IsWindows)
{
if (!CheckForFrameworkInstallation(
this.dotNetFrameworkRegistryKey,
this.dotNetFrameworkSetupRegistryInstalledName))
this._dotNetFrameworkRegistryKey,
this._dotNetFrameworkSetupRegistryInstalledName))
{
return null;
}
Expand All @@ -1375,7 +1375,7 @@ public virtual string GetPathToDotNetFramework(DotNetFrameworkArchitecture archi
architecture);

// .net was improperly uninstalled: msbuild.exe isn't there
if (this._hasMSBuild &&
if (this._hasMsBuild &&
generatedPathToDotNetFramework != null &&
!File.Exists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.IsWindows ? "MSBuild.exe" : "mcs.exe")))
{
Expand Down Expand Up @@ -1425,7 +1425,7 @@ public virtual string GetPathToDotNetFrameworkSdkTools(VisualStudioSpec visualSt
@"\",
MicrosoftSDKsRegistryKey,
visualStudioSpec.GetDotNetFrameworkSdkRegistryKey(Version),
this.dotNetFrameworkSdkRegistryToolsKey);
this._dotNetFrameworkSdkRegistryToolsKey);

// For the Dev10 SDK, we check the registry that corresponds to the current process' bitness, rather than
// always the 32-bit one the way we do for Dev11 and onward, since that's what we did in Dev10 as well.
Expand All @@ -1434,7 +1434,7 @@ public virtual string GetPathToDotNetFrameworkSdkTools(VisualStudioSpec visualSt

generatedPathToDotNetFrameworkSdkTools = FindRegistryValueUnderKey(
registryPath,
this.dotNetFrameworkSdkRegistryInstallationFolderName,
this.DotNetFrameworkSdkRegistryInstallationFolderName,
registryView);

if (string.IsNullOrEmpty(generatedPathToDotNetFrameworkSdkTools))
Expand All @@ -1447,7 +1447,7 @@ public virtual string GetPathToDotNetFrameworkSdkTools(VisualStudioSpec visualSt
for (int i = 0; i < s_explicitFallbackRulesForPathToDotNetFrameworkSdkTools.GetLength(0); ++i)
{
var trigger = s_explicitFallbackRulesForPathToDotNetFrameworkSdkTools[i, 0];
if (trigger.Item1 == this.version && trigger.Item2 == visualStudioSpec.Version)
if (trigger.Item1 == this.Version && trigger.Item2 == visualStudioSpec.Version)
{
foundExplicitRule = true;
var fallback = s_explicitFallbackRulesForPathToDotNetFrameworkSdkTools[i, 1];
Expand All @@ -1468,7 +1468,7 @@ public virtual string GetPathToDotNetFrameworkSdkTools(VisualStudioSpec visualSt
// The items in the array "visualStudioSpecs" must be ordered by version. That would allow us to fallback to the previous visual studio version easily.
VisualStudioSpec fallbackVisualStudioSpec = s_visualStudioSpecs[index - 1];
generatedPathToDotNetFrameworkSdkTools = FallbackToPathToDotNetFrameworkSdkToolsInPreviousVersion(
this.version,
this.Version,
fallbackVisualStudioSpec.Version);
}
}
Expand Down Expand Up @@ -1701,7 +1701,7 @@ public override string GetPathToDotNetFrameworkReferenceAssemblies()
{
#if FEATURE_WIN32_REGISTRY
this._pathToDotNetFrameworkReferenceAssemblies = FindRegistryValueUnderKey(
dotNetFrameworkAssemblyFoldersRegistryPath + "\\" + this.dotNetFrameworkFolderPrefix,
dotNetFrameworkAssemblyFoldersRegistryPath + "\\" + this.DotNetFrameworkFolderPrefix,
referenceAssembliesRegistryValueName);
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,24 +571,20 @@ public void ExtensionPathsTest_Basic1()
string defaultToolsVersion = reader.ReadToolsets(toolsets, new PropertyDictionary<ProjectPropertyInstance>(), new PropertyDictionary<ProjectPropertyInstance>(), true, out msbuildOverrideTasksPath, out defaultOverrideToolsVersion);

Dictionary<string, List<string>> pathsTable = toolsets["2.0"].ImportPropertySearchPathsTable;
#if XPLAT
if (NativeMethodsShared.IsWindows)
#endif
{
CheckPathsTable(pathsTable, "MSBuildExtensionsPath", new string[] {"c:\\foo"});
CheckPathsTable(pathsTable, "MSBuildExtensionsPath64", new string[] {"c:\\foo64", "c:\\bar64"});
}
#if XPLAT
else if (NativeMethodsShared.IsOSX)
{
CheckPathsTable(pathsTable, ProjectImportPathMatch.Default, new string[] {"/tmp/foo"});
CheckPathsTable(pathsTable, ProjectImportPathMatch.Path32, new string[] {"/tmp/foo32", "/tmp/bar32"});
CheckPathsTable(pathsTable, "MSBuildExtensionsPath", new string[] {"/tmp/foo"});
CheckPathsTable(pathsTable, "MSBuildExtensionsPath32", new string[] {"/tmp/foo32", "/tmp/bar32"});
}
else
{
CheckPathsTable(pathsTable, ProjectImportPathMatch.Default, new string[] {"/tmp/bar"});
CheckPathsTable(pathsTable, "MSBuildExtensionsPath", new string[] {"/tmp/bar"});
}
#endif
}

private void CheckPathsTable(Dictionary<string, List<string>> pathsTable, string kind, string[] expectedPaths)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ namespace Microsoft.Build.UnitTests.Evaluation
/// </summary>
public class ImportFromMSBuildExtensionsPathTests : IDisposable
{
string toolsVersionToUse = null;

public ImportFromMSBuildExtensionsPathTests()
{
toolsVersionToUse = new ProjectCollection().DefaultToolsVersion;
}

public void Dispose()
{
ToolsetConfigurationReaderTestHelper.CleanUp();
Expand Down Expand Up @@ -354,8 +361,8 @@ public void ImportFromExtensionsPathAnd32And64()
<configSections>
<section name=""msbuildToolsets"" type=""Microsoft.Build.Evaluation.ToolsetConfigurationSection, Microsoft.Build"" />
</configSections>
<msbuildToolsets default=""14.1"">
<toolset toolsVersion=""14.1"">
<msbuildToolsets default=""" + toolsVersionToUse + @""">
<toolset toolsVersion=""" + toolsVersionToUse + @""">
<property name=""MSBuildToolsPath"" value="".""/>
<property name=""MSBuildBinPath"" value=""" + /*v4Folder*/"." + @"""/>
<projectImportSearchPaths>
Expand Down Expand Up @@ -432,8 +439,8 @@ public void ExpandExtensionsPathFallback()
<configSections>
<section name=""msbuildToolsets"" type=""Microsoft.Build.Evaluation.ToolsetConfigurationSection, Microsoft.Build"" />
</configSections>
<msbuildToolsets default=""14.1"">
<toolset toolsVersion=""14.1"">
<msbuildToolsets default=""" + toolsVersionToUse + @""">
<toolset toolsVersion=""" + toolsVersionToUse + @""">
<property name=""MSBuildToolsPath"" value="".""/>
<property name=""MSBuildBinPath"" value="".""/>
<projectImportSearchPaths>
Expand Down Expand Up @@ -493,8 +500,8 @@ public void ExpandExtensionsPathFallbackInErrorMessage()
<configSections>
<section name=""msbuildToolsets"" type=""Microsoft.Build.Evaluation.ToolsetConfigurationSection, Microsoft.Build"" />
</configSections>
<msbuildToolsets default=""14.1"">
<toolset toolsVersion=""14.1"">
<msbuildToolsets default=""" + toolsVersionToUse + @""">
<toolset toolsVersion=""" + toolsVersionToUse + @""">
<property name=""MSBuildToolsPath"" value="".""/>
<property name=""MSBuildBinPath"" value="".""/>
<projectImportSearchPaths>
Expand Down Expand Up @@ -563,8 +570,8 @@ public void FallbackImportWithIndirectReference()
<configSections>
<section name=""msbuildToolsets"" type=""Microsoft.Build.Evaluation.ToolsetConfigurationSection, Microsoft.Build"" />
</configSections>
<msbuildToolsets default=""14.1"">
<toolset toolsVersion=""14.1"">
<msbuildToolsets default=""" + toolsVersionToUse + @""">
<toolset toolsVersion=""" + toolsVersionToUse + @""">
<property name=""MSBuildToolsPath"" value="".""/>
<property name=""MSBuildBinPath"" value="".""/>
<projectImportSearchPaths>
Expand Down Expand Up @@ -673,8 +680,8 @@ private ToolsetConfigurationReader WriteConfigFileAndGetReader(string extnPathPr
<configSections>
<section name=""msbuildToolsets"" type=""Microsoft.Build.Evaluation.ToolsetConfigurationSection, Microsoft.Build"" />
</configSections>
<msbuildToolsets default=""14.1"">
<toolset toolsVersion=""14.1"">
<msbuildToolsets default=""" + toolsVersionToUse + @""">
<toolset toolsVersion=""" + toolsVersionToUse + @""">
<property name=""MSBuildToolsPath"" value=""."" />
<property name=""MSBuildBinPath"" value=""."" />
<projectImportSearchPaths>
Expand Down

0 comments on commit 0242a62

Please sign in to comment.