Skip to content

Commit

Permalink
Merge pull request #858 from nanoant/exp/msbuild-configuration-platfo…
Browse files Browse the repository at this point in the history
…rm-setting

Expose MsBuild Configuration and Platform setting
  • Loading branch information
DustinCampbell authored May 15, 2017
2 parents 2c96996 + afa2d8e commit 984249b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/OmniSharp.MSBuild/Options/MSBuildOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public class MSBuildOptions
{
public string ToolsVersion { get; set; }
public string VisualStudioVersion { get; set; }
public string Configuration { get; set; }
public string Platform { get; set; }
public bool EnablePackageAutoRestore { get; set; }

public string MSBuildExtensionsPath { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ private static class PropertyNames
public const string AssemblyName = nameof(AssemblyName);
public const string AssemblyOriginatorKeyFile = nameof(AssemblyOriginatorKeyFile);
public const string BuildProjectReferences = nameof(BuildProjectReferences);
public const string Configuration = nameof(Configuration);
public const string DefineConstants = nameof(DefineConstants);
public const string DesignTimeBuild = nameof(DesignTimeBuild);
public const string DocumentationFile = nameof(DocumentationFile);
Expand All @@ -17,6 +18,7 @@ private static class PropertyNames
public const string MSBuildSDKsPath = nameof(MSBuildSDKsPath);
public const string NoWarn = nameof(NoWarn);
public const string OutputPath = nameof(OutputPath);
public const string Platform = nameof(Platform);
public const string ProjectAssetsFile = nameof(ProjectAssetsFile);
public const string ProjectGuid = nameof(ProjectGuid);
public const string ProjectName = nameof(ProjectName);
Expand Down
12 changes: 12 additions & 0 deletions src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,18 @@ private static Dictionary<string, string> GetGlobalProperties(MSBuildOptions opt
userOptionValue: options.VisualStudioVersion,
environmentValue: null);

globalProperties.AddPropertyIfNeeded(
logger,
PropertyNames.Configuration,
userOptionValue: options.Configuration,
environmentValue: null);

globalProperties.AddPropertyIfNeeded(
logger,
PropertyNames.Platform,
userOptionValue: options.Platform,
environmentValue: null);

if (PlatformHelper.IsMono)
{
var monoXBuildFrameworksDirPath = PlatformHelper.MonoXBuildFrameworksDirPath;
Expand Down

0 comments on commit 984249b

Please sign in to comment.