Skip to content

Commit

Permalink
Merge pull request #423 from gsartori/7.0.x
Browse files Browse the repository at this point in the history
Removed gradle 'application' plugin from the application template
  • Loading branch information
jamesfredley authored Nov 9, 2024
2 parents 6528fef + 48607f9 commit a875736
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ repositories {

@dependencies.template(applicationType, project, features, gradleBuild)

@if (features.mainClass().isPresent()) {
application {
mainClass.set("@features.mainClass().get()")
}

}

@if(features.contains("geb-with-webdriver-binaries")) {
// geb-with-webdriver-binaries is limited to Gradle 8.6 with max JDK 21
compileJava.options.release = @JdkVersion.valueOf(Math.min(features.javaVersion().majorVersion(), JdkVersion.JDK_21.majorVersion())).majorVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public void apply(GeneratorContext generatorContext) {
GrailsApplicationFeature.super.apply(generatorContext);
final ApplicationType applicationType = generatorContext.getApplicationType();
if (shouldGenerateApplicationFile(applicationType, generatorContext)) {
generatorContext.addBuildPlugin(GradlePlugin.builder().id("application").build());
generatorContext.addBuildPlugin(GradlePlugin.builder().id("war").build());
generatorContext.addTemplate("application", new RockerTemplate(getPath(),
application.template(applicationType, generatorContext.getProject(), generatorContext.getFeatures())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import spock.lang.Unroll
class GrailsApplicationSpec extends BeanContextSpec implements CommandOutputFixture {

@Unroll
void 'Application file is generated for a #applicationType application type with gradle and referenced in build.gradle mainClassName for language: groovy'() {
void 'Application file is generated for a #applicationType application for language: groovy'() {
when:
def output = generate(applicationType,
new Options(TestFramework.SPOCK),
Expand All @@ -24,12 +24,6 @@ class GrailsApplicationSpec extends BeanContextSpec implements CommandOutputFixt
applicationGroovyFile.contains("@CompileStatic")
!applicationGroovyFile.contains("@PluginSource")

when:
def buildGradle = output['build.gradle']

then:
buildGradle.contains('mainClass.set("example.grails.Application")')

where:
applicationType << [ApplicationType.WEB, ApplicationType.REST_API]
}
Expand Down

0 comments on commit a875736

Please sign in to comment.