use of io.micronaut.starter.template.RockerTemplate in project micronaut-starter by micronaut-projects.
the class JavaApplication method apply.
@Override
public void apply(GeneratorContext generatorContext) {
JavaApplicationFeature.super.apply(generatorContext);
if (shouldGenerateApplicationFile(generatorContext)) {
generatorContext.addTemplate("application", new RockerTemplate(getPath(), application.template(generatorContext.getProject(), generatorContext.getFeatures())));
TestFramework testFramework = generatorContext.getTestFramework();
String testSourcePath = generatorContext.getTestSourcePath("/{packagePath}/{className}");
Project project = generatorContext.getProject();
TestRockerModelProvider provider = new DefaultTestRockerModelProvider(spock.template(project), javaJunit.template(project), javaJunit.template(project), javaJunit.template(project), koTest.template(project));
generatorContext.addTemplate("applicationTest", new RockerTemplate(testSourcePath, provider.findModel(generatorContext.getLanguage(), testFramework)));
}
}
use of io.micronaut.starter.template.RockerTemplate in project micronaut-starter by micronaut-projects.
the class Logback method apply.
@Override
public void apply(GeneratorContext generatorContext) {
OperatingSystem operatingSystem = generatorContext.getOperatingSystem();
boolean jansi = false;
if (operatingSystem != OperatingSystem.WINDOWS) {
jansi = true;
}
generatorContext.addTemplate("loggingConfig", new RockerTemplate("src/main/resources/logback.xml", logback.template(jansi)));
}
Aggregations