Skip to content

Commit

Permalink
Fix setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Dec 4, 2024
1 parent 884f074 commit ef68001
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
19 changes: 14 additions & 5 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ base {
}

neoForge {
neoFormVersion = "1.21.4-20241203.161809"

neoFormVersion = "${neoform_version}"
// Automatically enable AccessTransformers if the file exists
// While this location can be changed, it is recommended for
// common and neoforge to share an accesstransformer file
// and this location is hardcoded in FML
// https://github.com/neoforged/FancyModLoader/blob/a952595eaaddd571fbc53f43847680b00894e0c1/loader/src/main/java/net/neoforged/fml/loading/moddiscovery/ModFile.java#L118
def at = file('src/main/resources/META-INF/accesstransformer.cfg')
if (at.exists()) {
accessTransformers.add(at.absolutePath)
}
addModdingDependenciesTo(sourceSets["test"])
parchment {
minecraftVersion = "${parchment_minecraft_version}"
mappingsVersion = "${parchment_mapping_version}"
Expand All @@ -20,9 +29,9 @@ neoForge {

dependencies {
compileOnly "net.fabricmc:sponge-mixin:${mixin_version}"
annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}")
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
// fabric and neoforge both bundle mixinextras, so it is safe to use it in common
compileOnly group: 'io.github.llamalad7', name: 'mixinextras-common', version: "${mixinextras_version}"
annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: "${mixinextras_version}"
}

publishing {
Expand Down
1 change: 1 addition & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ repositories {
includeGroup "com.terraformersmc"
}
}
mavenLocal()
}

dependencies {
Expand Down
15 changes: 15 additions & 0 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) {
minecraft.accessTransformers.file file('src/main/resources/META-INF/accesstransformer.cfg')
}

configurations {
testmodImplementation.extendsFrom implementation
}
neoForge {
version = "${neo_version}"

Expand All @@ -24,6 +27,13 @@ neoForge {
mappingsVersion = "${parchment_mapping_version}"
}

// Automatically enable neoforge AccessTransformers if the file exists
def at = project(':common').file('src/main/resources/META-INF/accesstransformer.cfg')
if (at.exists()) {
accessTransformers.add(at.absolutePath)
}
addModdingDependenciesTo(sourceSets["test"])

runs {
configureEach {
gameDirectory = project.file('../run')
Expand All @@ -46,6 +56,7 @@ neoForge {
mods {
"${mod_id}" {
sourceSet sourceSets.main
sourceSet sourceSets.test
}
}
}
Expand Down Expand Up @@ -74,6 +85,10 @@ tasks.withType(ProcessResources).matching(notNeoTask).configureEach {
from project(":common").sourceSets.main.resources
}

//tasks.named("compileTestJava").configure {
// enabled = false
//}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down

0 comments on commit ef68001

Please sign in to comment.