Compare commits

..

No commits in common. "6aaeeff9a4c8a0560a67c832e64de578e1877bfd" and "03dac9ed6d9ea69afd7d214cacb60c940fc82553" have entirely different histories.

View File

@ -839,7 +839,9 @@ class ProcessBuilder {
libs[mdl.getVersionlessMavenIdentifier()] = mdl.getPath()
if(mdl.subModules.length > 0){
const res = this._resolveModuleLibraries(mdl)
libs = {...libs, ...res}
if(res.length > 0){
libs = {...libs, ...res}
}
}
}
}
@ -848,7 +850,9 @@ class ProcessBuilder {
for(let i=0; i<mods.length; i++){
if(mods.sub_modules != null){
const res = this._resolveModuleLibraries(mods[i])
libs = {...libs, ...res}
if(res.length > 0){
libs = {...libs, ...res}
}
}
}
@ -859,25 +863,27 @@ class ProcessBuilder {
* Recursively resolve the path of each library required by this module.
*
* @param {Object} mdl A module object from the server distro index.
* @returns {{[id: string]: string}} An object containing the paths of each library this module requires.
* @returns {Array.<string>} An array containing the paths of each library this module requires.
*/
_resolveModuleLibraries(mdl){
if(!mdl.subModules.length > 0){
return {}
return []
}
let libs = {}
let libs = []
for(let sm of mdl.subModules){
if(sm.rawModule.type === Type.Library){
if(sm.rawModule.classpath ?? true) {
libs[sm.getVersionlessMavenIdentifier()] = sm.getPath()
libs.push(sm.getPath())
}
}
// If this module has submodules, we need to resolve the libraries for those.
// To avoid unnecessary recursive calls, base case is checked here.
if(mdl.subModules.length > 0){
const res = this._resolveModuleLibraries(sm)
libs = {...libs, ...res}
if(res.length > 0){
libs = libs.concat(res)
}
}
}
return libs