Remove forge/liteloader specific repos.
Just put everything in the libraries repo.
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
import { BaseMavenRepo } from './BaseMavenRepo'
|
||||
|
||||
export class ForgeRepoStructure extends BaseMavenRepo {
|
||||
|
||||
public static readonly FORGE_GROUP = 'net.minecraftforge'
|
||||
public static readonly FORGE_ARTIFACT = 'forge'
|
||||
|
||||
constructor(
|
||||
absoluteRoot: string,
|
||||
relativeRoot: string
|
||||
) {
|
||||
super(absoluteRoot, relativeRoot, 'forge')
|
||||
}
|
||||
|
||||
public getLocalForge(version: string, classifier?: string) {
|
||||
return this.getArtifactByComponents(
|
||||
ForgeRepoStructure.FORGE_GROUP,
|
||||
ForgeRepoStructure.FORGE_ARTIFACT,
|
||||
version, classifier, 'jar')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,12 @@ export class LibRepoStructure extends BaseMavenRepo {
|
||||
public static readonly MINECRAFT_GROUP = 'net.minecraft'
|
||||
public static readonly MINECRAFT_CLIENT_ARTIFACT = 'client'
|
||||
|
||||
public static readonly FORGE_GROUP = 'net.minecraftforge'
|
||||
public static readonly FORGE_ARTIFACT = 'forge'
|
||||
|
||||
public static readonly LITELOADER_GROUP = 'com.mumfrey'
|
||||
public static readonly LITELOADER_ARTIFACT = 'liteloader'
|
||||
|
||||
constructor(
|
||||
absoluteRoot: string,
|
||||
relativeRoot: string
|
||||
@@ -12,4 +18,18 @@ export class LibRepoStructure extends BaseMavenRepo {
|
||||
super(absoluteRoot, relativeRoot, 'lib')
|
||||
}
|
||||
|
||||
public getLocalForge(version: string, classifier?: string) {
|
||||
return this.getArtifactByComponents(
|
||||
LibRepoStructure.FORGE_GROUP,
|
||||
LibRepoStructure.FORGE_ARTIFACT,
|
||||
version, classifier, 'jar')
|
||||
}
|
||||
|
||||
public getLocalLiteLoader(version: string, classifier?: string) {
|
||||
return this.getArtifactByComponents(
|
||||
LibRepoStructure.LITELOADER_GROUP,
|
||||
LibRepoStructure.LITELOADER_ARTIFACT,
|
||||
version, classifier, 'jar')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { BaseMavenRepo } from './BaseMavenRepo'
|
||||
|
||||
export class LiteLoaderRepoStructure extends BaseMavenRepo {
|
||||
|
||||
constructor(
|
||||
absoluteRoot: string,
|
||||
relativeRoot: string
|
||||
) {
|
||||
super(absoluteRoot, relativeRoot, 'liteloader')
|
||||
}
|
||||
|
||||
public getLocalLiteLoader(version: string, classifier?: string) {
|
||||
return this.getArtifactByComponents('com.mumfrey', 'liteloader', version, classifier, 'jar')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,10 @@
|
||||
import { join } from 'path'
|
||||
import { BaseFileStructure } from '../BaseFileStructure'
|
||||
import { ForgeRepoStructure } from './forgerepo.struct'
|
||||
import { LibRepoStructure } from './librepo.struct'
|
||||
import { LiteLoaderRepoStructure } from './liteloaderrepo.struct'
|
||||
import { VersionRepoStructure } from './versionrepo.struct'
|
||||
|
||||
export class RepoStructure extends BaseFileStructure {
|
||||
|
||||
private forgeRepoStruct: ForgeRepoStructure
|
||||
private liteloaderRepoStruct: LiteLoaderRepoStructure
|
||||
private libRepoStruct: LibRepoStructure
|
||||
private versionRepoStruct: VersionRepoStructure
|
||||
|
||||
@@ -17,28 +13,16 @@ export class RepoStructure extends BaseFileStructure {
|
||||
relativeRoot: string
|
||||
) {
|
||||
super(absoluteRoot, relativeRoot, 'repo')
|
||||
this.forgeRepoStruct = new ForgeRepoStructure(this.containerDirectory, this.relativeRoot)
|
||||
this.liteloaderRepoStruct = new LiteLoaderRepoStructure(this.containerDirectory, this.relativeRoot)
|
||||
this.libRepoStruct = new LibRepoStructure(this.containerDirectory, this.relativeRoot)
|
||||
this.versionRepoStruct = new VersionRepoStructure(this.containerDirectory, this.relativeRoot)
|
||||
}
|
||||
|
||||
public async init() {
|
||||
super.init()
|
||||
await this.forgeRepoStruct.init()
|
||||
await this.liteloaderRepoStruct.init()
|
||||
await this.libRepoStruct.init()
|
||||
await this.versionRepoStruct.init()
|
||||
}
|
||||
|
||||
public getForgeRepoStruct() {
|
||||
return this.forgeRepoStruct
|
||||
}
|
||||
|
||||
public getLiteLoaderRepoStruct() {
|
||||
return this.liteloaderRepoStruct
|
||||
}
|
||||
|
||||
public getLibRepoStruct() {
|
||||
return this.libRepoStruct
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import { basename, dirname, join } from 'path'
|
||||
import { VersionManifest113 } from '../../../model/forge/versionmanifest113'
|
||||
import { Module } from '../../../model/spec/module'
|
||||
import { Type } from '../../../model/spec/type'
|
||||
import { ForgeRepoStructure } from '../../../model/struct/repo/forgerepo.struct'
|
||||
import { LibRepoStructure } from '../../../model/struct/repo/librepo.struct'
|
||||
import { JavaUtil } from '../../../util/javautil'
|
||||
import { MavenUtil } from '../../../util/maven'
|
||||
@@ -36,15 +35,15 @@ export class Forge113Adapter extends ForgeResolver {
|
||||
}
|
||||
|
||||
private async process() {
|
||||
const forgeRepo = this.repoStructure.getForgeRepoStruct()
|
||||
const installerPath = forgeRepo.getLocalForge(this.artifactVersion, 'installer')
|
||||
const libRepo = this.repoStructure.getLibRepoStruct()
|
||||
const installerPath = libRepo.getLocalForge(this.artifactVersion, 'installer')
|
||||
console.debug(`Checking for forge installer at ${installerPath}..`)
|
||||
if (!await forgeRepo.artifactExists(installerPath)) {
|
||||
if (!await libRepo.artifactExists(installerPath)) {
|
||||
console.debug(`Forge installer not found locally, initializing download..`)
|
||||
await forgeRepo.downloadArtifactByComponents(
|
||||
await libRepo.downloadArtifactByComponents(
|
||||
this.REMOTE_REPOSITORY,
|
||||
ForgeRepoStructure.FORGE_GROUP,
|
||||
ForgeRepoStructure.FORGE_ARTIFACT,
|
||||
LibRepoStructure.FORGE_GROUP,
|
||||
LibRepoStructure.FORGE_ARTIFACT,
|
||||
this.artifactVersion, 'installer', 'jar'
|
||||
)
|
||||
} else {
|
||||
@@ -158,22 +157,22 @@ export class Forge113Adapter extends ForgeResolver {
|
||||
const generatedFiles = [
|
||||
{
|
||||
name: 'base jar',
|
||||
group: ForgeRepoStructure.FORGE_GROUP,
|
||||
artifact: ForgeRepoStructure.FORGE_ARTIFACT,
|
||||
group: LibRepoStructure.FORGE_GROUP,
|
||||
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
||||
version: this.artifactVersion,
|
||||
classifier: undefined
|
||||
},
|
||||
{
|
||||
name: 'universal jar',
|
||||
group: ForgeRepoStructure.FORGE_GROUP,
|
||||
artifact: ForgeRepoStructure.FORGE_ARTIFACT,
|
||||
group: LibRepoStructure.FORGE_GROUP,
|
||||
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
||||
version: this.artifactVersion,
|
||||
classifier: 'universal'
|
||||
},
|
||||
{
|
||||
name: 'client jar',
|
||||
group: ForgeRepoStructure.FORGE_GROUP,
|
||||
artifact: ForgeRepoStructure.FORGE_ARTIFACT,
|
||||
group: LibRepoStructure.FORGE_GROUP,
|
||||
artifact: LibRepoStructure.FORGE_ARTIFACT,
|
||||
version: this.artifactVersion,
|
||||
classifier: 'client'
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ import { basename, join } from 'path'
|
||||
import { VersionManifest17 } from '../../../model/forge/versionmanifest17'
|
||||
import { Module } from '../../../model/spec/module'
|
||||
import { Type } from '../../../model/spec/type'
|
||||
import { ForgeRepoStructure } from '../../../model/struct/repo/forgerepo.struct'
|
||||
import { LibRepoStructure } from '../../../model/struct/repo/librepo.struct'
|
||||
import { MavenUtil } from '../../../util/maven'
|
||||
import { PackXZExtractWrapper } from '../../../util/PackXZExtractWrapper'
|
||||
import { VersionUtil } from '../../../util/versionutil'
|
||||
@@ -36,15 +36,15 @@ export class Forge17Adapter extends ForgeResolver {
|
||||
}
|
||||
|
||||
public async getForgeByVersion() {
|
||||
const forgeRepo = this.repoStructure.getForgeRepoStruct()
|
||||
const targetLocalPath = forgeRepo.getLocalForge(this.artifactVersion, 'universal')
|
||||
const libRepo = this.repoStructure.getLibRepoStruct()
|
||||
const targetLocalPath = libRepo.getLocalForge(this.artifactVersion, 'universal')
|
||||
console.debug(`Checking for forge version at ${targetLocalPath}..`)
|
||||
if (!await forgeRepo.artifactExists(targetLocalPath)) {
|
||||
if (!await libRepo.artifactExists(targetLocalPath)) {
|
||||
console.debug(`Forge not found locally, initializing download..`)
|
||||
await forgeRepo.downloadArtifactByComponents(
|
||||
await libRepo.downloadArtifactByComponents(
|
||||
this.REMOTE_REPOSITORY,
|
||||
ForgeRepoStructure.FORGE_GROUP,
|
||||
ForgeRepoStructure.FORGE_ARTIFACT,
|
||||
LibRepoStructure.FORGE_GROUP,
|
||||
LibRepoStructure.FORGE_ARTIFACT,
|
||||
this.artifactVersion, 'universal', 'jar')
|
||||
} else {
|
||||
console.debug('Using locally discovered forge.')
|
||||
@@ -72,8 +72,8 @@ export class Forge17Adapter extends ForgeResolver {
|
||||
|
||||
const forgeModule: Module = {
|
||||
id: MavenUtil.mavenComponentsToIdentifier(
|
||||
ForgeRepoStructure.FORGE_GROUP,
|
||||
ForgeRepoStructure.FORGE_ARTIFACT,
|
||||
LibRepoStructure.FORGE_GROUP,
|
||||
LibRepoStructure.FORGE_ARTIFACT,
|
||||
this.artifactVersion, 'universal'
|
||||
),
|
||||
name: 'Minecraft Forge',
|
||||
@@ -81,10 +81,10 @@ export class Forge17Adapter extends ForgeResolver {
|
||||
artifact: this.generateArtifact(
|
||||
forgeUniversalBuffer,
|
||||
await lstat(targetLocalPath),
|
||||
forgeRepo.getArtifactUrlByComponents(
|
||||
libRepo.getArtifactUrlByComponents(
|
||||
this.baseUrl,
|
||||
ForgeRepoStructure.FORGE_GROUP,
|
||||
ForgeRepoStructure.FORGE_ARTIFACT,
|
||||
LibRepoStructure.FORGE_GROUP,
|
||||
LibRepoStructure.FORGE_ARTIFACT,
|
||||
this.artifactVersion, 'universal'
|
||||
)
|
||||
),
|
||||
@@ -100,7 +100,6 @@ export class Forge17Adapter extends ForgeResolver {
|
||||
}
|
||||
console.debug(`Processing ${lib.name}..`)
|
||||
|
||||
const libRepo = this.repoStructure.getLibRepoStruct()
|
||||
const extension = this.determineExtension(lib.checksums)
|
||||
const localPath = libRepo.getArtifactById(lib.name, extension) as string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user