Skip to content

Commit

Permalink
Register GrailsExtension in GroovyPagePlugin
Browse files Browse the repository at this point in the history
Closes gh-767
  • Loading branch information
rainboyan committed Nov 28, 2024
1 parent ebbfba7 commit fa11f64
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,8 +42,9 @@ class GroovyPagePlugin implements Plugin<Project> {
@CompileDynamic
@Override
void apply(Project project) {
project.configurations.create('gspCompile')
registerGrailsExtension(project)

project.configurations.create('gspCompile')
project.dependencies.add('gspCompile', 'jakarta.servlet:jakarta.servlet-api:6.0.0')

SourceSet mainSourceSet = SourceSets.findMainSourceSet(project)
Expand Down Expand Up @@ -125,6 +126,12 @@ class GroovyPagePlugin implements Plugin<Project> {
}
}

protected GrailsExtension registerGrailsExtension(Project project) {
if (project.extensions.findByName('grails') == null) {
project.extensions.add('grails', new GrailsExtension(project))
}
}

protected FileCollection resolveClassesDirs(SourceSetOutput output, Project project) {
output?.classesDirs ?: project.files(new File(project.buildDir, 'classes/main'))
}
Expand Down

0 comments on commit fa11f64

Please sign in to comment.