Skip to content

Commit b8f6818

Browse files
committed
Add marker interface for plugin applications
1 parent 4c33f26 commit b8f6818

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2016 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package grails.boot
17+
18+
/**
19+
* A marker interface for applications that are also plugins
20+
*
21+
* @author Graeme Rocher
22+
* @since 3.0.17
23+
*/
24+
interface GrailsPluginApplication {
25+
26+
}

grails-web-boot/src/main/groovy/org/grails/compiler/boot/BootInitializerClassInjector.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.grails.compiler.boot
22

3+
import grails.boot.GrailsPluginApplication
34
import grails.boot.config.GrailsAutoConfiguration
45
import grails.compiler.ast.AstTransformer
56
import grails.compiler.ast.GlobalClassInjectorAdapter
@@ -56,7 +57,7 @@ class BootInitializerClassInjector extends GlobalClassInjectorAdapter {
5657
// don't generate for plugins
5758
if( classNode.getNodeMetaData('isPlugin') ) return
5859

59-
if(GrailsASTUtils.isAssignableFrom(GRAILS_CONFIGURATION_CLASS_NODE, classNode)) {
60+
if(GrailsASTUtils.isAssignableFrom(GRAILS_CONFIGURATION_CLASS_NODE, classNode) && !GrailsASTUtils.isSubclassOfOrImplementsInterface(classNode, GrailsPluginApplication.name)) {
6061
def methods = classNode.getMethods("main")
6162
for(MethodNode mn in methods) {
6263
if(Modifier.isStatic(mn.modifiers) && Modifier.isPublic(mn.modifiers)) {

0 commit comments

Comments
 (0)