-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #988 from DustinCampbell/locate-msbuild
Re-architect how MSBuild is loaded by OmniSharp
- Loading branch information
Showing
29 changed files
with
903 additions
and
545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/OmniSharp.Abstractions/MSBuild/Discovery/DiscoveryType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace OmniSharp.MSBuild.Discovery | ||
{ | ||
public enum DiscoveryType | ||
{ | ||
StandAlone = 0, | ||
DeveloperConsole = 1, | ||
VisualStudioSetup = 2, | ||
Mono = 3 | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/OmniSharp.Abstractions/MSBuild/Discovery/IMSBuildLocator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Collections.Immutable; | ||
|
||
namespace OmniSharp.MSBuild.Discovery | ||
{ | ||
public interface IMSBuildLocator | ||
{ | ||
MSBuildInstance RegisteredInstance { get; } | ||
|
||
void RegisterInstance(MSBuildInstance instance); | ||
ImmutableArray<MSBuildInstance> GetInstances(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/OmniSharp.Abstractions/MSBuild/Discovery/MSBuildInstance.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections.Immutable; | ||
|
||
namespace OmniSharp.MSBuild.Discovery | ||
{ | ||
public class MSBuildInstance | ||
{ | ||
public string Name { get; } | ||
public string MSBuildPath { get; } | ||
public Version Version { get; } | ||
public DiscoveryType DiscoveryType { get; } | ||
public ImmutableDictionary<string, string> PropertyOverrides { get; } | ||
public bool SetMSBuildExePathVariable { get; } | ||
|
||
public MSBuildInstance( | ||
string name, string msbuildPath, Version version, DiscoveryType discoveryType, | ||
ImmutableDictionary<string, string> propertyOverrides = null, | ||
bool setMSBuildExePathVariable = false) | ||
{ | ||
Name = name; | ||
MSBuildPath = msbuildPath; | ||
Version = version ?? new Version(0, 0); | ||
DiscoveryType = discoveryType; | ||
PropertyOverrides = propertyOverrides ?? ImmutableDictionary<string, string>.Empty; | ||
SetMSBuildExePathVariable = setMSBuildExePathVariable; | ||
} | ||
|
||
public override string ToString() | ||
=> $"{Name} {Version} - \"{MSBuildPath}\""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("TestUtility")] | ||
[assembly: InternalsVisibleTo("OmniSharp.Http.Tests")] | ||
[assembly: InternalsVisibleTo("TestUtility")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.