public ConfigurationGenerator(ILog log, string source, string dest, ConfigurationGeneratorOptions options) { _log = log; _options = options; _source = source; _dest = dest; }
private string Extension(ConfigurationGeneratorOptions options) { if (!options.SupportedOutputTypes.ContainsKey(OutputType)) { throw new InvalidOperationException("Output type " + OutputType + " not supported"); } return options.SupportedOutputTypes[OutputType]; }
private ConfigurationGenerator App() { var options = new ConfigurationGeneratorOptions { ConigurationFilePath = ConigurationFilePath, OutputType = OutputType, ProjectName = ProjectName, SupportedOutputTypes = new Dictionary<string, string> { {"Library", "dll"}, {"Exe", "exe"} } }; var source = Path.Combine(@".\", BinPath, $"{ProjectName}.{Extension(options)}.config"); WriteMessage($"Loading configuration from {source}"); WriteMessage($"Writing configuration to {source}"); return new ConfigurationGenerator(this, source, source, options); }
private ConfigurationGenerator Web() { var options = new ConfigurationGeneratorOptions { ConigurationFilePath = ConigurationFilePath, OutputType = OutputType, ProjectName = ProjectName, SupportedOutputTypes = new Dictionary<string, string> { {"Library", "Web"}, {"Exe", "App"} } }; var source = $".\\{options.SupportedOutputTypes[OutputType]}.figs.config"; WriteMessage($"Loading configuration from {source}"); var dest = $".\\{options.SupportedOutputTypes[OutputType]}.config"; WriteMessage($"Writing configuration to {dest}"); return new ConfigurationGenerator(this, source, dest, options); }