Esempio n. 1
0
        public void Generate(string archive,
                             string @namespace,
                             bool pascalCase,
                             TermAttributeType termAttribute,
                             string output,
                             bool mapMethod)
        {
            Console.WriteLine($"Generating files for archive {archive} using configuration:");

            var archiveGeneratorConfiguration = archiveGeneratorConfigFactory
                                                .BuildConfiguration(@namespace, pascalCase, termAttribute, output, mapMethod);

            //TODO: Maybe add a verbose switch to turn this on/off
            ConfigList(archiveGeneratorConfiguration);
            var sourceFiles = archiveSourceGenerator.GenerateSource(archive, archiveGeneratorConfiguration);

            sourceFiles.ToList().ForEach((fileName) => Console.WriteLine($"Created {fileName}"));
        }
        public IGeneratorConfiguration BuildConfiguration(
            string @namespace,
            bool pascalCase,
            TermAttributeType termAttribute,
            string output,
            bool mapMethod)
        {
            var archiveGeneratorConfiguration = new ArchiveGeneratorConfiguration()
                                                .AddNamespace(@namespace)
                                                .AddPascalCase(pascalCase)
                                                .AddTermAttribute(termAttribute)
                                                .AddOutput(output)
                                                .AddMapMethod(mapMethod);

            BuildUsings(archiveGeneratorConfiguration);

            BuildProperties(archiveGeneratorConfiguration);

            return(archiveGeneratorConfiguration);
        }
 public GeneratorConfigurationBuilder WithTermAttribute(TermAttributeType termAttribute)
 {
     config.TermAttribute = termAttribute;
     return(this);
 }
 public ArchiveGeneratorConfiguration AddTermAttribute(TermAttributeType termAttribute)
 {
     this.termAttributeType = termAttribute;
     return(this);
 }