Skip to content

Commit eb83c51

Browse files
committed
Create exploded configuration for plugins always. Support exploded project property for plugins to allow the exploded artifacts to be added to the classpath. Fixes #11045
1 parent 579cc67 commit eb83c51

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsPluginGradlePlugin.groovy

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ class GrailsPluginGradlePlugin extends GrailsGradlePlugin {
8787
def allConfigurations = project.configurations
8888

8989
def runtimeConfiguration = allConfigurations.findByName('runtime')
90+
def explodedConfig = allConfigurations.create('exploded')
91+
explodedConfig.extendsFrom(runtimeConfiguration)
9092
if(Environment.isDevelopmentRun() && isExploded(project)) {
91-
def explodedConfig = allConfigurations.create('exploded')
9293
runtimeConfiguration.artifacts.clear()
93-
explodedConfig.extendsFrom(runtimeConfiguration)
9494
// add the subproject classes as outputs
9595
def allTasks = project.tasks
9696

@@ -103,22 +103,7 @@ class GrailsPluginGradlePlugin extends GrailsGradlePlugin {
103103
}
104104

105105
private boolean isExploded(Project project) {
106-
if (project.parent != null) {
107-
for (Project child: project.parent.childProjects.values()) {
108-
if (child != project) {
109-
try {
110-
Configuration compile = child.configurations.getByName("compile")
111-
Dependency dependency = compile.dependencies.find { it.name == project.name }
112-
if (dependency && dependency.targetConfiguration == "exploded") {
113-
return true
114-
}
115-
} catch (UnknownConfigurationException | MissingPropertyException e) {
116-
//swallow
117-
}
118-
}
119-
}
120-
}
121-
return false
106+
Boolean.valueOf(project.properties.getOrDefault('exploded', 'false').toString())
122107
}
123108

124109
@Override

0 commit comments

Comments
 (0)