diff options
author | Roman / Linnea Gräf <roman.graef@gmail.com> | 2022-09-01 17:15:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 17:15:51 +0200 |
commit | 43aa4ae5059012171372cb182c46bf95905e811e (patch) | |
tree | 73709c1472e21981efadd00c73f30936cee0ef97 /build.gradle.kts | |
parent | ce85f467928e085d4756c04cdf60b6a330b756e3 (diff) | |
download | NotEnoughUpdates-43aa4ae5059012171372cb182c46bf95905e811e.tar.gz NotEnoughUpdates-43aa4ae5059012171372cb182c46bf95905e811e.tar.bz2 NotEnoughUpdates-43aa4ae5059012171372cb182c46bf95905e811e.zip |
Warn on invalid forge configs (and crash on 1.19 cause java is a bitch and i dont want to write a custom tweaker to load jar in jars, even tho i totally could, it would just not be very practical) (#236)
* warning
* Also warn on fabric
* also work on forge
* Fix grammar issue
Diffstat (limited to 'build.gradle.kts')
-rw-r--r-- | build.gradle.kts | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 1e0f4873..409a8d51 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,11 @@ * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. */ + +import net.fabricmc.loom.task.RemapJarTask import java.io.ByteArrayOutputStream +import java.nio.file.FileSystems +import java.nio.file.Files import java.nio.charset.StandardCharsets import java.util.* @@ -98,15 +102,20 @@ repositories { maven("https://jitpack.io") } +val shadowImplementation by configurations.creating { + configurations.implementation.get().extendsFrom(this) +} + dependencies { minecraft("com.mojang:minecraft:1.8.9") mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") - implementation("org.spongepowered:mixin:0.7.11-SNAPSHOT") + shadowImplementation("org.spongepowered:mixin:0.7.11-SNAPSHOT") { + isTransitive = false // Dependencies of mixin are already bundled by minecraft + } annotationProcessor("org.spongepowered:mixin:0.8.4-SNAPSHOT") - implementation("com.fasterxml.jackson.core:jackson-core:2.13.1") - implementation("info.bliki.wiki:bliki-core:3.1.0") + shadowImplementation("info.bliki.wiki:bliki-core:3.1.0") testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") testAnnotationProcessor("org.spongepowered:mixin:0.8.4-SNAPSHOT") // modImplementation("io.github.notenoughupdates:MoulConfig:0.0.1") @@ -138,6 +147,7 @@ tasks.withType(Jar::class) { this["MixinConfigs"] = "mixins.notenoughupdates.json" this["FMLCorePluginContainsFMLMod"] = "true" this["ForceLoadAsMod"] = "true" + this["Manifest-Version"] = "1.0" } } @@ -145,41 +155,26 @@ val remapJar by tasks.named<net.fabricmc.loom.task.RemapJarTask>("remapJar") { archiveClassifier.set("dep") from(tasks.shadowJar) input.set(tasks.shadowJar.get().archiveFile) + doLast { + println("Jar name: ${archiveFile.get().asFile}") + } } tasks.shadowJar { archiveClassifier.set("dep-dev") - exclude( - "module-info.class", "LICENSE.txt" - ) + configurations = listOf(shadowImplementation) + exclude("**/module-info.class", "LICENSE.txt") dependencies { - include(dependency("org.spongepowered:mixin")) - - include(dependency("commons-io:commons-io")) - include(dependency("org.apache.commons:commons-lang3")) - include(dependency("com.fasterxml.jackson.core:jackson-databind:2.10.2")) - include(dependency("com.fasterxml.jackson.core:jackson-annotations:2.10.2")) - include(dependency("com.fasterxml.jackson.core:jackson-core:2.10.2")) - - include(dependency("info.bliki.wiki:bliki-core:3.1.0")) - include(dependency("org.slf4j:slf4j-api:1.7.18")) - include(dependency("org.luaj:luaj-jse:3.0.1")) + exclude { + it.moduleGroup.startsWith("org.apache.") || it.moduleName in + listOf("logback-classic", "commons-logging", "commons-codec", "logback-core") + } } fun relocate(name: String) = relocate(name, "io.github.moulberry.notenoughupdates.deps.$name") - relocate("com.fasterxml.jackson") - relocate("org.eclipse") - relocate("org.slf4j") } tasks.assemble.get().dependsOn(remapJar) -tasks.remapJar{ - - doLast{ - println("Jar name :" + archiveFileName.get()) - } -} - val generateBuildFlags by tasks.creating { outputs.upToDateWhen { false } val t = layout.buildDirectory.file("buildflags.properties") |