[CHORE] Migrate to fdd-xplat build system
This commit is contained in:
@@ -1,95 +1,70 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '1.3-SNAPSHOT'
|
||||
id 'idea'
|
||||
id "me.hypherionmc.modutils.modpublisher" version "1.0.+"
|
||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
archivesBaseName = "${mod_name}-fabric-${minecraft_version}"
|
||||
|
||||
configurations {
|
||||
shade
|
||||
}
|
||||
archivesBaseName = "${mod_name.replace(" ", "")}-Fabric-${minecraft_version}"
|
||||
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${minecraft_version}"
|
||||
mappings loom.officialMojangMappings()
|
||||
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
||||
implementation project(":Common")
|
||||
// Core
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api}"
|
||||
|
||||
shade "me.hypherionmc.moon-config:core:${moon_config}"
|
||||
shade "me.hypherionmc.moon-config:toml:${moon_config}"
|
||||
shade "com.hypherionmc:rpcsdk:1.0"
|
||||
|
||||
modCompileOnlyApi("com.terraformersmc:modmenu:${mod_menu_version}") {
|
||||
modImplementation("com.terraformersmc:modmenu:${mod_menu_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
from sourceSets.main.output
|
||||
configurations = [project.configurations.shade]
|
||||
|
||||
dependencies {
|
||||
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
||||
}
|
||||
|
||||
setArchiveClassifier('dev-shadow')
|
||||
}
|
||||
|
||||
/**
|
||||
* ===============================================================================
|
||||
* = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING =
|
||||
* ===============================================================================
|
||||
*/
|
||||
|
||||
unimined.minecraft {
|
||||
fabric {
|
||||
loader fabric_loader
|
||||
accessWidener(project(":Common").file("src/main/resources/${mod_id}.aw"))
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = project(":Common").file("src/main/resources/craterlib.aw")
|
||||
runs {
|
||||
client {
|
||||
client()
|
||||
setConfigName("Fabric Client")
|
||||
ideConfigGenerated(true)
|
||||
runDir("run")
|
||||
}
|
||||
server {
|
||||
server()
|
||||
setConfigName("Fabric Server")
|
||||
ideConfigGenerated(true)
|
||||
runDir("run")
|
||||
}
|
||||
}
|
||||
remapJar {
|
||||
inputFile.set shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
archiveClassifier.set null
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveClassifier.set "dev"
|
||||
}
|
||||
|
||||
processResources {
|
||||
from project(":Common").sourceSets.main.resources
|
||||
inputs.property "version", project.version
|
||||
def buildProps = project.properties.clone()
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version
|
||||
}
|
||||
|
||||
filesMatching('*.mixins.json') {
|
||||
expand "refmap_target": "${archivesBaseName}-"
|
||||
filesMatching(['fabric.mod.json']) {
|
||||
expand buildProps
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
compileTestJava.enabled = false
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
source(project(":Common").sourceSets.main.allSource)
|
||||
}
|
||||
|
||||
jar {
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${mod_name}" }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shadowjar Config
|
||||
*/
|
||||
shadowJar {
|
||||
configurations = [project.configurations.shade]
|
||||
dependencies {
|
||||
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
||||
}
|
||||
setArchiveClassifier("dev-shadow")
|
||||
}
|
||||
|
||||
remapJar {
|
||||
input.set shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
setArchiveClassifier(null)
|
||||
}
|
||||
|
||||
//reg.configureJarTask(shadowJar)
|
||||
|
||||
/**
|
||||
* Publishing Config
|
||||
*/
|
||||
@@ -101,8 +76,8 @@ publishing {
|
||||
version project.version
|
||||
from components.java
|
||||
|
||||
artifact(jar) {
|
||||
builtBy jar
|
||||
artifact(remapJar) {
|
||||
builtBy remapJar
|
||||
}
|
||||
|
||||
pom.withXml {
|
||||
@@ -110,7 +85,7 @@ publishing {
|
||||
pomNode.dependencies.'*'.findAll() {
|
||||
it.artifactId.text() == 'regutils-joined-fabric' ||
|
||||
it.artifactId.text() == 'core' ||
|
||||
it.artifactId.text() == 'toml' || it.artifactId.text() == "modmenu"
|
||||
it.artifactId.text() == 'toml'
|
||||
}.each() {
|
||||
it.parent().remove(it)
|
||||
}
|
||||
@@ -155,5 +130,4 @@ publisher {
|
||||
}
|
||||
|
||||
publishCurseforge.dependsOn(remapJar)
|
||||
publishModrinth.dependsOn(remapJar)
|
||||
|
||||
publishModrinth.dependsOn(remapJar)
|
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "craterlib",
|
||||
"id": "${mod_id}",
|
||||
"version": "${version}",
|
||||
"name": "CraterLib",
|
||||
"name": "${mod_name}",
|
||||
"description": "A library mod used by First Dark Development and HypherionSA Mods",
|
||||
"authors": [
|
||||
"HypherionSA",
|
||||
"${mod_author}",
|
||||
"Misha"
|
||||
],
|
||||
"contact": {
|
||||
@@ -27,10 +27,10 @@
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"craterlib.mixins.json",
|
||||
"craterlib.fabric.mixins.json"
|
||||
"${mod_id}.mixins.json",
|
||||
"${mod_id}.fabric.mixins.json"
|
||||
],
|
||||
"accessWidener": "craterlib.aw",
|
||||
"accessWidener": "${mod_id}.aw",
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.21",
|
||||
"fabric-api": "*",
|
||||
|
Reference in New Issue
Block a user