Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ jobs:
- name: Publish to DAQEM Maven
run: ./gradlew publish

- name: Publish to Modrinth
run: ./gradlew modrinth

- name: Publish to CurseForge
run: ./gradlew curseforge
- name: Publish to CurseForge and Modrinth
run: ./gradlew publishUnified

- name: Publish to GitHub Releases
uses: ncipollo/release-action@v1
Expand All @@ -72,4 +69,4 @@ jobs:
fabric/build/libs/*.jar
neoforge/build/libs/*.jar
name: ${{ steps.gradle_version.outputs.VERSION_NAME }}
tag: ${{ steps.gradle_version.outputs.VERSION_NAME }}
tag: ${{ steps.gradle_version.outputs.VERSION_NAME }}
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:

runs-on: ubuntu-latest

env:
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}

steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2026 DAQEM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
67 changes: 25 additions & 42 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,63 +1,46 @@
plugins {
id "java-library"
id "dev.architectury.loom" version "1.13-SNAPSHOT" apply false
id "architectury-plugin" version "3.4-SNAPSHOT"
id 'com.github.johnrengelman.shadow' apply false
id "com.github.johnrengelman.shadow" apply false
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
}

architectury {
minecraft = project.minecraft_version
}

allprojects {
group = rootProject.maven_group
version = rootProject.mod_version

task printVersionName {
doLast {
println version
}
}
minecraft = rootProject.minecraft_version
}

subprojects {
apply plugin: 'dev.architectury.loom'
apply plugin: 'architectury-plugin'
apply plugin: 'maven-publish'
apply plugin: "dev.architectury.loom"
apply plugin: "architectury-plugin"

apply from: rootProject.file("gradle/scripts/java.gradle")
apply from: rootProject.file("gradle/scripts/dependencies.gradle")

base {
archivesName = rootProject.archives_base_name
}

repositories {
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}

repositories {
maven { url "https://maven.daqem.com/snapshots/" }
maven { url "https://maven.daqem.com/releases" }
loom {
silentMojangMappingsLicense()
}

dependencies {
minecraft "net.minecraft:minecraft:$rootProject.minecraft_version"
mappings loom.officialMojangMappings()
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${rootProject.parchment_version}@zip")
}
}
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
allprojects {
group = rootProject.maven_group
version = rootProject.mod_version

tasks.withType(JavaCompile).configureEach {
it.options.release = 21
task printVersionName {
doLast {
println version
}
}
}
}
1 change: 0 additions & 1 deletion buildSrc/src/main/java/NativeTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import javax.annotation.Nonnull;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class NativeTransformer implements Transformer {
Expand Down
33 changes: 6 additions & 27 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,14 @@ architectury {
}

loom {
accessWidenerPath = file("src/main/resources/grieflogger.accesswidener")
accessWidenerPath = file("src/main/resources/${rootProject.mod_id}.accesswidener")
}

apply from: rootProject.file("gradle/scripts/maven-publishing.gradle")

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
// Fabric loader for annotations/mixins (Architectury standard)
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury:${rootProject.architectury_version}"

modImplementation "com.daqem.yamlconfig:yamlconfig-common:${project.config_library_version}"
}

publishing {
publications {
mavenFabric(MavenPublication) {
groupId = rootProject.maven_group
artifactId = rootProject.archives_base_name + "-common"
from components.java
}
}

repositories {
maven {
url = project.version.contains('-PR') ? 'https://maven.daqem.com/snapshots' : 'https://maven.daqem.com/releases'
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}
modApi "dev.architectury:architectury:${project.architectury_version}"
modImplementation "com.daqem.yamlconfig:yamlconfig-common:${project.yamlconfig_version}"
}
185 changes: 9 additions & 176 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,199 +1,32 @@
plugins {
id "com.github.johnrengelman.shadow"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "2.+"
}

architectury {
platformSetupLoomIde()
fabric()
}

loom {
//noinspection GroovyAccessibility
accessWidenerPath = project(":common").loom.accessWidenerPath
}

configurations {
common {
canBeResolved = true
canBeConsumed = false
}
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentFabric.extendsFrom common

// Files in this configuration will be bundled into your mod using the Shadow plugin.
// Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
shadowBundle {
canBeResolved = true
canBeConsumed = false
}
}
apply from: rootProject.file("gradle/scripts/platform.gradle")
apply from: rootProject.file("gradle/scripts/publishing.gradle")
apply from: rootProject.file("gradle/scripts/maven-publishing.gradle")

dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowBundle project(path: ":common", configuration: "transformProductionFabric")
common(project(path: ':common', configuration: 'namedElements')) { transitive = false }
shadowBundle project(path: ':common', configuration: 'transformProductionFabric')

modApi "dev.architectury:architectury-fabric:${project.architectury_version}"
modRuntimeOnly "com.daqem.uilib:uilib-fabric:${project.uilib_version}"
modImplementation "com.daqem.yamlconfig:yamlconfig-fabric:${project.yamlconfig_version}"

modImplementation "org.xerial:sqlite-jdbc:${project.sqlite_version}"
shadowBundle "org.xerial:sqlite-jdbc:${project.sqlite_version}"

modImplementation "com.mysql:mysql-connector-j:${project.mysql_version}"
shadowBundle "com.mysql:mysql-connector-j:${project.mysql_version}"

modRuntimeOnly "com.daqem.uilib:uilib-fabric:${project.ui_library_version}"
modImplementation "com.daqem.yamlconfig:yamlconfig-fabric:${project.config_library_version}"

modCompileOnly "me.lucko:fabric-permissions-api:0.3.1"
}

processResources {
var replaceProperties = [
"version": project.version,
"mod_id": project.mod_id,
"mod_name": project.mod_name,
"mod_description": project.mod_description,
"mod_author": project.mod_author,
"mod_license": project.mod_license,
"mod_website": project.mod_website,
"mod_repository": project.mod_repository,

"minecraft_version": project.minecraft_version,
"architectury_version": project.architectury_version,
"config_library_version": project.config_library_version
]
inputs.properties replaceProperties

filesMatching(['fabric.mod.json']) {
expand replaceProperties
}
}

shadowJar {
relocate "org.sqlite", "gl_sqlite", {
exclude "org/sqlite/native/**"
exclude "og/sqlite/util/ProcessRunner.class"
}

relocate "jdbc:sqlite", "jdbc:gl_sqlite"

transform(NativeTransformer.class) {
rootDir = project.rootDir
relocateNative "org/sqlite", "gl_sqlite"
relocateNative "org_sqlite", "gl_1sqlite"
}

relocate "com.mysql", "gl_mysql"

configurations = [project.configurations.shadowBundle]
archiveClassifier = "fabric-dev-shadow"

mergeServiceFiles()
}

remapJar {
injectAccessWidener = true
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier = null
}

task renameJarForPublication(type: Zip, dependsOn: remapJar) {
from remapJar.archiveFile.map { zipTree(it) }
archiveExtension = "jar"
metadataCharset "UTF-8"
destinationDirectory = base.libsDirectory
archiveClassifier = project.name
}


assemble.dependsOn renameJarForPublication

sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}

remapSourcesJar {
archiveClassifier = "fabric-sources"
}

components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}

publishing {
publications {
mavenFabric(MavenPublication) {
groupId = rootProject.maven_group
artifactId = rootProject.archives_base_name + "-fabric"
from components.java
}
}

repositories {
maven {
url = project.version.contains('-PR') ? 'https://maven.daqem.com/snapshots' : 'https://maven.daqem.com/releases'
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}
}

curseforge {
apiKey = System.getenv("CURSEFORGE_API_KEY")
project {
id = project.curse_forge_project_id
releaseType = project.release_type
changelogType = "markdown"
changelog = rootProject.file('changelog.md')

project.supported_minecraft_versions.split(',').each { version ->
addGameVersion version
}

addGameVersion "Java 21"
addGameVersion "Fabric"

relations {
project.curseforge_dependencies.split(',').each { dep ->
requiredDependency dep.trim()
}
}

mainArtifact(remapJar) {
displayName = "$project.mod_name Fabric $project.minecraft_version - $project.mod_version"
}

addArtifact(remapSourcesJar) {
}
}
}

modrinth {
token = System.getenv("MODRINTH_API_KEY")
projectId = project.modrinth_project_id
versionName = "$project.mod_name Fabric $project.minecraft_version - $project.mod_version"
versionNumber = "$project.mod_version"
versionType = "$project.release_type"
uploadFile = remapJar
additionalFiles = [remapSourcesJar]
gameVersions = project.supported_minecraft_versions.split(',').toList()
loaders = ["fabric"]
changelog = rootProject.file('changelog.md').text
dependencies {
project.modrinth_dependencies.split(',').each { dep ->
required.project dep
}
}
}
Loading
Loading