Moved common to Unimined

This commit is contained in:
coolGi
2024-02-18 21:09:00 +10:30
parent d0dc3ec9bc
commit 4d73c3ecb8
2 changed files with 21 additions and 36 deletions
+9 -8
View File
@@ -91,7 +91,7 @@ forgix {
}
subprojects { p ->
// Does the same as "p == project(":common") || p == project(":fabric") || p == project(":quilt") || p == project(":forge") || p == project("WhateverLoaderWeAddLaterOn")"
// Does the same as "p == project(":common") || p == project(":fabric") || p == project(":forge") || p == project("WhateverLoaderWeAddLaterOn")"
// Useful later on so we dont have duplicated code
def isMinecraftSubProject = p != project(":core") && p != project(":api")
@@ -99,11 +99,10 @@ subprojects { p ->
// Apply plugins
apply plugin: "java"
apply plugin: "com.github.johnrengelman.shadow"
if (p == project(":core")) {
if (p == project(":core"))
apply plugin: "application"
}
if (p != project(":common") && isMinecraftSubProject) {
if (isMinecraftSubProject) {
apply plugin: "xyz.wagyourtail.unimined"
unimined.minecraft(sourceSets.main, true) {
@@ -117,10 +116,12 @@ subprojects { p ->
}
}
tasks.withType(JavaCompile).configureEach {
source(project(":common").sourceSets.main.java)
source(project(":api").sourceSets.main.java)
source(project(":core").sourceSets.main.java)
if (p != project(":common")) {
tasks.withType(JavaCompile).configureEach {
source(project(":common").sourceSets.main.java)
source(project(":api").sourceSets.main.java)
source(project(":core").sourceSets.main.java)
}
}
}
+12 -28
View File
@@ -1,32 +1,16 @@
plugins {
id "org.spongepowered.gradle.vanilla" version "0.2.1-SNAPSHOT"
}
// Use Unimined's implimentation for MC as we can use Parchment mappings in common now! :tada:
// With Sponge's vanilla gradle, we cannot change the mappings to anything out of mojmaps
unimined.minecraft {
fabric { // TODO: Find a way to only include the mc stuff, not fabric's loader
loader rootProject.fabric_loader_version
accessWidener(project(":common").file("src/main/resources/${accessWidenerVersion}.distanthorizons.accesswidener"))
minecraft {
accessWideners(project(":common").file("src/main/resources/${accessWidenerVersion}.distanthorizons.accesswidener"))
version(rootProject.minecraft_version)
skipInsertAw = true
}
defaultRemapJar = false
}
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.fabric_loader_version}"
// So mixins can be written in common
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
}
publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.mod_readable_name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}
}