Add dependencies through an extra mod directory

This commit is contained in:
LLytho 2022-07-29 22:45:44 +02:00
parent d7aedd587b
commit 1419c26bca
5 changed files with 33 additions and 14 deletions

1
.gitignore vendored
View file

@ -19,6 +19,7 @@ build
.gradle
# other
extra-mods-*
*.log
*.log.gz
eclipse

View file

@ -40,6 +40,18 @@ dependencies {
include("com.electronwill.night-config:core:3.6.4");
include("com.electronwill.night-config:toml:3.6.4");
fileTree("extra-mods-$minecraftVersion") { include("**/*.jar") }
.forEach { f ->
val sepIndex = f.nameWithoutExtension.lastIndexOf('-');
if(sepIndex == -1) {
throw IllegalArgumentException("Invalid mod name: ${f.nameWithoutExtension}")
}
val mod = f.nameWithoutExtension.substring(0, sepIndex);
val version = f.nameWithoutExtension.substring(sepIndex + 1);
println("Extra mod $mod with version $version detected")
modLocalRuntime("extra-mods:$mod:$version")
}
implementation(project(":Common"))
}

View file

@ -71,16 +71,17 @@ dependencies {
compileOnly(fg.deobf("mezz.jei:jei-${minecraftVersion}:${jeiVersion}:api"))
runtimeOnly(fg.deobf("mezz.jei:jei-${minecraftVersion}:${jeiVersion}"))
// used for testing only
runtimeOnly(fg.deobf("curse.maven:JAOPCA-266936:3802370"))
runtimeOnly(fg.deobf("curse.maven:IE-231951:3755665"))
runtimeOnly(fg.deobf("curse.maven:cofh-69162:3803484"))
runtimeOnly(fg.deobf("curse.maven:thermalfoundation-222880:3803495"))
runtimeOnly(fg.deobf("curse.maven:thermalexp-69163:3803489"))
runtimeOnly(fg.deobf("curse.maven:mekanism-268560:3810540"))
runtimeOnly(fg.deobf("curse.maven:nihilo-400012:3810814"))
runtimeOnly(fg.deobf("curse.maven:industrialforegoing-266515:3848558"))
runtimeOnly(fg.deobf("curse.maven:titanium-287342:3819942")) // for industrialforegoing
fileTree("extra-mods-$minecraftVersion") { include("**/*.jar") }
.forEach { f ->
val sepIndex = f.nameWithoutExtension.lastIndexOf('-');
if(sepIndex == -1) {
throw IllegalArgumentException("Invalid mod name: ${f.nameWithoutExtension}")
}
val mod = f.nameWithoutExtension.substring(0, sepIndex);
val version = f.nameWithoutExtension.substring(sepIndex + 1);
println("Extra mod $mod with version $version detected")
runtimeOnly(fg.deobf("extra-mods:$mod:$version"))
}
annotationProcessor("org.spongepowered:mixin:${mixinVersion}:processor")

View file

@ -18,6 +18,10 @@ plugins {
allprojects {
repositories {
flatDir {
name = "extra-mods"
dir(file("extra-mods-$minecraftVersion"))
}
mavenLocal()
mavenCentral()
maven("https://repo.spongepowered.org/repository/maven-public/")

View file

@ -16,6 +16,7 @@ fabricVersion = 0.55.1+1.18.2
fabricLoaderVersion = 0.14.5
# Dependencies
extraModsDirectory = extra-mods
reiVersion = 8.1.457
jeiVersion = 9+