mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-22 03:32:12 -08:00
Compare commits
1 Commits
d54b3c8dd6
...
c7a0c75dca
Author | SHA1 | Date | |
---|---|---|---|
|
c7a0c75dca |
@ -854,18 +854,22 @@ class ProcessBuilder {
|
||||
libs[mdl.getVersionlessMavenIdentifier()] = mdl.getPath()
|
||||
if(mdl.subModules.length > 0){
|
||||
const res = this._resolveModuleLibraries(mdl)
|
||||
if(res.length > 0){
|
||||
libs = {...libs, ...res}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check for any libraries in our mod list.
|
||||
for(let i=0; i<mods.length; i++){
|
||||
if(mods.sub_modules != null){
|
||||
const res = this._resolveModuleLibraries(mods[i])
|
||||
if(res.length > 0){
|
||||
libs = {...libs, ...res}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return libs
|
||||
}
|
||||
@ -874,25 +878,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
|
||||
|
Loading…
Reference in New Issue
Block a user