public ConfigurationGenerator(ILog log, string source, string dest, ConfigurationGeneratorOptions options)
 {
     _log = log;
     _options = options;
     _source = source;
     _dest = dest;
 }
示例#2
0
 private string Extension(ConfigurationGeneratorOptions options)
 {
     if (!options.SupportedOutputTypes.ContainsKey(OutputType))
     {
         throw new InvalidOperationException("Output type " + OutputType + " not supported");
     }
     return options.SupportedOutputTypes[OutputType];
 }
示例#3
0
 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);
 }
示例#4
0
 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);
 }