From 6d53613a57d542a424d6368cb91c69dfd5c6772e Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 20 Jan 2024 12:44:17 +0800 Subject: add plugin-wide config; enable CoW through config file --- build.gradle | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'build.gradle') diff --git a/build.gradle b/build.gradle index 67b3e86..22bac88 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id 'fabric-loom' version '1.0-SNAPSHOT' id 'maven-publish' + id 'com.github.johnrengelman.shadow' version '7.1.2' } sourceCompatibility = JavaVersion.VERSION_1_8 @@ -20,6 +21,20 @@ repositories { // for more information about repositories. } +shadowJar { + configurations = [project.configurations.shadow] + + // mitigate log4j security problem + exclude 'org/apache/logging/log4j/core/lookup/JndiLookup.class' + exclude 'META-INF' +} + +remapJar { + dependsOn(shadowJar) + mustRunAfter(shadowJar) + inputFile = tasks.shadowJar.archiveFile +} + dependencies { implementation 'junit:junit:4.13.2' @@ -31,6 +46,10 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind + modImplementation 'com.fasterxml.jackson.core:jackson-databind:2.16.1' + shadow 'com.fasterxml.jackson.core:jackson-databind:2.16.1' + // Uncomment the following line to enable the deprecated Fabric API modules. // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. @@ -54,7 +73,7 @@ java { jar { from("LICENSE") { - rename { "${it}_${project.archivesBaseName}"} + rename { "${it}_${project.archivesBaseName}" } } } -- cgit v1.2.3