Skip to content

Instantly share code, notes, and snippets.

@al1b
Created May 29, 2019 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save al1b/65679c91d96dd9559f683ea970148688 to your computer and use it in GitHub Desktop.
Save al1b/65679c91d96dd9559f683ea970148688 to your computer and use it in GitHub Desktop.
Simple implemention of ICompilerSettings
class CompilerSettings : ICompilerSettings
{
private readonly CompilerLanguage _compilerLang;
private readonly string _rootDirectory = new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath;
private string _compilerPath => _compilerLang == CompilerLanguage.CSharp
? @"roslyn\csc.exe"
: @"roslyn\vbc.exe";
public CompilerSettings(CompilerLanguage compiler = CompilerLanguage.CSharp)
{
_compilerLang = compiler;
}
public string CompilerFullPath => Path.Combine(_rootDirectory, _compilerPath);
public int CompilerServerTimeToLive => 60 * 15;
public enum CompilerLanguage
{
CSharp,
VB
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment