Skip to content

Commit

Permalink
use moddevgradle
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Jul 18, 2024
1 parent 49ba320 commit 521d22f
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions platform/neo/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
plugins {
id("net.neoforged.gradle.userdev") version "7.0.142"
id("net.neoforged.moddev") version "1.0.13"
}

setupPlatform()
setupPlatform(setRuntimeClasspath = false)

dependencies {
implementation("net.neoforged:neoforge:${rootProp["neo"]}")
implementation("lol.bai:badpackets:neo-${rootProp["badpackets"]}")

rootProp["jei"].split("-").also { (mc, jei) ->
Expand All @@ -15,25 +14,29 @@ dependencies {

setupStub()

sourceSets {
val main by getting
neoForge {
version = rootProp["neo"]

val dummy by creating {
compileClasspath += main.compileClasspath
}
}
runs {
create("server") { server() }
create("client") {
client()
programArguments.addAll("--username", "A")
}

runs {
named("client") {
programArguments("--username", "A")
configureEach {
gameDirectory = file("run/${namer.determineName(this)}")
}
}

configureEach {
workingDirectory(file("run/${namer.determineName(this)}"))
mods {
create("wthit") {
sourceSet(sourceSets["main"])
sourceSet(sourceSets["plugin"])

modSource(sourceSets["main"])
modSource(sourceSets["plugin"])
modSource(sourceSets["dummy"])
val excluded = setOf("test")
rootProject.sourceSets.filterNot { excluded.contains(it.name) }.forEach { sourceSet(it) }
}
}
}

Expand All @@ -45,14 +48,6 @@ tasks.processResources {
}
}

tasks.named<JavaCompile>("compileDummyJava") {
dependsOn(":generateTranslationClass")

rootProject.sourceSets.filterNot { it.name == "test" }.forEach {
source(it.allJava)
}
}

afterEvaluate {
val jar = tasks.jar.get()
val apiJar = task<ApiJarTask>("apiJar") {
Expand Down

0 comments on commit 521d22f

Please sign in to comment.