From 3c578b8cc7b3690e45c7f5fb13d50f2008858efc Mon Sep 17 00:00:00 2001 From: Flemmli97 Date: Sun, 13 Jun 2021 23:07:10 +0200 Subject: [PATCH] shadow yaml lib --- common/build.gradle | 26 +++++++++++++++++++++++++- fabric/build.gradle | 14 ++++---------- forge/build.gradle | 8 ++++---- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 13d766b..d2fd2f8 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,15 +1,39 @@ +plugins { + id "com.github.johnrengelman.shadow" version "5.0.0" +} + +configurations { + shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. +} + dependencies { // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies // Do NOT use other classes from fabric loader modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}" implementation group: 'org.yaml', name: 'snakeyaml', version: '1.25' - include group: 'org.yaml', name: 'snakeyaml', version: '1.25' + shadowCommon group: 'org.yaml', name: 'snakeyaml', version: '1.25' } architectury { common() } +shadowJar { + configurations = [project.configurations.shadowCommon] +} + +// Use the shadow jar instead of normal jar to shadow yaml lib properly into fabric builds +transformProductionFabric { + dependsOn shadowJar + input.set shadowJar.archiveFile +} + +// Use the shadow jar instead of normal jar to shadow yaml lib properly into forge builds +transformProductionForge { + dependsOn shadowJar + input.set shadowJar.archiveFile +} + java { withSourcesJar() } diff --git a/fabric/build.gradle b/fabric/build.gradle index f97fbc9..ea82962 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,9 +1,3 @@ -buildscript { - dependencies { - classpath group: 'com.diluv.schoomp', name: 'Schoomp', version: '1.1.0' - } -} - plugins { id "com.github.johnrengelman.shadow" version "5.0.0" } @@ -89,6 +83,7 @@ sourcesJar { def commonSources = project(":common").sourcesJar dependsOn commonSources from commonSources.archiveFile.map { zipTree(it) } + classifier "fabric-source" } publishing { @@ -102,13 +97,12 @@ publishing { builtBy remapSourcesJar } artifactId project.archives_base_name - version project.version + "-fabric" + version project.version } } repositories { - mavenLocal() - /*maven { + maven { url "https://gitlab.com/api/v4/projects/21830712/packages/maven" //url "https://maven.pkg.github.com/flemmli97/<>" credentials { @@ -116,6 +110,6 @@ publishing { password = project.findProperty("gpr.gitlab.token") ?: System.getenv("GPR_GITLAB_TOKEN") //password = project.findProperty("gpr.github.token") ?: System.getenv("GPR_TOKEN") } - }*/ + } } } \ No newline at end of file diff --git a/forge/build.gradle b/forge/build.gradle index 422dde0..a188de9 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -63,6 +63,7 @@ sourcesJar { def commonSources = project(":common").sourcesJar dependsOn commonSources from commonSources.archiveFile.map { zipTree(it) } + classifier "forge-sources" } publishing { @@ -76,13 +77,12 @@ publishing { builtBy remapSourcesJar } artifactId project.archives_base_name - version project.version + "-forge" + version project.version } } repositories { - mavenLocal() - /*maven { + maven { url "https://gitlab.com/api/v4/projects/21830712/packages/maven" //url "https://maven.pkg.github.com/flemmli97/<>" credentials { @@ -90,6 +90,6 @@ publishing { password = project.findProperty("gpr.gitlab.token") ?: System.getenv("GPR_GITLAB_TOKEN") //password = project.findProperty("gpr.github.token") ?: System.getenv("GPR_TOKEN") } - }*/ + } } }