Skip to content

Commit

Permalink
Merge branch 'master' into architectury-test
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/release.yml
#	common.gradle
#	src/main/java/me/fallenbreath/template_mod/TemplateMod.java
#	versions/1.20.6-fabric/gradle.properties
#	versions/1.21-fabric/gradle.properties
  • Loading branch information
Fallen-Breath committed Aug 17, 2024
2 parents c2ce76e + bfefe81 commit 267dce6
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
steps:
- name: Get github release information
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: cardinalby/[email protected].4
uses: cardinalby/[email protected].5
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Get github release information
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get_release
uses: cardinalby/[email protected].4
uses: cardinalby/[email protected].5
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
files: ${{ steps.file_info.outputs.path }}

name: ${{ format('[{0}] {1} v{2} for mc{3}', matrix.mod_brand, steps.properties_g.outputs.mod_name, steps.properties_g.outputs.mod_version, steps.properties_v.outputs.minecraft_version) }}
version: ${{ format('mc{0}-v{1}', steps.properties_v.outputs.minecraft_version, steps.properties_g.outputs.mod_version) }}
version: ${{ format('v{1}-mc{0}-{2}', steps.properties_v.outputs.minecraft_version, steps.properties_g.outputs.mod_version, matrix.mod_brand) }}
version-type: release

loaders: ${{ matrix.mod_brand }}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
id 'com.replaymod.preprocess' version 'ce1aeb2b'

// https://github.com/Fallen-Breath/yamlang
id 'me.fallenbreath.yamlang' version '1.3.1' apply false
id 'me.fallenbreath.yamlang' version '1.4.0' apply false
}

preprocess {
Expand Down
30 changes: 17 additions & 13 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ if (mcVersion >= 12005) {
JavaVersion MIXIN_COMPATIBILITY_LEVEL = JAVA_COMPATIBILITY

loom {
def commonVmArgs = ['-Dmixin.debug.export=true', '-Dmixin.debug.countInjections=true']
runConfigs.configureEach {
// to make sure it generates all "Minecraft Client (:subproject_name)" applications
ideConfigGenerated = true
runDir '../../run'
vmArgs '-Dmixin.debug.export=true'
vmArgs commonVmArgs
}

if (mod_brand == 'forge') {
Expand All @@ -103,32 +104,35 @@ remapJar {

String modVersionSuffix = ''
String artifactVersion = project.mod_version
String artifactVersionSuffix = ''
// detect github action environment variables
// https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
if (System.getenv("BUILD_RELEASE") != "true") {
String buildNumber = System.getenv("BUILD_ID")
modVersionSuffix += buildNumber != null ? ('+build.' + buildNumber) : '-SNAPSHOT'
artifactVersion += '-SNAPSHOT' // A non-release artifact is always a SNAPSHOT artifact
artifactVersionSuffix = '-SNAPSHOT' // A non-release artifact is always a SNAPSHOT artifact
}
String finalModVersion = project.mod_version + modVersionSuffix
String fullModVersion = project.mod_version + modVersionSuffix
String fullProjectVersion, fullArtifactVersion

// Example version values:
// project.mod_version 1.0.3 (the base mod version)
// finalModVersion 1.0.3+build.88 (the actual mod version to use)
// fullProjectVersion mc1.15.2-fabric-v1.0.3+build.88 (in build output jar name)
// fullArtifactVersion mc1.15.2-fabric-v1.0.3-SNAPSHOT (maven artifact version)
// project.mod_version 1.0.3 (the base mod version)
// modVersionSuffix +build.88 (use github action build number if possible)
// artifactVersionSuffix -SNAPSHOT
// fullModVersion 1.0.3+build.88 (the actual mod version to use in the mod)
// fullProjectVersion v1.0.3-mc1.15.2-fabric+build.88 (in build output jar name)
// fullArtifactVersion 1.0.3-mc1.15.2-fabric-SNAPSHOT (maven artifact version)

group = project.maven_group
if (System.getenv("JITPACK") == "true") {
// move mc version into archivesBaseName, so jitpack will be able to organize archives from multiple subprojects correctly
base.archivesName = project.archives_base_name + '-mc' + project.minecraft_version + '-' + mod_brand
fullProjectVersion = 'v' + finalModVersion
fullArtifactVersion = 'v' + artifactVersion
fullProjectVersion = 'v' + project.mod_version + modVersionSuffix
fullArtifactVersion = artifactVersion + artifactVersionSuffix
} else {
base.archivesName = project.archives_base_name
fullProjectVersion = 'mc' + project.minecraft_version + '-' + mod_brand + '-v' + finalModVersion
fullArtifactVersion = 'mc' + project.minecraft_version + '-' + mod_brand + '-v' + artifactVersion
fullProjectVersion = 'v' + project.mod_version + '-mc' + project.minecraft_version + '-' + mod_brand + modVersionSuffix
fullArtifactVersion = artifactVersion + '-mc' + project.minecraft_version + '-' + mod_brand + artifactVersionSuffix
}
version = fullProjectVersion

Expand All @@ -137,7 +141,7 @@ version = fullProjectVersion
processResources {
inputs.property "id", project.mod_id
inputs.property "name", project.mod_name
inputs.property "version", finalModVersion
inputs.property "version", fullModVersion
inputs.property "minecraft_dependency", project.minecraft_dependency

def good_files = [] as Set
Expand All @@ -159,7 +163,7 @@ processResources {
def valueMap = [
"id": project.mod_id,
"name": project.mod_name,
"version": finalModVersion,
"version": fullModVersion,
"minecraft_dependency": project.minecraft_dependency,
]
expand valueMap
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/fallenbreath/template_mod/TemplateMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package me.fallenbreath.template_mod;

//#if MC >= 11800
//#if MC >= 11802
//$$ import com.mojang.logging.LogUtils;
//$$ import org.slf4j.Logger;
//#else
Expand Down Expand Up @@ -51,7 +51,7 @@ public class TemplateMod
//#endif
{
public static final Logger LOGGER =
//#if MC >= 11800
//#if MC >= 11802
//$$ LogUtils.getLogger();
//#else
LogManager.getLogger();
Expand Down
2 changes: 1 addition & 1 deletion versions/1.20.6-fabric/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
game_versions=1.20.5\n1.20.6

# Dependencies
# fabric_api_version=0.97.8+1.20.6
# fabric_api_version=0.100.4+1.20.6
4 changes: 2 additions & 2 deletions versions/1.21-fabric/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Loom Properties
# check these on https://fallen-breath.github.io/fabric-versions/?&version=1.21
minecraft_version=1.21
yarn_mappings=1.21+build.2
yarn_mappings=1.21+build.7
loom.platform=fabric

# Mod Metadata
Expand All @@ -14,4 +14,4 @@
game_versions=1.21

# Dependencies
# fabric_api_version=0.100.1+1.21
# fabric_api_version=0.100.4+1.21
2 changes: 1 addition & 1 deletion versions/1.21-forge/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Loom Properties
# check these on https://fallen-breath.github.io/fabric-versions/?&version=1.21
minecraft_version=1.21
yarn_mappings=1.21+build.2
yarn_mappings=1.21+build.7
loom.platform=forge

# Mod Metadata
Expand Down
2 changes: 1 addition & 1 deletion versions/1.21-neoforge/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Loom Properties
# check these on https://fallen-breath.github.io/fabric-versions/?&version=1.21
minecraft_version=1.21
yarn_mappings=1.21+build.2
yarn_mappings=1.21+build.7
loom.platform=neoforge
# https://maven.architectury.dev/dev/architectury/yarn-mappings-patch-neoforge/
yarn_mappings_patch=1.21+build.4
Expand Down

0 comments on commit 267dce6

Please sign in to comment.