@@ -202,25 +202,16 @@ move it to the new location of '${basedir}/test/integration'. Please move the di
202
202
}
203
203
updateMetadata(metadata, newMetadata)
204
204
205
- // proceed plugin-specific upgrade logic contained in 'scripts/_Upgrade.groovy' under plugin's root
206
- def plugins = pluginSettings. pluginBaseDirectories
207
- if (plugins) {
208
- for (pluginDir in plugins) {
209
- def f = new File (pluginDir)
210
- if (f. isDirectory() && f. name != ' core' ) {
211
- // fix for Windows-style path with backslashes
212
-
213
- def pluginBase = " ${ basedir} /plugins/${ f.name} " . toString(). replaceAll(" \\\\ " , " /" )
214
- // proceed _Upgrade.groovy plugin script if exists
215
- def upgradeScript = new File (" ${ pluginBase} /scripts/_Upgrade.groovy" )
216
- if (upgradeScript. exists()) {
217
- event(" StatusUpdate" , [" Executing ${ f.name} plugin upgrade script" ])
218
- // instrumenting plugin scripts adding 'pluginBasedir' variable
219
- def instrumentedUpgradeScript = " def pluginBasedir = '${ pluginBase} '\n " + upgradeScript. text
220
- // we are using text form of script here to prevent Gant caching
221
- includeTargets << instrumentedUpgradeScript
222
- }
223
- }
205
+ // proceed with plugin-specific upgrade logic contained in 'scripts/_Upgrade.groovy' under every plugin's root
206
+ def pluginDirs = pluginSettings. getPluginDirectories()
207
+ for (pluginDir in pluginDirs) {
208
+ def upgradeScript = new File (pluginDir. getFile(), " scripts/_Upgrade.groovy" )
209
+ if (upgradeScript. exists()) {
210
+ event(" StatusUpdate" , [" Executing ${ pluginDir.getFilename()} plugin upgrade script" ])
211
+ // instrumenting plugin scripts adding 'pluginBasedir' variable
212
+ def instrumentedUpgradeScript = " def pluginDir = '${ pluginDir} '\n " + upgradeScript. text
213
+ // we are using text form of script here to prevent Gant caching
214
+ includeTargets << instrumentedUpgradeScript
224
215
}
225
216
}
226
217
0 commit comments