Set up theming for standalone jar and moved shadow stuff to main gradle
This commit is contained in:
+47
-1
@@ -2,9 +2,17 @@ import io.github.ran.jarmerger.JarMergerPlugin
|
||||
|
||||
|
||||
buildscript {
|
||||
dependencies{
|
||||
dependencies {
|
||||
classpath files('plugins/DHJarMerger-1.0.jar')
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath "gradle.plugin.com.github.johnrengelman:shadow:7.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
@@ -102,6 +110,7 @@ architectury {
|
||||
|
||||
|
||||
subprojects { p ->
|
||||
apply plugin: "com.github.johnrengelman.shadow"
|
||||
apply plugin: "dev.architectury.loom"
|
||||
|
||||
loom {
|
||||
@@ -135,6 +144,23 @@ subprojects { p ->
|
||||
implementation("com.electronwill.night-config:toml:${rootProject.toml_version}")
|
||||
implementation("com.googlecode.json-simple:json-simple:${rootProject.json_version}")
|
||||
|
||||
// Theming
|
||||
implementation("com.formdev:flatlaf:1.6.1")
|
||||
|
||||
|
||||
if (p == project(":fabric") || p == project(":forge")) {
|
||||
// Compression
|
||||
common 'org.tukaani:xz:1.9'
|
||||
common 'org.apache.commons:commons-compress:1.21'
|
||||
shadowMe 'org.tukaani:xz:1.9'
|
||||
shadowMe 'org.apache.commons:commons-compress:1.21'
|
||||
// Toml & Json for config
|
||||
shadowMe("com.electronwill.night-config:toml:${rootProject.toml_version}") {}
|
||||
shadowMe("com.googlecode.json-simple:json-simple:${rootProject.json_version}") {}
|
||||
// Theming
|
||||
shadowMe("com.formdev:flatlaf:1.6.1")
|
||||
}
|
||||
|
||||
if (p != project(":forge")) {
|
||||
// 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 unless working with fabric
|
||||
@@ -147,6 +173,26 @@ subprojects { p ->
|
||||
}
|
||||
}
|
||||
|
||||
if (p == project(":fabric") || p == project(":forge")) {
|
||||
shadowJar {
|
||||
configurations = [project.configurations.shadowMe]
|
||||
|
||||
// Compression
|
||||
relocate 'org.tukaani', 'shaded.tukaani'
|
||||
relocate 'org.apache.commons.compress', 'shaded.apache.commons.compress'
|
||||
// Toml & Json for config
|
||||
relocate 'com.electronwill.nightconfig', 'shaded.electronwill.nightconfig'
|
||||
relocate 'com.googlecode.json-simple', 'shaded.googlecode.json-simple'
|
||||
// Theming
|
||||
relocate 'com.formdev.flatlaf', 'shaded.formdev.flatlaf'
|
||||
}
|
||||
|
||||
remapJar {
|
||||
input.set shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
}
|
||||
}
|
||||
|
||||
// Allows the jar to run standalone
|
||||
jar {
|
||||
manifest {
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
plugins {
|
||||
id "com.github.johnrengelman.shadow" version "7.1.0"
|
||||
}
|
||||
|
||||
version = rootProject.mod_version+"-"+rootProject.minecraft_version+"-"+new Date().format("yyyy_MM_dd_HH_mm")
|
||||
|
||||
architectury {
|
||||
@@ -85,18 +81,8 @@ dependencies {
|
||||
|
||||
|
||||
|
||||
// Toml & Json for config
|
||||
shadowMe("com.electronwill.night-config:toml:${rootProject.toml_version}") {}
|
||||
shadowMe("com.googlecode.json-simple:json-simple:${rootProject.json_version}") {}
|
||||
|
||||
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||
shadowMe(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
|
||||
|
||||
// Compression
|
||||
common 'org.tukaani:xz:1.9'
|
||||
common 'org.apache.commons:commons-compress:1.21'
|
||||
shadowMe 'org.tukaani:xz:1.9'
|
||||
shadowMe 'org.apache.commons:commons-compress:1.21'
|
||||
}
|
||||
|
||||
task deleteResources(type: Delete) {
|
||||
@@ -119,12 +105,6 @@ runClient {
|
||||
|
||||
shadowJar {
|
||||
configurations = [project.configurations.shadowMe]
|
||||
// Compression
|
||||
relocate 'org.tukaani', 'shaded.tukaani'
|
||||
relocate 'org.apache.commons.compress', 'shaded.apache.commons.compress'
|
||||
// Toml & Json for config
|
||||
relocate 'com.electronwill.nightconfig', 'shaded.electronwill.nightconfig'
|
||||
relocate 'com.googlecode.json-simple', 'shaded.googlecode.json-simple'
|
||||
|
||||
// Our own code
|
||||
relocate 'com.seibel.lod.common', 'fabric.com.seibel.lod.common'
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
plugins {
|
||||
id "com.github.johnrengelman.shadow" version "7.1.0"
|
||||
}
|
||||
|
||||
version = rootProject.mod_version+"-"+rootProject.minecraft_version+"-"+new Date().format("yyyy_MM_dd_HH_mm")
|
||||
|
||||
loom {
|
||||
@@ -44,17 +40,6 @@ dependencies {
|
||||
shadowMe(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
|
||||
|
||||
// forgeDependencies(project(":core")) { transitive false }
|
||||
|
||||
|
||||
// Toml & Json for config
|
||||
shadowMe("com.electronwill.night-config:toml:${rootProject.toml_version}") {}
|
||||
shadowMe("com.googlecode.json-simple:json-simple:${rootProject.json_version}") {}
|
||||
|
||||
// Compression
|
||||
forgeDependencies('org.tukaani:xz:1.9')
|
||||
forgeDependencies('org.apache.commons:commons-compress:1.21')
|
||||
shadowMe 'org.tukaani:xz:1.9'
|
||||
shadowMe 'org.apache.commons:commons-compress:1.21'
|
||||
}
|
||||
|
||||
processResources {
|
||||
@@ -70,12 +55,6 @@ shadowJar {
|
||||
}
|
||||
exclude "fabric.mod.json"
|
||||
configurations = [project.configurations.shadowMe]
|
||||
// Compression
|
||||
relocate 'org.tukaani', 'shaded.tukaani'
|
||||
relocate 'org.apache.commons.compress', 'shaded.apache.commons.compress'
|
||||
// Toml & Json for config
|
||||
relocate 'com.electronwill.nightconfig', 'shaded.electronwill.nightconfig'
|
||||
relocate 'com.googlecode.json-simple', 'shaded.googlecode.json-simple'
|
||||
|
||||
// Our own code
|
||||
relocate 'com.seibel.lod.common', 'forge.com.seibel.lod.common'
|
||||
|
||||
Reference in New Issue
Block a user