First pass at Claritas implementation.
The resolution logic was reworked so that Claritas only needs to be invoked once per supported type, ie only once for ForgeMod and LiteMod resolutions per server. The resolver now uses identifies module candidates and collects them. Claritas is invoked and the resulting metadata is stored. The module resolution then proceeds with all of this data available. Toggleable module logic was also reworked to first accumulate all candidates and then process. This required the resolution function to optionally take a preprocess and postprocess callback to perform the necessary cleanup and transformations. The minor rework was necessary because spawning child process is expensive, and we should only do it as often as we must to keep the application performant. Claritas resolution also supports exceptions defined by the structure class. This is to facilitate handling of special cases (ex. Optifine).
This commit is contained in:
@@ -5,7 +5,7 @@ import { basename, join } from 'path'
|
||||
import { VersionManifestFG2 } from '../../../model/forge/VersionManifestFG2'
|
||||
import { LibRepoStructure } from '../../../model/struct/repo/librepo.struct'
|
||||
import { MavenUtil } from '../../../util/maven'
|
||||
import { PackXZExtractWrapper } from '../../../util/PackXZExtractWrapper'
|
||||
import { PackXZExtractWrapper } from '../../../util/java/PackXZExtractWrapper'
|
||||
import { VersionUtil } from '../../../util/versionutil'
|
||||
import { ForgeResolver } from '../forge.resolver'
|
||||
import { MinecraftVersion } from '../../../util/MinecraftVersion'
|
||||
@@ -227,7 +227,8 @@ export class ForgeGradle2Adapter extends ForgeResolver {
|
||||
}
|
||||
|
||||
ForgeGradle2Adapter.logger.debug('Spawning PackXZExtract.')
|
||||
await PackXZExtractWrapper.extractUnpack(files)
|
||||
const packXZExecutor = new PackXZExtractWrapper()
|
||||
await packXZExecutor.extractUnpack(files)
|
||||
ForgeGradle2Adapter.logger.debug('All files extracted, calculating hashes..')
|
||||
|
||||
for (const entry of processingQueue) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { LibRepoStructure } from '../../../model/struct/repo/librepo.struct'
|
||||
import { pathExists, remove, mkdirs, copy, writeFile, readFile, lstat, move, writeJson } from 'fs-extra'
|
||||
import { join, basename, dirname } from 'path'
|
||||
import { spawn } from 'child_process'
|
||||
import { JavaUtil } from '../../../util/javautil'
|
||||
import { JavaUtil } from '../../../util/java/javautil'
|
||||
import { VersionManifestFG3 } from '../../../model/forge/VersionManifestFG3'
|
||||
import { MavenUtil } from '../../../util/maven'
|
||||
import { createHash } from 'crypto'
|
||||
|
||||
Reference in New Issue
Block a user