Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Jul 9, 2024
1 parent 48c91d9 commit 2b131cf
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 33 deletions.
52 changes: 19 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
plugins {
id "dev.architectury.loom" version "1.6-SNAPSHOT"
alias(libs.plugins.architectury.loom)
alias(libs.plugins.modpublisher)
id "maven-publish"
id "com.hypherionmc.modutils.modpublisher" version "2.+"
}

base.archivesName = project.archives_base_name
version = "${project.mod_version}-mc${project.minecraft_version}"
group = project.maven_group
base.archivesName = libs.versions.archives.name
version = "${libs.versions.version.get()}-mc${libs.versions.minecraft.version.get()}"
group = libs.versions.maven.group

repositories {
maven { url "https://www.jitpack.io" }
maven { url "https://maven.neoforged.net/releases/" }
maven { url 'https://api.modrinth.com/maven' }
maven { url "https://www.jitpack.io" }
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
minecraft libs.minecraft
mappings loom.layered {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
mappings "dev.architectury:yarn-mappings-patch-${loom.platform.get().id()}:${project.yarn_patch}"
mappings variantOf(libs.yarn.mappings) { classifier("v2") }
mappings libs.yarn.mappings.patch
}
neoForge "net.neoforged:neoforge:${project.neoforge_version}"
neoForge libs.neoforge

modImplementation "maven.modrinth:mafglib:${project.malilib_version}"
modImplementation("maven.modrinth:neonetwork:${project.neonetwork_version}")
modImplementation libs.mafglib
modImplementation libs.neonetwork

implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation libs.jsr305
}

processResources {
Expand All @@ -48,26 +48,12 @@ java {
withSourcesJar()
}

jar {
manifest {
attributes([
"Specification-Title" : project.mod_id,
"Specification-Vendor" : project.mod_author,
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : version,
"Implementation-Vendor" : project.mod_author,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
Expand All @@ -85,14 +71,14 @@ publisher {
curseforge System.getenv("CURSEFORGE_TOKEN")
}

setCurseID("${project.curseforge_id}")
setModrinthID("${project.modrinth_id}")
setCurseID("${libs.versions.id.curseforge.get()}")
setModrinthID("${libs.versions.id.modrinth.get()}")
setVersionType("alpha")
setChangelog(file("CHANGELOG.md").getText("UTF-8"))
setVersion("${project.version}")
setDisplayName("${project.version}")
setGameVersions("1.20.5", "1.20.6")
setLoaders("neoforge")
setGameVersions(libs.versions.minecraft.range.get())
setLoaders(loom.platform.get().id())
setCurseEnvironment("client")
setArtifact(remapJar)
addAdditionalFile(sourcesJar)
Expand Down
45 changes: 45 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[versions]

minecraft-range="1.21"

# Base properties
minecraft_version="1.21"
yarn_mappings="1.21+build.2"
mappings_patch="1.21+build.4"
neoforge="21.0.60-beta"

# Mod properties
version="0.1.3"
maven-group="org.thinkingstudio.bocchud"
archives-name="BoccHUD"

# Publish properties
id-modrinth="zfPoD7Tm"
id-curseforge="916504"

# Mod dependencies
mafglib="0.1.14-mc1.21"
neonetwork="0.1.5+mc1.21"

# Libraries
jsr305="3.0.2"

# Gradle plugin
architectury-loom = "1.6-SNAPSHOT"
modpublisher = "2.1.+"

[libraries]
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft_version" }
yarn-mappings = { group = "net.fabricmc", name = "yarn", version.ref = "yarn_mappings"}
yarn-mappings-patch = { group = "dev.architectury", name = "yarn-mappings-patch-neoforge", version.ref = "mappings_patch"}

neoforge = { group = "net.neoforged", name = "neoforge", version.ref = "neoforge" }
neonetwork = { group = "maven.modrinth", name = "neonetwork", version.ref = "neonetwork" }
mafglib = { group = "maven.modrinth", name = "mafglib", version.ref = "mafglib"}


jsr305 = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "jsr305"}

[plugins]
architectury-loom = { id = "dev.architectury.loom", version.ref = "architectury-loom" }
modpublisher = { id = "com.hypherionmc.modutils.modpublisher", version.ref = "modpublisher" }

0 comments on commit 2b131cf

Please sign in to comment.