Fabric now builds (and works outside the build environment)

This commit is contained in:
coolGi
2023-02-12 20:11:53 +10:30
parent 89faf6e976
commit 8de6ca33af
4 changed files with 30 additions and 15 deletions
+19 -13
View File
@@ -117,24 +117,27 @@ forgix {
subprojects { p ->
// Does the same as "p == project(":common") || p == project(":fabric") || p == project(":quilt") || p == project(":forge")"
// Useful later on so we dont have duplicated code
def isMinecraftSubProject = p != project(":core") && p != project(":api")
// Apply plugins
apply plugin: "java"
apply plugin: "systems.manifold.manifold-gradle-plugin"
if (isMinecraftSubProject)
apply plugin: "systems.manifold.manifold-gradle-plugin"
apply plugin: "com.github.johnrengelman.shadow"
// apply plugin: "org.spongepowered.gradle.vanilla" // Provides minecraft libraries
if (p == project(":core")) {
apply plugin: "application"
}
// Set the manifold version (may not be required tough)
manifold {
manifoldVersion = rootProject.manifold_version
}
// Does the same as "p == project(":common") || p == project(":fabric") || p == project(":quilt") || p == project(":forge")"
// Useful later on so we dont have duplicated code
def isMinecraftSubProject = p != project(":core") && p != project(":api")
// set up custom configurations (configurations are a way to handle dependencies)
configurations {
@@ -146,7 +149,7 @@ subprojects { p ->
customModule
implementation.extendsFrom(customModule)
if (p != project(":api") && p != project(":core")) {
if (isMinecraftSubProject) {
// Shadow common
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
@@ -172,7 +175,8 @@ subprojects { p ->
// Manifold
annotationProcessor("systems.manifold:manifold-preprocessor:${rootProject.manifold_version}")
if (isMinecraftSubProject)
annotationProcessor("systems.manifold:manifold-preprocessor:${rootProject.manifold_version}")
// Log4j
implementation("org.apache.logging.log4j:log4j-api:${rootProject.log4j_version}")
@@ -207,6 +211,7 @@ subprojects { p ->
// conditional dependencies //
//==========================//
// Add core
if (isMinecraftSubProject) {
implementation(project(":core")) {
@@ -262,18 +267,19 @@ subprojects { p ->
}
allprojects { p ->
// Does the same as "p == project(":common") || p == project(":fabric") || p == project(":quilt") || p == project(":forge")"
// Useful later on so we dont have duplicated code
def isMinecraftSubProject = p != project(":core") && p != project(":api")
apply plugin: "java"
apply plugin: "maven-publish"
archivesBaseName = rootProject.mod_name
version = rootProject.mod_version
version = project.name + "-" + rootProject.mod_version
group = rootProject.maven_group
// Does the same as "p == project(":common") || p == project(":fabric") || p == project(":quilt") || p == project(":forge")"
// Useful later on so we dont have duplicated code
def isMinecraftSubProject = p != project(":core") && p != project(":api")
repositories {
// The central repo
mavenCentral()
@@ -367,7 +373,7 @@ allprojects { p ->
implementation("org.jetbrains:annotations:16.0.2")
implementation("com.google.code.findbugs:jsr305:3.0.2")
implementation("com.google.common:google-collect:0.5")
implementation("com.google.guava:guava:11.0.2")
implementation("com.google.guava:guava:31.1-jre")
implementation("it.unimi.dsi:fastutil:8.5.11")
}
}
+6 -2
View File
@@ -1,10 +1,10 @@
plugins {
id "fabric-loom" version "1.0-SNAPSHOT"
id "fabric-loom" version "1.1-SNAPSHOT"
}
loom {
// FIXME: AccessWidener
// accessWidenerPath = project(":common").file("src/main/resources/${rootProject.accessWidenerVersion}.lod.accesswidener")
accessWidenerPath = project(":common").file("src/main/resources/${accessWidenerVersion}.lod.accesswidener")
runs {
client {
client()
@@ -111,10 +111,14 @@ dependencies {
common(project(path: ":common")) { transitive false }
shadowCommon(project(path: ":common")) { transitive false }
// shadowCommon(project(path: ":common"), configuration: "transformProductionFabric") { transitive false } // FIXME
shadowMe(project(path: ":core")) { transitive false }
shadowMe(project(path: ":api")) { transitive false }
}
shadowJar {
configurations = [project.configurations.shadowCommon, project.configurations.shadowMe, project.configurations.customModule]
relocate 'com.seibel.lod.common', 'loaderCommon.fabric.com.seibel.lod.common'
// Compression
relocate 'org.tukaani', 'distanthorizons.libraries.tukaani'
@@ -16,6 +16,8 @@
"license": "LGPL-3",
"icon": "icon.png",
"accessWidener": "lod.accesswidener",
"environment": "*",
"entrypoints": {
"client": [
+3
View File
@@ -114,6 +114,8 @@ dependencies {
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive false }
shadowMe(project(path: ":core")) { transitive false }
shadowMe(project(path: ":api")) { transitive false }
}
processResources {
@@ -125,6 +127,7 @@ shadowJar {
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon, project.configurations.shadowMe, project.configurations.customModule]
relocate 'com.seibel.lod.common', 'loaderCommon.forge.com.seibel.lod.common'
// Compression
relocate 'org.tukaani', 'distanthorizons.libraries.tukaani'