use of ilargia.entitas.codeGeneration.CodeGenerator in project Entitas-Java by Rubentxu.
the class CodeGenerationTask method run.
@TaskAction
public void run() {
entitasProject = new EntitasGradleProject(getProject());
CodeGenerator codeGenerator = entitasProject.getCodeGenerator();
codeGenerator.generate();
}
use of ilargia.entitas.codeGeneration.CodeGenerator in project Entitas-Java by Rubentxu.
the class EntitasGradleProject method getCodeGenerator.
@Override
public CodeGenerator getCodeGenerator() {
Properties properties = loadProperties();
CodeGeneratorConfig config = new CodeGeneratorConfig();
config.configure(properties);
List<Class> types = loadTypesFromPlugins(properties);
List<ICodeGeneratorDataProvider> dataProviders = getEnabledInstances(types, config.getDataProviders(), ICodeGeneratorDataProvider.class);
List<ICodeGenerator> codeGenerators = getEnabledInstances(types, config.getCodeGenerators(), ICodeGenerator.class);
List<ICodeGenFilePostProcessor> postProcessors = getEnabledInstances(types, config.getPostProcessors(), ICodeGenFilePostProcessor.class);
configure(dataProviders, properties);
configure(codeGenerators, properties);
configure(postProcessors, properties);
return new CodeGenerator(dataProviders, codeGenerators, postProcessors);
}
use of ilargia.entitas.codeGeneration.CodeGenerator in project Entitas-Java by Rubentxu.
the class DryRun method run.
@Override
public void run(String[] args) {
System.out.println("Entitas Code Generator version " + 1);
if (assertProperties()) {
//CodeGeneratorUtil.codeGeneratorFromProperties();
CodeGenerator codeGenerator = null;
codeGenerator.OnProgress = (title, info, progress) -> {
int p = (int) (progress * 100);
System.out.println(String.format("{0}: {1} ({2}%)", title, info, p));
};
codeGenerator.dryRun();
}
}
use of ilargia.entitas.codeGeneration.CodeGenerator in project Entitas-Java by Rubentxu.
the class Generate method run.
@Override
public void run(String[] args) {
System.out.println("Entitas Code Generator version " + 1);
if (assertProperties()) {
//CodeGeneratorUtil.codeGeneratorFromProperties();
CodeGenerator codeGenerator = null;
codeGenerator.OnProgress = (title, info, progress) -> {
int p = (int) (progress * 100);
System.out.println(String.format("{0}: {1} ({2}%)", title, info, p));
};
codeGenerator.generate();
}
}
Aggregations