Use classpath flag instead of hardcode.

This commit is contained in:
Daniel Scalzi 2022-11-26 18:54:09 -05:00
parent 4636f7200c
commit a6e3d2b85c
No known key found for this signature in database
GPG Key ID: 9E3E2AFE45328AA5
3 changed files with 13 additions and 11 deletions

View File

@ -5,7 +5,7 @@
}, },
"extends": "eslint:recommended", "extends": "eslint:recommended",
"parserOptions": { "parserOptions": {
"ecmaVersion": 2019, "ecmaVersion": 2021,
"sourceType": "module" "sourceType": "module"
}, },
"rules": { "rules": {

View File

@ -118,7 +118,7 @@ class Module {
* @returns {Module} The parsed Module. * @returns {Module} The parsed Module.
*/ */
static fromJSON(json, serverid){ static fromJSON(json, serverid){
return new Module(json.id, json.name, json.type, json.required, json.artifact, json.subModules, serverid) return new Module(json.id, json.name, json.type, json.classpath, json.required, json.artifact, json.subModules, serverid)
} }
/** /**
@ -143,9 +143,10 @@ class Module {
} }
} }
constructor(id, name, type, required, artifact, subModules, serverid) { constructor(id, name, type, classpath, required, artifact, subModules, serverid) {
this.identifier = id this.identifier = id
this.type = type this.type = type
this.classpath = classpath
this._resolveMetaData() this._resolveMetaData()
this.name = name this.name = name
this.required = Required.fromJSON(required) this.required = Required.fromJSON(required)
@ -306,6 +307,13 @@ class Module {
return this.type return this.type
} }
/**
* @returns {boolean} Whether or not this library should be on the classpath.
*/
getClasspath(){
return this.classpath ?? true
}
} }
exports.Module exports.Module

View File

@ -816,15 +816,9 @@ class ProcessBuilder {
for(let sm of mdl.getSubModules()){ for(let sm of mdl.getSubModules()){
if(sm.getType() === DistroManager.Types.Library){ if(sm.getType() === DistroManager.Types.Library){
// TODO Add as file or something. if(sm.getClasspath()) {
const x = sm.getIdentifier() libs.push(sm.getArtifact().getPath())
console.log(x)
if(x.includes(':universal') || x.includes(':slim') || x.includes(':extra') || x.includes(':srg') || x.includes(':client')) {
console.log('SKIPPING ' + x)
continue
} }
libs.push(sm.getArtifact().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.