Always tag client jar with forge artifact version.

This allows multiple versions of the same forge to be used.
Ex. Recommended 1.15 on prod, latest 1.15 on test.
Also fixed a bug with artifact classifier formatting.
This commit is contained in:
Daniel Scalzi
2020-01-19 12:36:06 -05:00
parent b5e2b3db1c
commit 2b0ba5ac07
2 changed files with 8 additions and 4 deletions

View File

@@ -212,11 +212,15 @@ export class Forge113Adapter extends ForgeResolver {
const exists = await pathExists(targetLocalPath)
if (exists) {
// Always tag destination with artifact version.
// Allows different versions of forge to be installed at once.
// Ex. Recommended 1.15 on prod, latest 1.15 on test.
mdls.push({
id: MavenUtil.mavenComponentsToIdentifier(
entry.group,
entry.artifact,
entry.version,
this.artifactVersion,
entry.classifier
),
name: `Minecraft Forge (${entry.name})`,
@@ -228,7 +232,7 @@ export class Forge113Adapter extends ForgeResolver {
this.baseUrl,
entry.group,
entry.artifact,
entry.version,
entry.version, // work dir version
entry.classifier
)
),
@@ -238,7 +242,7 @@ export class Forge113Adapter extends ForgeResolver {
const destination = this.repoStructure.getLibRepoStruct().getArtifactByComponents(
entry.group,
entry.artifact,
entry.version,
this.artifactVersion,
entry.classifier
)

View File

@@ -8,7 +8,7 @@ export class MavenUtil {
public static mavenComponentsToIdentifier(group: string, artifact: string, version: string,
classifier?: string, extension?: string) {
return `${group}:${artifact}:${version}${classifier != null ? `-${classifier}` : ''}${extension != null ? `@${extension}` : ''}`
return `${group}:${artifact}:${version}${classifier != null ? `:${classifier}` : ''}${extension != null ? `@${extension}` : ''}`
}
public static isMavenIdentifier(id: string): boolean {