ln.build/ln.build/semver/provider/Provider.cs

39 lines
746 B
C#

using System;
using System.Diagnostics.Contracts;
using System.IO;
namespace ln.build.semver.provider
{
public abstract class Provider
{
public String Name { get; }
public Provider(string providerName)
{
Name = providerName;
}
public abstract SemVersion GetVersion(string source);
public abstract void SetVersion(string source, SemVersion version);
public static Provider CreateProvider(string providerName)
{
switch (providerName)
{
case "dotnet":
return new DotNetProvider();
default:
throw new FileNotFoundException();
}
}
}
}