Skip to content

Commit 4ae7e9a

Browse files
committed
clean up buildscripts, add neo placeholder
1 parent 829ed67 commit 4ae7e9a

File tree

7 files changed

+90
-32
lines changed

7 files changed

+90
-32
lines changed

.editorconfig

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
indent_size = 4
33
indent_style = tab
44
tab_width = 4
5+
insert_final_newline = true
56

67
[*.yml]
78
indent_size = 2

.github/workflows/build.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on: [ push, pull_request ]
44

55
jobs:
66
build:
@@ -21,4 +21,10 @@ jobs:
2121
validate-wrappers: true
2222

2323
- name: Build with Gradle
24-
run: ./gradlew build
24+
run: ./gradlew build
25+
26+
- name: capture build artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: Artifacts
30+
path: build/libs/

build.gradle

+21-13
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ plugins {
66
alias libs.plugins.minotaur
77
}
88

9-
version = "$project.baseVersion+$project.branch"
10-
archivesBaseName = project.archivesName
9+
version = "$baseVersion+$branch"
10+
archivesBaseName = project.slug
1111

1212
repositories {
1313
maven { url "https://server.bbkr.space/artifactory/libs-release" }
@@ -17,8 +17,10 @@ repositories {
1717
dependencies {
1818
minecraft libs.mc
1919
mappings variantOf(libs.yarn) { classifier "v2" }
20+
2021
modImplementation libs.fl
2122
modImplementation libs.fapi
23+
2224
modImplementation libs.libgui
2325
modImplementation libs.fpapi
2426

@@ -32,20 +34,22 @@ processResources {
3234
modId : modId,
3335
modName : modName,
3436
modDescription: modDescription,
35-
homepage : homepage,
36-
issues : issues,
37-
sources : sources,
37+
homepage : "https://modrinth.com/mod/${slug}",
38+
issues : "https://github.com/${user}/${slug}/issues",
39+
sources : "https://github.com/${user}/${slug}",
3840
license : license,
3941
authors : authors.split(", ").join("\",\n \""),
4042
contributors : contributors.split(", ").join("\",\n \""),
41-
mc : libs.versions.mc.get(),
43+
members : "${authors}. Contributions by ${contributors}",
44+
mc : compatibleVersions.split(", ")[0],
4245
fl : libs.versions.fl.get(),
4346
fapi : libs.versions.fapi.get(),
4447
libgui : libs.versions.libgui.get(),
4548
fpapi : libs.versions.fpapi.get()
4649
]
4750
inputs.properties meta
48-
filesMatching("fabric.mod.json") { expand meta }
51+
filesMatching("*.mod.json") { expand(meta) }
52+
filesMatching("META-INF/*mods.toml") { expand(meta) }
4953
}
5054

5155
tasks.withType(JavaCompile).configureEach {
@@ -55,7 +59,8 @@ tasks.withType(JavaCompile).configureEach {
5559

5660
java {
5761
withSourcesJar()
58-
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
62+
sourceCompatibility = JavaVersion.VERSION_21
63+
targetCompatibility = JavaVersion.VERSION_21
5964
}
6065

6166
jar {
@@ -73,13 +78,16 @@ publishing {
7378
}
7479

7580
modrinth {
76-
token = System.getenv("MODRINTH_TOKEN")
77-
projectId = "scattered-shards"
81+
token = "$System.env.MODRINTH_TOKEN"
82+
projectId = slug
83+
versionNumber = project.version
84+
uploadFile = remapJar
85+
gameVersions = compatibleVersions.split(", ").toList()
86+
loaders = compatibleLoaders.split(", ").toList()
87+
changelog = "$System.env.CHANGELOG"
88+
syncBodyFrom = "<!--DO NOT EDIT MANUALLY: synced from gh readme-->\n" + rootProject.file("README.md").text
7889
dependencies {
7990
required.version "fabric-api", libs.versions.fapi.get()
8091
embedded.version "fabric-permissions-api", libs.versions.fpapi.get()
8192
}
82-
changelog = System.getenv("CHANGELOG")
83-
syncBodyFrom = "<!--DO NOT EDIT MANUALLY: synced from gh readme-->\n" + rootProject.file("README.md").text
84-
uploadFile = remapJar
8593
}

gradle.properties

+7-8
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,22 @@ org.gradle.caching=true
44
org.gradle.parallel=true
55
org.gradle.caching.debug=false
66
org.gradle.configureondemand=true
7-
87
# Loom
98
fabric.loom.multiProjectOptimisation=true
10-
119
# Mod Metadata
12-
archivesName=scatteredshards
1310
group=net.modfest
11+
user=ModFest
12+
slug=scattered-shards
1413
modId=scattered_shards
1514
modName=Scattered Shards
1615
modDescription=Collectible trading cards... without the trading. Shards!
1716
authors=Falkreon, acikek
1817
contributors=Trudle, FoundationGames, TheEpicBlock, hama
19-
homepage=https://modrinth.com/mod/scattered-shards
20-
issues=https://github.com/modfest/scattered-shards/issues
21-
sources=https://github.com/modfest/scattered-shards
2218
license=MIT
23-
2419
# Mod Version
2520
baseVersion=1.6.0
26-
branch=1.21
21+
# Branch Metadata
22+
branch=1.21
23+
tagBranch=1.21
24+
compatibleVersions=1.21, 1.21.1
25+
compatibleLoaders=fabric, quilt, neoforge

settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pluginManagement {
22
repositories {
3-
maven { url 'https://maven.fabricmc.net/' }
3+
maven { url "https://maven.fabricmc.net/" }
44
gradlePluginPortal()
55
}
66
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
modLoader = "javafml"
2+
loaderVersion = "[4,)"
3+
license = "${license}"
4+
issueTrackerURL = "${issues}"
5+
6+
[[mods]]
7+
modId = "${modId}"
8+
version = "${version}"
9+
displayName = "${modName}"
10+
description = '''${modDescription}'''
11+
authors = "${members}"
12+
displayURL = "${homepage}"
13+
logoFile = "assets/${modId}/icon.png"
14+
15+
[properties]
16+
"connector:placeholder" = true
17+
18+
[[dependencies.${ modId }]]
19+
modId = "connector"
20+
type = "required"
21+
versionRange = "*"
22+
ordering = "NONE"
23+
side = "BOTH"
24+
25+
[[dependencies.${ modId }]]
26+
modId = "neoforge"
27+
type = "required"
28+
versionRange = "*"
29+
ordering = "NONE"
30+
side = "BOTH"
31+
32+
[[dependencies.${ modId }]]
33+
modId = "minecraft"
34+
type = "required"
35+
versionRange = "[${mc},)"
36+
ordering = "NONE"
37+
side = "BOTH"
38+
39+
[[dependencies.${ modId }]]
40+
modId = "fabric_api"
41+
type = "required"
42+
versionRange = "[${fapi},)"
43+
ordering = "NONE"
44+
side = "BOTH"

src/main/resources/fabric.mod.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
"sources": "${sources}"
1717
},
1818
"license": "${license}",
19-
"icon": "assets/scattered_shards/icon.png",
19+
"icon": "assets/${modId}/icon.png",
20+
"depends": {
21+
"minecraft": ">=${mc}",
22+
"fabricloader": ">=${fl}",
23+
"fabric-api": ">=${fapi}",
24+
"libgui": ">=${libgui}",
25+
"fabric-permissions-api-v0": ">=${fpapi}"
26+
},
2027
"entrypoints": {
2128
"main": [
2229
"net.modfest.scatteredshards.ScatteredShards"
2330
],
2431
"client": [
2532
"net.modfest.scatteredshards.client.ScatteredShardsClient"
2633
]
27-
},
28-
"depends": {
29-
"minecraft": ">=${mc}",
30-
"fabricloader": ">=${fl}",
31-
"fabric-api": ">=${fapi}",
32-
"fabric-permissions-api-v0": ">=${fpapi}",
33-
"libgui": ">=${libgui}"
3434
}
3535
}

0 commit comments

Comments
 (0)