[CHORE] Migrate to fdd-xplat build system
This commit is contained in:
@@ -1,32 +1,35 @@
|
|||||||
plugins {
|
archivesBaseName = "${mod_name.replace(" ", "")}-Common-${minecraft_version}"
|
||||||
id 'org.quiltmc.loom' version '1.3.3'
|
|
||||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'com.github.johnrengelman.shadow'
|
|
||||||
apply plugin: 'maven-publish'
|
|
||||||
|
|
||||||
archivesBaseName = "${mod_name}-common-${minecraft_version}"
|
|
||||||
|
|
||||||
loom {
|
|
||||||
accessWidenerPath = project.file("src/main/resources/craterlib.aw")
|
|
||||||
mixin {
|
|
||||||
useLegacyMixinAp = false
|
|
||||||
}
|
|
||||||
runConfigs.configureEach {
|
|
||||||
ideConfigGenerated = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft "com.mojang:minecraft:${minecraft_version}"
|
|
||||||
mappings loom.officialMojangMappings()
|
|
||||||
modImplementation "org.quiltmc:quilt-loader:0.19.4"
|
|
||||||
|
|
||||||
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
|
|
||||||
implementation "com.hypherionmc:rpcsdk:1.0"
|
implementation "com.hypherionmc:rpcsdk:1.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
from sourceSets.main.output
|
||||||
|
dependencies {
|
||||||
|
include(dependency("me.hypherionmc.moon-config:core:${moon_config}"))
|
||||||
|
include(dependency("me.hypherionmc.moon-config:toml:${moon_config}"))
|
||||||
|
|
||||||
|
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
||||||
|
}
|
||||||
|
setArchiveClassifier("dev")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ===============================================================================
|
||||||
|
* = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING =
|
||||||
|
* ===============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
unimined.minecraft {
|
||||||
|
fabric {
|
||||||
|
loader fabric_loader
|
||||||
|
accessWidener(project.file("src/main/resources/${mod_id}.aw"))
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultRemapJar = false
|
||||||
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
def buildProps = project.properties.clone()
|
def buildProps = project.properties.clone()
|
||||||
|
|
||||||
@@ -35,43 +38,17 @@ processResources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Shadowjar Config
|
|
||||||
*/
|
|
||||||
shadowJar {
|
|
||||||
exclude 'mappings/*'
|
|
||||||
dependencies {
|
|
||||||
include(dependency("me.hypherionmc.moon-config:core:${moon_config}"))
|
|
||||||
include(dependency("me.hypherionmc.moon-config:toml:${moon_config}"))
|
|
||||||
|
|
||||||
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
|
||||||
}
|
|
||||||
setArchiveClassifier('dev-shadow')
|
|
||||||
}
|
|
||||||
|
|
||||||
remapJar {
|
|
||||||
input.set shadowJar.archiveFile
|
|
||||||
dependsOn shadowJar
|
|
||||||
setArchiveClassifier(null)
|
|
||||||
}
|
|
||||||
|
|
||||||
//reg.configureJarTask(shadowJar)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Publishing Config
|
* Publishing Config
|
||||||
*/
|
*/
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenCommon(MavenPublication) {
|
||||||
groupId project.group
|
groupId project.group
|
||||||
artifactId project.archivesBaseName
|
artifactId project.archivesBaseName
|
||||||
version project.version
|
version project.version
|
||||||
from components.java
|
from components.java
|
||||||
|
|
||||||
artifact(jar) {
|
|
||||||
builtBy jar
|
|
||||||
}
|
|
||||||
|
|
||||||
pom.withXml {
|
pom.withXml {
|
||||||
Node pomNode = asNode()
|
Node pomNode = asNode()
|
||||||
pomNode.dependencies.'*'.findAll() {
|
pomNode.dependencies.'*'.findAll() {
|
||||||
@@ -94,4 +71,4 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,3 +1,4 @@
|
|||||||
accessWidener v1 named
|
accessWidener v1 named
|
||||||
|
|
||||||
accessible method net/minecraft/client/renderer/item/ItemProperties register (Lnet/minecraft/world/item/Item;Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/client/renderer/item/ClampedItemPropertyFunction;)V
|
accessible method net/minecraft/client/renderer/item/ItemProperties register (Lnet/minecraft/world/item/Item;Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/client/renderer/item/ClampedItemPropertyFunction;)V
|
||||||
|
accessible method net/minecraft/client/renderer/blockentity/BlockEntityRenderers register (Lnet/minecraft/world/level/block/entity/BlockEntityType;Lnet/minecraft/client/renderer/blockentity/BlockEntityRendererProvider;)V
|
@@ -23,6 +23,5 @@
|
|||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
},
|
}
|
||||||
"refmap": "${refmap_target}refmap.json"
|
|
||||||
}
|
}
|
||||||
|
@@ -1,95 +1,70 @@
|
|||||||
plugins {
|
archivesBaseName = "${mod_name.replace(" ", "")}-Fabric-${minecraft_version}"
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft "com.mojang:minecraft:${minecraft_version}"
|
// Core
|
||||||
mappings loom.officialMojangMappings()
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api}"
|
||||||
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
|
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
|
||||||
implementation project(":Common")
|
|
||||||
|
|
||||||
shade "me.hypherionmc.moon-config:core:${moon_config}"
|
shade "me.hypherionmc.moon-config:core:${moon_config}"
|
||||||
shade "me.hypherionmc.moon-config:toml:${moon_config}"
|
shade "me.hypherionmc.moon-config:toml:${moon_config}"
|
||||||
shade "com.hypherionmc:rpcsdk:1.0"
|
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")
|
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 {
|
remapJar {
|
||||||
accessWidenerPath = project(":Common").file("src/main/resources/craterlib.aw")
|
inputFile.set shadowJar.archiveFile
|
||||||
runs {
|
dependsOn shadowJar
|
||||||
client {
|
archiveClassifier.set null
|
||||||
client()
|
}
|
||||||
setConfigName("Fabric Client")
|
|
||||||
ideConfigGenerated(true)
|
jar {
|
||||||
runDir("run")
|
archiveClassifier.set "dev"
|
||||||
}
|
|
||||||
server {
|
|
||||||
server()
|
|
||||||
setConfigName("Fabric Server")
|
|
||||||
ideConfigGenerated(true)
|
|
||||||
runDir("run")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
from project(":Common").sourceSets.main.resources
|
from project(":Common").sourceSets.main.resources
|
||||||
inputs.property "version", project.version
|
def buildProps = project.properties.clone()
|
||||||
|
|
||||||
filesMatching("fabric.mod.json") {
|
filesMatching(['fabric.mod.json']) {
|
||||||
expand "version": project.version
|
expand buildProps
|
||||||
}
|
|
||||||
|
|
||||||
filesMatching('*.mixins.json') {
|
|
||||||
expand "refmap_target": "${archivesBaseName}-"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
compileTestJava.enabled = false
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
source(project(":Common").sourceSets.main.allSource)
|
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
|
* Publishing Config
|
||||||
*/
|
*/
|
||||||
@@ -101,8 +76,8 @@ publishing {
|
|||||||
version project.version
|
version project.version
|
||||||
from components.java
|
from components.java
|
||||||
|
|
||||||
artifact(jar) {
|
artifact(remapJar) {
|
||||||
builtBy jar
|
builtBy remapJar
|
||||||
}
|
}
|
||||||
|
|
||||||
pom.withXml {
|
pom.withXml {
|
||||||
@@ -110,7 +85,7 @@ publishing {
|
|||||||
pomNode.dependencies.'*'.findAll() {
|
pomNode.dependencies.'*'.findAll() {
|
||||||
it.artifactId.text() == 'regutils-joined-fabric' ||
|
it.artifactId.text() == 'regutils-joined-fabric' ||
|
||||||
it.artifactId.text() == 'core' ||
|
it.artifactId.text() == 'core' ||
|
||||||
it.artifactId.text() == 'toml' || it.artifactId.text() == "modmenu"
|
it.artifactId.text() == 'toml'
|
||||||
}.each() {
|
}.each() {
|
||||||
it.parent().remove(it)
|
it.parent().remove(it)
|
||||||
}
|
}
|
||||||
@@ -155,5 +130,4 @@ publisher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
publishCurseforge.dependsOn(remapJar)
|
publishCurseforge.dependsOn(remapJar)
|
||||||
publishModrinth.dependsOn(remapJar)
|
publishModrinth.dependsOn(remapJar)
|
||||||
|
|
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"id": "craterlib",
|
"id": "${mod_id}",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
"name": "CraterLib",
|
"name": "${mod_name}",
|
||||||
"description": "A library mod used by First Dark Development and HypherionSA Mods",
|
"description": "A library mod used by First Dark Development and HypherionSA Mods",
|
||||||
"authors": [
|
"authors": [
|
||||||
"HypherionSA",
|
"${mod_author}",
|
||||||
"Misha"
|
"Misha"
|
||||||
],
|
],
|
||||||
"contact": {
|
"contact": {
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"craterlib.mixins.json",
|
"${mod_id}.mixins.json",
|
||||||
"craterlib.fabric.mixins.json"
|
"${mod_id}.fabric.mixins.json"
|
||||||
],
|
],
|
||||||
"accessWidener": "craterlib.aw",
|
"accessWidener": "${mod_id}.aw",
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.14.21",
|
"fabricloader": ">=0.14.21",
|
||||||
"fabric-api": "*",
|
"fabric-api": "*",
|
||||||
|
@@ -1,125 +1,64 @@
|
|||||||
plugins {
|
// Adjust the output jar name here
|
||||||
id "me.hypherionmc.modutils.modpublisher" version "1.0.+"
|
archivesBaseName = "${mod_name.replace(" ", "")}-Forge-${minecraft_version}"
|
||||||
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
|
|
||||||
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
|
|
||||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'java'
|
|
||||||
apply plugin: 'net.minecraftforge.gradle'
|
|
||||||
apply plugin: 'eclipse'
|
|
||||||
apply plugin: 'org.spongepowered.mixin'
|
|
||||||
apply plugin: 'maven-publish'
|
|
||||||
apply plugin: 'com.github.johnrengelman.shadow'
|
|
||||||
|
|
||||||
archivesBaseName = "${mod_name}-forge-${minecraft_version}"
|
|
||||||
|
|
||||||
mixin {
|
|
||||||
add sourceSets.main, "${mod_id}.refmap.json"
|
|
||||||
|
|
||||||
config "${mod_id}.mixins.json"
|
|
||||||
config "${mod_id}.forge.mixins.json"
|
|
||||||
}
|
|
||||||
|
|
||||||
minecraft {
|
|
||||||
mappings channel: 'official', version: minecraft_version
|
|
||||||
|
|
||||||
if (project.hasProperty('forge_ats_enabled') && project.findProperty('forge_ats_enabled').toBoolean()) {
|
|
||||||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
|
||||||
project.logger.debug('Forge Access Transformers are enabled for this project.')
|
|
||||||
}
|
|
||||||
|
|
||||||
runs {
|
|
||||||
client {
|
|
||||||
workingDirectory project.file('run')
|
|
||||||
ideaModule "${rootProject.name}.${project.name}.main"
|
|
||||||
taskName 'Client'
|
|
||||||
args "-mixin.config=${mod_id}.mixins.json", "-mixin.config=${mod_id}.forge.mixins.json"
|
|
||||||
mods {
|
|
||||||
modClientRun {
|
|
||||||
source sourceSets.main
|
|
||||||
source project(":Common").sourceSets.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
workingDirectory project.file('run')
|
|
||||||
ideaModule "${rootProject.name}.${project.name}.main"
|
|
||||||
taskName 'Server'
|
|
||||||
args "-mixin.config=${mod_id}.mixins.json", "-mixin.config=${mod_id}.forge.mixins.json"
|
|
||||||
mods {
|
|
||||||
modServerRun {
|
|
||||||
source sourceSets.main
|
|
||||||
source project(":Common").sourceSets.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data {
|
|
||||||
workingDirectory project.file('run')
|
|
||||||
ideaModule "${rootProject.name}.${project.name}.main"
|
|
||||||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
|
||||||
taskName 'Data'
|
|
||||||
args "-mixin.config=${mod_id}.mixins.json", "-mixin.config=${mod_id}.forge.mixins.json"
|
|
||||||
mods {
|
|
||||||
modDataRun {
|
|
||||||
source sourceSets.main
|
|
||||||
source project(":Common").sourceSets.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets.main.resources.srcDir 'src/generated/resources'
|
|
||||||
|
|
||||||
configurations {
|
|
||||||
shade
|
|
||||||
implementation.extendsFrom shade
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
|
||||||
compileOnly project(":Common")
|
|
||||||
annotationProcessor 'org.spongepowered:mixin:0.8.4-SNAPSHOT:processor'
|
|
||||||
|
|
||||||
shade "me.hypherionmc.moon-config:core:${moon_config}"
|
shade "me.hypherionmc.moon-config:core:${moon_config}"
|
||||||
shade "me.hypherionmc.moon-config:toml:${moon_config}"
|
shade "me.hypherionmc.moon-config:toml:${moon_config}"
|
||||||
shade "com.hypherionmc:rpcsdk:1.0"
|
shade "com.hypherionmc:rpcsdk:1.0"
|
||||||
|
|
||||||
|
// Do not edit or remove
|
||||||
|
implementation project(":Common")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
shadowJar {
|
||||||
source(project(":Common").sourceSets.main.allSource)
|
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 {
|
||||||
|
minecraftForge {
|
||||||
|
loader forge_version
|
||||||
|
mixinConfig("${mod_id}.mixins.json", "${mod_id}.forge.mixins.json")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
remapJar {
|
||||||
|
inputFile.set shadowJar.archiveFile
|
||||||
|
dependsOn shadowJar
|
||||||
|
archiveClassifier.set null
|
||||||
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
archiveClassifier.set "dev"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
from project(":Common").sourceSets.main.resources
|
from project(":Common").sourceSets.main.resources
|
||||||
|
def buildProps = project.properties.clone()
|
||||||
|
|
||||||
filesMatching('*.mixins.json') {
|
filesMatching("META-INF/mods.toml") {
|
||||||
expand "refmap_target": "${mod_id}."
|
expand buildProps
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
compileTestJava.enabled = false
|
||||||
* Shadowjar Config
|
|
||||||
*/
|
tasks.withType(JavaCompile).configureEach {
|
||||||
shadowJar {
|
source(project(":Common").sourceSets.main.allSource)
|
||||||
configurations = [project.configurations.shade]
|
|
||||||
dependencies {
|
|
||||||
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
|
||||||
}
|
|
||||||
setArchiveClassifier('')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assemble.dependsOn(shadowJar)
|
|
||||||
|
|
||||||
reobf {
|
|
||||||
shadowJar {}
|
|
||||||
}
|
|
||||||
|
|
||||||
//reg.configureJarTask(shadowJar)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Publishing Config
|
* Publishing Config
|
||||||
*/
|
*/
|
||||||
@@ -129,7 +68,12 @@ publishing {
|
|||||||
groupId project.group
|
groupId project.group
|
||||||
artifactId project.archivesBaseName
|
artifactId project.archivesBaseName
|
||||||
version project.version
|
version project.version
|
||||||
artifact shadowJar
|
from components.java
|
||||||
|
|
||||||
|
artifact(remapJar) {
|
||||||
|
builtBy remapJar
|
||||||
|
}
|
||||||
|
|
||||||
pom.withXml {
|
pom.withXml {
|
||||||
Node pomNode = asNode()
|
Node pomNode = asNode()
|
||||||
pomNode.dependencies.'*'.findAll() {
|
pomNode.dependencies.'*'.findAll() {
|
||||||
@@ -142,6 +86,7 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
url "https://maven.firstdark.dev/" + (project.release ? "releases" : "snapshots")
|
url "https://maven.firstdark.dev/" + (project.release ? "releases" : "snapshots")
|
||||||
@@ -162,15 +107,13 @@ publisher {
|
|||||||
curseID = curse_id
|
curseID = curse_id
|
||||||
modrinthID = modrinth_id
|
modrinthID = modrinth_id
|
||||||
versionType = "release"
|
versionType = "release"
|
||||||
changelog = rootProject.file("changelog-forge.md")
|
changelog = rootProject.file("changelog-fabric.md")
|
||||||
version = "${minecraft_version}-${project.version}"
|
version = "${minecraft_version}-${project.version}"
|
||||||
displayName = "[FORGE 1.20.2] CraterLib - ${project.version}"
|
displayName = "[FORGE 1.20.2] CraterLib - ${project.version}"
|
||||||
gameVersions = ["1.20.2"]
|
gameVersions = ["1.20.2"]
|
||||||
loaders = ["forge"]
|
loaders = ["forge"]
|
||||||
artifact = shadowJar
|
artifact = remapJar
|
||||||
}
|
}
|
||||||
|
|
||||||
publishCurseforge.dependsOn(reobfShadowJar)
|
publishCurseforge.dependsOn(remapJar)
|
||||||
publishModrinth.dependsOn(reobfShadowJar)
|
publishModrinth.dependsOn(remapJar)
|
||||||
|
|
||||||
jar.finalizedBy('reobfJar')
|
|
@@ -4,26 +4,26 @@ license = "MIT"
|
|||||||
issueTrackerURL="https://github.com/firstdarkdev/craterLib/issues"
|
issueTrackerURL="https://github.com/firstdarkdev/craterLib/issues"
|
||||||
|
|
||||||
[[mods]]
|
[[mods]]
|
||||||
modId = "craterlib"
|
modId = "${mod_id}"
|
||||||
version = "${file.jarVersion}"
|
version = "${version}"
|
||||||
displayName = "CraterLib"
|
displayName = "${mod_name}"
|
||||||
displayURL="https://modrinth.com/mod/craterlib"
|
displayURL="https://modrinth.com/mod/craterlib"
|
||||||
logoFile = "craterlib_logo.png"
|
logoFile = "craterlib_logo.png"
|
||||||
#credits="Thanks for this example mod goes to Java"
|
#credits="Thanks for this example mod goes to Java"
|
||||||
authors = "HypherionSA, Zenith"
|
authors = "${mod_author}, Zenith"
|
||||||
description = '''
|
description = '''
|
||||||
A library mod used by First Dark Development and HypherionSA Mods
|
A library mod used by First Dark Development and HypherionSA Mods
|
||||||
'''
|
'''
|
||||||
displayTest = "MATCH_VERSION"
|
displayTest = "MATCH_VERSION"
|
||||||
|
|
||||||
[[dependencies.craterlib]]
|
[[dependencies.${mod_id}]]
|
||||||
modId = "forge"
|
modId = "forge"
|
||||||
mandatory = true
|
mandatory = true
|
||||||
versionRange = "[46,)"
|
versionRange = "[46,)"
|
||||||
ordering = "NONE"
|
ordering = "NONE"
|
||||||
side = "BOTH"
|
side = "BOTH"
|
||||||
|
|
||||||
[[dependencies.craterlib]]
|
[[dependencies.${mod_id}]]
|
||||||
modId = "minecraft"
|
modId = "minecraft"
|
||||||
mandatory = true
|
mandatory = true
|
||||||
versionRange = "[1.20,)"
|
versionRange = "[1.20,)"
|
||||||
|
@@ -13,6 +13,5 @@
|
|||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
},
|
}
|
||||||
"refmap": "${refmap_target}refmap.json"
|
|
||||||
}
|
}
|
||||||
|
117
build.gradle
117
build.gradle
@@ -1,9 +1,13 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
//id 'com.matyrobbrt.mc.registrationutils' version '1.20.1-1.0.0'
|
id 'com.github.johnrengelman.shadow' version '8.0.0' apply false
|
||||||
|
id "xyz.wagyourtail.unimined" version "1.1.0-SNAPSHOT" apply false
|
||||||
|
id "me.hypherionmc.modutils.modpublisher" version "1.0.+"
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
|
//id 'com.matyrobbrt.mc.registrationutils' version '1.20.1-1.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Reg Utils
|
||||||
/*registrationUtils {
|
/*registrationUtils {
|
||||||
group 'com.hypherionmc.craterlib.core.systems.reg'
|
group 'com.hypherionmc.craterlib.core.systems.reg'
|
||||||
projects {
|
projects {
|
||||||
@@ -14,32 +18,58 @@ plugins {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
release = project.properties['release'] ?: false
|
release=project.properties['release'] ?: false
|
||||||
}
|
}
|
||||||
|
|
||||||
def version_base = "${project.version_major}.${project.version_minor}"
|
var base_version = "${version_major}.${version_minor}"
|
||||||
def final_ver = "${version_base}.${project.version_patch}"
|
var final_version = "${base_version}.${version_patch}"
|
||||||
|
|
||||||
// Jenkins
|
// CI Support
|
||||||
if (System.getenv('BUILD_NUMBER') != null && project.release == false) {
|
if (!release && System.getenv('BUILD_NUMBER') != null) {
|
||||||
final_ver = version_base + "." + System.getenv('BUILD_NUMBER') + "d"
|
final_version = "${base_version}.${System.getenv('BUILD_NUMBER')}d"
|
||||||
}
|
}
|
||||||
|
|
||||||
version = "${final_ver}"
|
group = project_group
|
||||||
|
version = "${final_version}"
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
version = "${final_ver}"
|
apply plugin: "xyz.wagyourtail.unimined"
|
||||||
group = project.group
|
apply plugin: "java"
|
||||||
|
apply plugin: 'maven-publish'
|
||||||
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
|
apply plugin: 'me.hypherionmc.modutils.modpublisher'
|
||||||
|
|
||||||
apply plugin: 'java'
|
group = rootProject.group
|
||||||
|
version = rootProject.version
|
||||||
|
|
||||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
//java.withSourcesJar()
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
//java.withJavadocJar()
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
name = 'First Dark Maven'
|
||||||
|
url = 'https://maven.firstdark.dev/releases/'
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name = 'First Dark Mirror'
|
||||||
|
url = 'https://mcentral.firstdark.dev/releases/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
shade
|
||||||
|
modCompileOnly
|
||||||
|
implementation.extendsFrom shade
|
||||||
|
compileOnly.extendsFrom modCompileOnly
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "me.hypherionmc.moon-config:core:${moon_config}"
|
||||||
|
implementation "me.hypherionmc.moon-config:toml:${moon_config}"
|
||||||
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
archiveClassifier = 'slim'
|
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes([
|
attributes([
|
||||||
'Specification-Title' : mod_name,
|
'Specification-Title' : mod_name,
|
||||||
@@ -56,21 +86,19 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
/**
|
||||||
mavenCentral()
|
* ===============================================================================
|
||||||
maven {
|
* = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING =
|
||||||
name = 'First Dark Maven'
|
* ===============================================================================
|
||||||
url = 'https://maven.firstdark.dev/releases/'
|
*/
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = 'First Dark Mirror'
|
|
||||||
url = 'https://mcentral.firstdark.dev/releases/'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
unimined.minecraft(sourceSets.main, true) {
|
||||||
implementation "me.hypherionmc.moon-config:core:${moon_config}"
|
version minecraft_version
|
||||||
implementation "me.hypherionmc.moon-config:toml:${moon_config}"
|
|
||||||
|
mappings {
|
||||||
|
mojmap()
|
||||||
|
devNamespace "mojmap"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
@@ -78,9 +106,6 @@ subprojects {
|
|||||||
it.options.release = 17
|
it.options.release = 17
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disables Gradle's custom module metadata from being published to maven. The
|
|
||||||
// metadata includes mapped dependencies which are not reasonably consumable by
|
|
||||||
// other mod developers.
|
|
||||||
tasks.withType(GenerateModuleMetadata) {
|
tasks.withType(GenerateModuleMetadata) {
|
||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
@@ -90,11 +115,11 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (project.name !== 'Common') {
|
if (project.name !== 'Common') {
|
||||||
task delDevJar {
|
tasks.register('delDevJar') {
|
||||||
doLast {
|
doLast {
|
||||||
def tree = fileTree('build/libs')
|
def tree = fileTree('build/libs')
|
||||||
tree.include '**/*-dev.jar'
|
|
||||||
tree.include '**/*-dev-shadow.jar'
|
tree.include '**/*-dev-shadow.jar'
|
||||||
|
tree.include '**/*-dev.jar'
|
||||||
tree.include '**/*-all.jar'
|
tree.include '**/*-all.jar'
|
||||||
tree.include '**/*-slim.jar'
|
tree.include '**/*-slim.jar'
|
||||||
tree.each { it.delete() }
|
tree.each { it.delete() }
|
||||||
@@ -102,7 +127,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
build.finalizedBy delDevJar
|
build.finalizedBy delDevJar
|
||||||
|
|
||||||
task copyAllArtifacts(type: Copy) {
|
tasks.register('copyAllArtifacts', Copy) {
|
||||||
from "$buildDir/libs"
|
from "$buildDir/libs"
|
||||||
into "$rootDir/artifacts"
|
into "$rootDir/artifacts"
|
||||||
include("*.jar")
|
include("*.jar")
|
||||||
@@ -113,32 +138,32 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Standalone or Module JARS
|
// Standalone or Module JARS
|
||||||
task rpcJar(type: Jar) {
|
tasks.register('rpcJar', Jar) {
|
||||||
dependsOn(compileJava)
|
dependsOn(compileJava)
|
||||||
includeEmptyDirs = false
|
includeEmptyDirs = false
|
||||||
archivesBaseName = "${mod_name}-modules"
|
archivesBaseName = "${mod_name}-modules-${minecraft_version}"
|
||||||
version = final_ver;
|
version = final_version
|
||||||
setArchiveClassifier("rpc")
|
setArchiveClassifier("rpc")
|
||||||
|
|
||||||
from project(":Common").sourceSets.main.output
|
from project(":Common").sourceSets.main.output
|
||||||
}
|
}
|
||||||
|
|
||||||
task configJar(type: Jar) {
|
tasks.register('configJar', Jar) {
|
||||||
dependsOn(compileJava)
|
dependsOn(compileJava)
|
||||||
includeEmptyDirs = false
|
includeEmptyDirs = false
|
||||||
archivesBaseName = "${mod_name}-modules"
|
archivesBaseName = "${mod_name}-modules-${minecraft_version}"
|
||||||
version = final_ver;
|
version = final_version
|
||||||
setArchiveClassifier("config")
|
setArchiveClassifier("config")
|
||||||
|
|
||||||
from project(":Common").sourceSets.main.output
|
from project(":Common").sourceSets.main.output
|
||||||
include("**\\core\\config\\**\\*", "**\\**\\CraterConstants.*")
|
include("**\\core\\config\\**\\*", "**\\**\\CraterConstants.*")
|
||||||
}
|
}
|
||||||
|
|
||||||
task eventsJar(type: Jar) {
|
tasks.register('eventsJar', Jar) {
|
||||||
dependsOn(compileJava)
|
dependsOn(compileJava)
|
||||||
includeEmptyDirs = false
|
includeEmptyDirs = false
|
||||||
archivesBaseName = "${mod_name}-modules"
|
archivesBaseName = "${mod_name}-modules-${minecraft_version}"
|
||||||
version = final_ver;
|
version = final_version
|
||||||
setArchiveClassifier("events")
|
setArchiveClassifier("events")
|
||||||
|
|
||||||
from project(":Common").sourceSets.main.output
|
from project(":Common").sourceSets.main.output
|
||||||
@@ -149,7 +174,7 @@ publishing {
|
|||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
groupId project.group
|
groupId project.group
|
||||||
artifactId "${mod_name}-modules"
|
artifactId "${mod_name}-modules-${minecraft_version}"
|
||||||
version project.version
|
version project.version
|
||||||
|
|
||||||
artifact rpcJar
|
artifact rpcJar
|
||||||
|
@@ -1,34 +1,23 @@
|
|||||||
# Gradle
|
#Project
|
||||||
fabric.loom.multiProjectOptimisation = true
|
|
||||||
|
|
||||||
# Project
|
|
||||||
version_major=1
|
version_major=1
|
||||||
version_minor=0
|
version_minor=0
|
||||||
version_patch=3
|
version_patch=3
|
||||||
group=com.hypherionmc.craterlib
|
project_group=com.hypherionmc.craterlib
|
||||||
|
|
||||||
# Common
|
#Mod
|
||||||
|
mod_author=HypherionSA
|
||||||
|
mod_id=craterlib
|
||||||
|
mod_name=CraterLib
|
||||||
|
|
||||||
|
# Shared
|
||||||
minecraft_version=1.20.2
|
minecraft_version=1.20.2
|
||||||
common_runs_enabled=false
|
|
||||||
common_client_run_name=Common Client
|
# Fabric
|
||||||
common_server_run_name=Common Server
|
fabric_loader=0.14.22
|
||||||
|
fabric_api=0.89.0+1.20.2
|
||||||
|
|
||||||
# Forge
|
# Forge
|
||||||
forge_version=48.0.6
|
forge_version=48.0.6
|
||||||
forge_ats_enabled=true
|
|
||||||
|
|
||||||
# Fabric
|
|
||||||
fabric_version=0.89.0+1.20.2
|
|
||||||
fabric_loader_version=0.14.22
|
|
||||||
|
|
||||||
# Mod options
|
|
||||||
mod_name=CraterLib
|
|
||||||
mod_author=HypherionSA
|
|
||||||
mod_id=craterlib
|
|
||||||
|
|
||||||
# Gradle
|
|
||||||
org.gradle.jvmargs=-Xmx3G
|
|
||||||
org.gradle.daemon=false
|
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
mod_menu_version=8.0.0-beta.2
|
mod_menu_version=8.0.0-beta.2
|
||||||
@@ -36,4 +25,8 @@ moon_config=1.0.9
|
|||||||
|
|
||||||
# Publishing
|
# Publishing
|
||||||
curse_id=867099
|
curse_id=867099
|
||||||
modrinth_id=Nn8Wasaq
|
modrinth_id=Nn8Wasaq
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
org.gradle.jvmargs=-Xmx3G
|
||||||
|
org.gradle.daemon=false
|
@@ -2,10 +2,10 @@ pluginManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
maven {
|
maven {
|
||||||
url "https://maven.firstdark.dev/releases"
|
url "https://mcentral.firstdark.dev/releases"
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
url "https://mcentral.firstdark.dev/releases"
|
url "https://maven.firstdark.dev/releases"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user