Example #1
0
        public override void Run(string[] args)
        {
            if (assertProperties())
            {
                var properties = loadProperties();
                var config     = new CodeGeneratorConfig();
                config.Configure(properties);

                Type[] types = null;
                Dictionary <string, string> configurables = null;

                try {
                    types         = CodeGeneratorUtil.LoadTypesFromPlugins(properties);
                    configurables = CodeGeneratorUtil.GetConfigurables(
                        CodeGeneratorUtil.GetUsed <ICodeGeneratorDataProvider>(types, config.dataProviders),
                        CodeGeneratorUtil.GetUsed <ICodeGenerator>(types, config.codeGenerators),
                        CodeGeneratorUtil.GetUsed <ICodeGenFilePostProcessor>(types, config.postProcessors)
                        );
                } catch (Exception ex) {
                    fixKeys(null, config.defaultProperties, properties);
                    throw ex;
                }

                fixKeys(configurables, config.defaultProperties, properties);
                fixConfigurableKeys(configurables, properties);
                fixPlugins(types, config, properties);
            }
        }
Example #2
0
        public override void Run(string[] args)
        {
            if (assertPreferences())
            {
                var preferences = loadPreferences();
                var config      = new CodeGeneratorConfig();
                config.Configure(preferences);

                fabl.Debug(config.ToString());

                Type[] types = null;
                Dictionary <string, string> configurables = null;

                try {
                    types         = CodeGeneratorUtil.LoadTypesFromPlugins(preferences);
                    configurables = CodeGeneratorUtil.GetConfigurables(
                        CodeGeneratorUtil.GetUsed <ICodeGeneratorDataProvider>(types, config.dataProviders),
                        CodeGeneratorUtil.GetUsed <ICodeGenerator>(types, config.codeGenerators),
                        CodeGeneratorUtil.GetUsed <ICodeGenFilePostProcessor>(types, config.postProcessors)
                        );
                } catch (Exception ex) {
                    printKeyStatus(config.defaultProperties.Keys.ToArray(), preferences);
                    throw ex;
                }

                var requiredKeys = config.defaultProperties.Merge(configurables).Keys.ToArray();

                printKeyStatus(requiredKeys, preferences);
                printPluginStatus(types, config);
            }
        }
Example #3
0
 static Dictionary <string, string> getConfigurables(Type[] types, CodeGeneratorConfig config)
 {
     return(CodeGeneratorUtil.GetConfigurables(
                CodeGeneratorUtil.GetUsed <ICodeGeneratorDataProvider>(types, config.dataProviders),
                CodeGeneratorUtil.GetUsed <ICodeGenerator>(types, config.codeGenerators),
                CodeGeneratorUtil.GetUsed <ICodeGenFilePostProcessor>(types, config.postProcessors)
                ));
 }
Example #4
0
 Dictionary <string, string> GetConfigurables()
 {
     return(CodeGeneratorUtil.GetConfigurables(
                CodeGeneratorUtil.GetUsed <ICodeGeneratorDataProvider>(mTypes, mCodeGeneratorConfig.DataProviders),
                CodeGeneratorUtil.GetUsed <ICodeGenerator>(mTypes, mCodeGeneratorConfig.CodeGenerators),
                CodeGeneratorUtil.GetUsed <ICodeGenFilePostProcessor>(mTypes, mCodeGeneratorConfig.PostProcessors)
                ));
 }