Skip to content

Commit

Permalink
MPL-96 Fix detection of library directory location (#95)
Browse files Browse the repository at this point in the history
Co-authored-by: Ruslan Yemelianov <[email protected]>
  • Loading branch information
Ruslan and Ruslan Yemelianov authored Feb 18, 2022
1 parent fc891f7 commit e178012
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/com/griddynamics/devops/mpl/Helper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,16 @@ abstract class Helper {
def modules = []
def libs = new FilePath(executable.getRootDir()).child('libs')
action.getLibraries().each { lib ->
def libDir
// TODO: backward compatibility SECURITY-2422, should be removed in future to use only "getDirectoryName() method"
// https://github.com/jenkinsci/workflow-cps-global-lib-plugin/commit/ace0de3c2d691662021ea10306eeb407da6b6365
try {
libDir = lib.getDirectoryName()
} catch(NoSuchMethodError) {
libDir = lib.name
}
MPLManager.instance.getModulesLoadPaths().each { modulesPath ->
def libPath = Paths.get(lib.name, 'resources', modulesPath, path).toString()
def libPath = Paths.get(libDir, 'resources', modulesPath, path).toString()
def f = libs.child(libPath)
if( f.exists() ) modules += [[libPath, f.readToString()]]
}
Expand Down

2 comments on commit e178012

@teosoft123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @emelianrus, thank you and Sergey for your work on this library. We use it and like it.
Unfortunately, your commit broke something. Not a first time. Is 22.02 an actual tag or just a tip of the master branch? If the release is not pinned to a commit, it's not really a release...

Thank you,
Oleg

@teosoft123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emelianrus it was actually on our side, please disregard my previous message.
Thanks again for your work!

Please sign in to comment.