Skip to content

Commit cc1af62

Browse files
committed
fix for GRAILS-6330 "implicit grails package-plugin fails after upgrade from 1.2.1 to 1.3.1"
1 parent 1d385aa commit cc1af62

File tree

1 file changed

+41
-39
lines changed

1 file changed

+41
-39
lines changed

scripts/_PluginDependencies.groovy

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -163,59 +163,61 @@ generatePluginXml = { File descriptor, boolean compilePlugin = true ->
163163

164164
pluginGrailsVersion = "${GrailsUtil.grailsVersion} > *"
165165
def pluginProps = compilePlugin ? plugin.properties : pluginSettings.getPluginInfo(pluginBaseDir.absolutePath)
166-
if (pluginProps["grailsVersion"]) {
167-
pluginGrailsVersion = pluginProps["grailsVersion"]
168-
}
169-
170-
xml.plugin(name:"${pluginName}",version:"${pluginProps.version}", grailsVersion:pluginGrailsVersion) {
171-
for (p in props) {
172-
if (pluginProps[p]) "${p}"(pluginProps[p])
166+
if(pluginProps != null) {
167+
if (pluginProps["grailsVersion"]) {
168+
pluginGrailsVersion = pluginProps["grailsVersion"]
173169
}
174-
xml.resources {
175-
for (r in resourceList) {
176-
def matcher = r.URL.toString() =~ artefactPattern
177-
def name = matcher[0][1].replaceAll('/', /\./)
178-
xml.resource(name)
170+
171+
xml.plugin(name:"${pluginName}",version:"${pluginProps.version}", grailsVersion:pluginGrailsVersion) {
172+
for (p in props) {
173+
if (pluginProps[p]) "${p}"(pluginProps[p])
179174
}
180-
}
181-
dependencies {
182-
if (pluginProps["dependsOn"]) {
183-
for (d in pluginProps.dependsOn) {
184-
delegate.plugin(name:d.key, version:d.value)
175+
xml.resources {
176+
for (r in resourceList) {
177+
def matcher = r.URL.toString() =~ artefactPattern
178+
def name = matcher[0][1].replaceAll('/', /\./)
179+
xml.resource(name)
180+
}
181+
}
182+
dependencies {
183+
if (pluginProps["dependsOn"]) {
184+
for (d in pluginProps.dependsOn) {
185+
delegate.plugin(name:d.key, version:d.value)
186+
}
185187
}
186188
}
187-
}
188189

189-
def docContext = DocumentationContext.instance
190-
if (docContext) {
191-
behavior {
192-
for (DocumentedMethod m in docContext.methods) {
193-
method(name:m.name, artefact:m.artefact, type:m.type?.name) {
194-
description m.text
195-
if (m.arguments) {
196-
for (arg in m.arguments) {
197-
argument type:arg.name
190+
def docContext = DocumentationContext.instance
191+
if (docContext) {
192+
behavior {
193+
for (DocumentedMethod m in docContext.methods) {
194+
method(name:m.name, artefact:m.artefact, type:m.type?.name) {
195+
description m.text
196+
if (m.arguments) {
197+
for (arg in m.arguments) {
198+
argument type:arg.name
199+
}
198200
}
199201
}
200202
}
201-
}
202-
for (DocumentedMethod m in docContext.staticMethods) {
203-
'static-method'(name:m.name, artefact:m.artefact, type:m.type?.name) {
204-
description m.text
205-
if (m.arguments) {
206-
for (arg in m.arguments) {
207-
argument type:arg.name
203+
for (DocumentedMethod m in docContext.staticMethods) {
204+
'static-method'(name:m.name, artefact:m.artefact, type:m.type?.name) {
205+
description m.text
206+
if (m.arguments) {
207+
for (arg in m.arguments) {
208+
argument type:arg.name
209+
}
208210
}
209211
}
210212
}
211-
}
212-
for (DocumentedProperty p in docContext.properties) {
213-
property(name:p.name, type:p?.type?.name, artefact:p.artefact) {
214-
description p.text
213+
for (DocumentedProperty p in docContext.properties) {
214+
property(name:p.name, type:p?.type?.name, artefact:p.artefact) {
215+
description p.text
216+
}
215217
}
216218
}
217219
}
218-
}
220+
}
219221
}
220222

221223
return plugin

0 commit comments

Comments
 (0)