Search in sources :

Example 1 with BuildProperties

use of io.micronaut.starter.build.BuildProperties in project micronaut-starter by micronaut-projects.

the class ApplicationFeature method apply.

@Override
default void apply(GeneratorContext generatorContext) {
    if (generatorContext.getBuildTool() == BuildTool.MAVEN) {
        String mainClass = mainClassName(generatorContext);
        if (mainClass != null) {
            BuildProperties buildProperties = generatorContext.getBuildProperties();
            buildProperties.put("exec.mainClass", mainClass);
            buildProperties.put("packaging", DEFAULT_PACKAGING);
        }
    }
}
Also used : BuildProperties(io.micronaut.starter.build.BuildProperties)

Example 2 with BuildProperties

use of io.micronaut.starter.build.BuildProperties in project micronaut-starter by micronaut-projects.

the class AbstractAzureFunction method apply.

@Override
public void apply(GeneratorContext generatorContext) {
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    ApplicationType type = generatorContext.getApplicationType();
    generatorContext.addTemplate("host.json", new URLTemplate("host.json", classLoader.getResource("functions/azure/host.json")));
    generatorContext.addTemplate("local.settings.json", new URLTemplate("local.settings.json", classLoader.getResource("functions/azure/local.settings.json")));
    BuildTool buildTool = generatorContext.getBuildTool();
    Project project = generatorContext.getProject();
    if (buildTool == BuildTool.MAVEN) {
        BuildProperties props = generatorContext.getBuildProperties();
        props.put("functionAppName", project.getName());
        props.put("functionAppRegion", "westus");
        props.put("functionResourceGroup", "java-functions-group");
        props.put("stagingDirectory", "${project.build.directory}/azure-functions/${functionAppName}");
    }
    addFunctionTemplate(generatorContext, project);
    applyFunction(generatorContext, type);
}
Also used : ApplicationType(io.micronaut.starter.application.ApplicationType) Project(io.micronaut.starter.application.Project) URLTemplate(io.micronaut.starter.template.URLTemplate) BuildProperties(io.micronaut.starter.build.BuildProperties) BuildTool(io.micronaut.starter.options.BuildTool)

Aggregations

BuildProperties (io.micronaut.starter.build.BuildProperties)2 ApplicationType (io.micronaut.starter.application.ApplicationType)1 Project (io.micronaut.starter.application.Project)1 BuildTool (io.micronaut.starter.options.BuildTool)1 URLTemplate (io.micronaut.starter.template.URLTemplate)1