mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-21 19:22:13 -08:00
Fix issue with submodule library overrides. (#366)
This commit is contained in:
parent
03dac9ed6d
commit
9cca37ca8a
@ -839,9 +839,7 @@ class ProcessBuilder {
|
|||||||
libs[mdl.getVersionlessMavenIdentifier()] = mdl.getPath()
|
libs[mdl.getVersionlessMavenIdentifier()] = mdl.getPath()
|
||||||
if(mdl.subModules.length > 0){
|
if(mdl.subModules.length > 0){
|
||||||
const res = this._resolveModuleLibraries(mdl)
|
const res = this._resolveModuleLibraries(mdl)
|
||||||
if(res.length > 0){
|
libs = {...libs, ...res}
|
||||||
libs = {...libs, ...res}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -850,9 +848,7 @@ class ProcessBuilder {
|
|||||||
for(let i=0; i<mods.length; i++){
|
for(let i=0; i<mods.length; i++){
|
||||||
if(mods.sub_modules != null){
|
if(mods.sub_modules != null){
|
||||||
const res = this._resolveModuleLibraries(mods[i])
|
const res = this._resolveModuleLibraries(mods[i])
|
||||||
if(res.length > 0){
|
libs = {...libs, ...res}
|
||||||
libs = {...libs, ...res}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -863,27 +859,25 @@ class ProcessBuilder {
|
|||||||
* Recursively resolve the path of each library required by this module.
|
* Recursively resolve the path of each library required by this module.
|
||||||
*
|
*
|
||||||
* @param {Object} mdl A module object from the server distro index.
|
* @param {Object} mdl A module object from the server distro index.
|
||||||
* @returns {Array.<string>} An array containing the paths of each library this module requires.
|
* @returns {{[id: string]: string}} An object containing the paths of each library this server requires.
|
||||||
*/
|
*/
|
||||||
_resolveModuleLibraries(mdl){
|
_resolveModuleLibraries(mdl){
|
||||||
if(!mdl.subModules.length > 0){
|
if(!mdl.subModules.length > 0){
|
||||||
return []
|
return {}
|
||||||
}
|
}
|
||||||
let libs = []
|
let libs = {}
|
||||||
for(let sm of mdl.subModules){
|
for(let sm of mdl.subModules){
|
||||||
if(sm.rawModule.type === Type.Library){
|
if(sm.rawModule.type === Type.Library){
|
||||||
|
|
||||||
if(sm.rawModule.classpath ?? true) {
|
if(sm.rawModule.classpath ?? true) {
|
||||||
libs.push(sm.getPath())
|
libs[sm.getVersionlessMavenIdentifier()] = sm.getPath()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If this module has submodules, we need to resolve the libraries for those.
|
// If this module has submodules, we need to resolve the libraries for those.
|
||||||
// To avoid unnecessary recursive calls, base case is checked here.
|
// To avoid unnecessary recursive calls, base case is checked here.
|
||||||
if(mdl.subModules.length > 0){
|
if(mdl.subModules.length > 0){
|
||||||
const res = this._resolveModuleLibraries(sm)
|
const res = this._resolveModuleLibraries(sm)
|
||||||
if(res.length > 0){
|
libs = {...libs, ...res}
|
||||||
libs = libs.concat(res)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return libs
|
return libs
|
||||||
|
Loading…
Reference in New Issue
Block a user