Files
Tom Hvitved 836daaf07b C#: Recognize .proj files in autobuilder
When determining the target of `msbuild` or `dotnet build`, first look for `.proj`
files, then `.sln` files, and finally `.csproj`/`.vcxproj` files. In all three cases,
choose the project/solution file closest to the root.
2018-11-23 09:32:12 +01:00

22 lines
629 B
C#

namespace Semmle.Autobuild
{
public sealed class Language
{
public static readonly Language Cpp = new Language(".vcxproj");
public static readonly Language CSharp = new Language(".csproj");
public bool ProjectFileHasThisLanguage(string path) =>
System.IO.Path.GetExtension(path) == ProjectExtension;
public readonly string ProjectExtension;
private Language(string extension)
{
ProjectExtension = extension;
}
public override string ToString() =>
ProjectExtension == Cpp.ProjectExtension ? "C/C++" : "C#";
}
}