Skip to content

Commit

Permalink
testign stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Jul 8, 2024
1 parent d08b2f2 commit c8e63a7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 30 deletions.
68 changes: 39 additions & 29 deletions neoforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import groovy.lang.Closure
plugins {
id("idea")
id("maven-publish")
id("net.neoforged.moddev") version "0.1.110"
id("net.neoforged.moddev") version "0.1.126"
id("java-library")
}

Expand All @@ -30,6 +30,10 @@ sourceSets {
}
}

val serviceClasspath by configurations.creating {
isCanBeConsumed = false
}

repositories {
maven {
url = uri("https://maven.pkg.github.com/ims212/Forge_Fabric_API")
Expand All @@ -54,42 +58,60 @@ repositories {
}
}

val fullJar: Jar by tasks.creating(Jar::class) {
dependsOn(tasks.jar)
val serviceJar: Jar by tasks.creating(Jar::class) {
from(sourceSets.getByName("service").output)
from(project(":common").sourceSets.getByName("desktop").output)
from(project(":common").sourceSets.getByName("workarounds").output)

into("META-INF/jarjar/") {
from(tasks.jar.get().archiveFile)
}

into("META-INF") {
from(projectDir.resolve("src").resolve("main").resolve("resources").resolve("sodium-icon.png"))

from(projectDir.resolve("src").resolve("main").resolve("resources").resolve("META-INF").resolve("neoforge.mods.toml"))
}

from(rootDir.resolve("LICENSE.md"))
manifest.attributes["FMLModType"] = "LIBRARY"
archiveClassifier = "service"
}

filesMatching("neoforge.mods.toml") {
expand(mapOf("version" to MOD_VERSION))
}
configurations {
create("serviceConfig") {
isCanBeConsumed = true
isCanBeResolved = false
outgoing {
artifact((tasks.getByName("serviceJar") as Jar).archiveFile.get().asFile) {

manifest.attributes["Main-Class"] = "net.caffeinemc.mods.sodium.desktop.LaunchWarn"
manifest.attributes["FMLModType"] = "LIBRARY"
}
}
}
}

artifacts {
add("serviceConfig", serviceJar) {
name = "sodium-service"
builtBy(tasks.getByName("serviceJar"))
}
}

tasks.build {
dependsOn.clear()
dependsOn(fullJar)
}

tasks.jar {

from(project(":common").sourceSets.getByName("desktop").output)
from(rootDir.resolve("LICENSE.md"))
//into("META-INF/jarjar/") {
// from((tasks.getByName("serviceJar") as Jar).archiveFile)
//}

filesMatching("neoforge.mods.toml") {
expand(mapOf("version" to MOD_VERSION))
}

archiveClassifier = "modonly"
dependencies {
jarJar(project(":neoforge", "serviceConfig")) {
setGroup("")
}
}
manifest.attributes["Main-Class"] = "net.caffeinemc.mods.sodium.desktop.LaunchWarn"
}

neoForge {
Expand All @@ -103,8 +125,6 @@ neoForge {

runs {
create("client") {
additionalRuntimeClasspath.add("com.lodborg:interval-tree:1.0.0")
additionalRuntimeClasspath.add(rootProject.project(":common").sourceSets.getByName("workarounds").output)
client()
}
}
Expand All @@ -116,8 +136,6 @@ neoForge {
}
}

val localRuntime = configurations.create("localRuntime")

fun includeDep(dependency : String, closure : Action<ExternalModuleDependency>) {
dependencies.implementation(dependency, closure)
dependencies.jarJar(dependency, closure)
Expand All @@ -139,14 +157,6 @@ dependencies {
includeDep("org.sinytra.forgified-fabric-api:fabric-block-view-api-v2:1.0.10+9afaaf8cd1")
}

// Sets up a dependency configuration called 'localRuntime'.
// This configuration should be used instead of 'runtimeOnly' to declare
// a dependency that will be present for runtime testing but that is
// "optional", meaning it will not be pulled by dependents of this mod.
configurations {
runtimeClasspath.get().extendsFrom(localRuntime)
}

// NeoGradle compiles the game, but we don't want to add our common code to the game's code
val notNeoTask: (Task) -> Boolean = { it: Task -> !it.name.startsWith("neo") && !it.name.startsWith("compileService") }

Expand Down

This file was deleted.

0 comments on commit c8e63a7

Please sign in to comment.