use of io.micronaut.starter.application.ApplicationType in project micronaut-starter by micronaut-projects.
the class AwsLambdaCustomRuntime method apply.
@SuppressWarnings("EmptyBlock")
@Override
public void apply(GeneratorContext generatorContext) {
ApplicationFeature.super.apply(generatorContext);
ApplicationType applicationType = generatorContext.getApplicationType();
Project project = generatorContext.getProject();
if (shouldGenerateMainClassForRuntime(generatorContext)) {
addBookLambdaRuntime(generatorContext, project);
}
addBootstrap(generatorContext, applicationType);
}
use of io.micronaut.starter.application.ApplicationType in project micronaut-starter by micronaut-projects.
the class FeatureDiffCommand method call.
@Override
public Integer call() throws Exception {
String appName = FileSystemOutputHandler.getDefaultBaseDirectory().getName();
Project project = NameUtils.parse(config.getDefaultPackage() + "." + appName);
Options options = new Options(config.getSourceLanguage(), config.getTestFramework(), config.getBuildTool());
ApplicationType applicationType = config.getApplicationType();
List<String> features = this.features;
ProjectGenerator projectGenerator = this.projectGenerator;
featureDiffer.produceDiff(projectGenerator, project, applicationType, options, getOperatingSystem(), features, this);
return 0;
}
use of io.micronaut.starter.application.ApplicationType in project micronaut-starter by micronaut-projects.
the class AwsLambda method apply.
@Override
public void apply(GeneratorContext generatorContext) {
Project project = generatorContext.getProject();
if (shouldGenerateSources(generatorContext)) {
addBook(generatorContext, project);
addBookSaved(generatorContext, project);
ApplicationType applicationType = generatorContext.getApplicationType();
if (applicationType == DEFAULT || applicationType == FUNCTION) {
if (applicationType == DEFAULT) {
addBookController(generatorContext, project);
addBookControllerTest(generatorContext, project);
} else {
addRequestHandler(generatorContext, project);
addTest(generatorContext, project);
}
DocumentationLink link = new DocumentationLink(LINK_TITLE, LINK_URL);
generatorContext.addHelpTemplate(new RockerWritable(readmeRockerModel(this, generatorContext, link)));
}
}
}
use of io.micronaut.starter.application.ApplicationType in project micronaut-starter by micronaut-projects.
the class OracleRawFunction method apply.
@Override
public void apply(GeneratorContext generatorContext) {
ApplicationType type = generatorContext.getApplicationType();
if (type == ApplicationType.FUNCTION) {
applyFunction(generatorContext, type);
Language language = generatorContext.getLanguage();
Project project = generatorContext.getProject();
String sourceFile = generatorContext.getSourcePath("/{packagePath}/Function");
switch(language) {
case GROOVY:
generatorContext.addTemplate("function", new RockerTemplate(sourceFile, oracleRawFunctionGroovy.template(project)));
break;
case KOTLIN:
generatorContext.addTemplate("function", new RockerTemplate(sourceFile, oracleRawFunctionKotlin.template(project)));
break;
case JAVA:
default:
generatorContext.addTemplate("function", new RockerTemplate(sourceFile, oracleRawFunctionJava.template(project)));
}
applyTestTemplate(generatorContext, project, "Function");
}
}
use of io.micronaut.starter.application.ApplicationType in project micronaut-starter by micronaut-projects.
the class GoogleCloudRawFunction method apply.
@Override
public void apply(GeneratorContext generatorContext) {
ApplicationType type = generatorContext.getApplicationType();
applyFunction(generatorContext, type);
if (type == ApplicationType.FUNCTION) {
Language language = generatorContext.getLanguage();
Project project = generatorContext.getProject();
String sourceFile = generatorContext.getSourcePath("/{packagePath}/Function");
switch(language) {
case GROOVY:
generatorContext.addTemplate("function", new RockerTemplate(sourceFile, gcpRawBackgroundFunctionGroovy.template(project)));
break;
case KOTLIN:
generatorContext.addTemplate("function", new RockerTemplate(sourceFile, gcpRawBackgroundFunctionKotlin.template(project)));
break;
case JAVA:
default:
generatorContext.addTemplate("function", new RockerTemplate(sourceFile, gcpRawBackgroundFunctionJava.template(project)));
}
applyTestTemplate(generatorContext, project, "Function");
}
}
Aggregations