|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + */ |
| 19 | +package org.grails.forge.feature.micronaut; |
| 20 | + |
| 21 | +import io.micronaut.core.annotation.NonNull; |
| 22 | +import jakarta.inject.Singleton; |
| 23 | +import org.grails.forge.application.ApplicationType; |
| 24 | +import org.grails.forge.application.generator.GeneratorContext; |
| 25 | +import org.grails.forge.build.dependencies.Dependency; |
| 26 | +import org.grails.forge.feature.Category; |
| 27 | +import org.grails.forge.feature.Feature; |
| 28 | + |
| 29 | +@Singleton |
| 30 | +public class GrailsMicronaut implements Feature { |
| 31 | + |
| 32 | + @Override |
| 33 | + @NonNull |
| 34 | + public String getName() { |
| 35 | + return "grails-micronaut"; |
| 36 | + } |
| 37 | + |
| 38 | + @Override |
| 39 | + public String getTitle() { |
| 40 | + return "Micronaut Support"; |
| 41 | + } |
| 42 | + |
| 43 | + @Override |
| 44 | + public String getDescription() { |
| 45 | + return "Adds support for Micronaut to Grails using the Spring Starter"; |
| 46 | + } |
| 47 | + |
| 48 | + @Override |
| 49 | + public boolean supports(ApplicationType applicationType) { |
| 50 | + return true; |
| 51 | + } |
| 52 | + |
| 53 | + @Override |
| 54 | + public String getCategory() { |
| 55 | + return Category.SPRING; |
| 56 | + } |
| 57 | + |
| 58 | + @Override |
| 59 | + public String getDocumentation() { |
| 60 | + return "https://micronaut-projects.github.io/micronaut-spring/latest/guide/#springBootStarter"; |
| 61 | + } |
| 62 | + |
| 63 | + @Override |
| 64 | + public void apply(GeneratorContext generatorContext) { |
| 65 | + generatorContext.addDependency(Dependency.builder() |
| 66 | + .groupId("org.apache.grails") |
| 67 | + .artifactId("grails-micronaut") |
| 68 | + .implementation()); |
| 69 | + |
| 70 | + generatorContext.getBuildProperties().put("micronautPlatformVersion", "4.9.2"); |
| 71 | + } |
| 72 | +} |
0 commit comments