Skip to content

Commit 0fb6c5f

Browse files
committed
Sync with Framework
1 parent d110567 commit 0fb6c5f

File tree

16 files changed

+93
-76
lines changed

16 files changed

+93
-76
lines changed

.github/workflows/check-build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ on:
55
push:
66
paths: [
77
'**src/**',
8-
'**/*gradle*',
9-
LICENSE
8+
'**/*gradle*'
109
]
1110
pull_request:
1211
paths: [
1312
'**src/**',
14-
'**/*gradle*',
15-
LICENSE
13+
'**/*gradle*'
1614
]
1715
workflow_dispatch:
1816

LICENSE renamed to LICENSE.txt

File renamed without changes.

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ Copy, insert and erase text from signs using a simple GUI.
3030
</tr>
3131
</table>
3232

33-
### License
34-
35-
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
36-
3733
### Contact
3834

3935
[![Discord Server](https://img.shields.io/discord/1103153365216669797?logo=discord&label=Discord%20Server&color=%235865F2)](https://discord.terminalmc.dev)
4036

4137
[![GitHub Issues](https://img.shields.io/github/issues/TerminalMC/SignCopy?logo=github&label=GitHub%20Issues)](https://github.com/TerminalMC/SignCopy/issues)
38+
39+
[![License](https://img.shields.io/github/license/TerminalMC/SignCopy?label=License&logo=github&logoColor=white)](https://github.com/TerminalMC/SignCopy/blob/HEAD/LICENSE.txt)

build.gradle

Lines changed: 52 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@ plugins {
1111
subprojects {
1212
version = mod_version
1313
group = mod_group
14-
15-
// License headers
16-
apply(plugin: "org.cadixdev.licenser")
17-
license {
18-
// This can be done in multiloader-common.gradle but only if the
19-
// "matching" method is not used (throws a pile of weird errors).
20-
// Also, NeoForge's update of the plugin can't handle matching at all.
21-
include("**/*.java") // Java files only
22-
header = rootProject.file("NOTICE")
23-
properties {
24-
project_name = mod_name
25-
owner_name = mod_owner
26-
year = java.time.LocalDate.now().getYear().toString()
14+
15+
if (name == "common") {
16+
// License headers
17+
apply(plugin: "org.cadixdev.licenser")
18+
String licenseDir = "src/main/resources/assets/${mod_id}/license/"
19+
license {
20+
// This can be done in multiloader-common.gradle but only if the
21+
// "matching" method is not used (throws a pile of weird errors).
22+
// Also, NeoForge's update of the plugin can't handle matching at all.
23+
include("**/*.java") // Java files only
24+
header = project.file(licenseDir + "HEADER.txt")
25+
properties {
26+
project_name = mod_name
27+
owner_name = mod_owner
28+
year = java.time.LocalDate.now().getYear().toString()
29+
}
2730
}
28-
}
29-
30-
// Publishing
31-
if (name != "common") {
31+
} else {
32+
// Publishing
3233
apply(plugin: "com.modrinth.minotaur")
3334
apply(plugin: "net.darkhax.curseforgegradle")
3435
apply(plugin: "com.github.breadmoirai.github-release")
@@ -40,8 +41,8 @@ subprojects {
4041
projectId = modrinth_id
4142
versionNumber = mod_version
4243
versionType = release_type
43-
versionName = "v${mod_version}-${capsLoader(name)}-${minecraft_version}"
44-
changelog = rootProject.file("changelog.md").text
44+
versionName = "v${mod_version}-${capsLoader(name)}"
45+
changelog = versionChangelog()
4546
uploadFile = name == "fabric" ? remapJar : jar
4647
loaders = project.property("release_mod_loaders_${name}").split(",") as List
4748
gameVersions = project.property("release_game_versions_${name}").split(",") as List
@@ -76,9 +77,9 @@ subprojects {
7677
String module = project.name
7778

7879
def file = upload(curseforge_id, module == "fabric" ? remapJar : jar)
79-
file.displayName = "v${mod_version}-${capsLoader(module)}-${minecraft_version}"
80+
file.displayName = "v${mod_version}-${capsLoader(module)}"
8081
file.releaseType = release_type
81-
file.changelog = rootProject.file("changelog.md").text
82+
file.changelog = versionChangelog()
8283
file.changelogType = "markdown"
8384
project.property("release_mod_loaders_${module}").split(",").each { String id ->
8485
file.addModLoader(id)
@@ -112,8 +113,18 @@ subprojects {
112113
repo = github_repo
113114
tagName = "v${mod_version}"
114115
prerelease = release_type == "alpha" || release_type == "beta"
115-
releaseName = "v${mod_version} for ${minecraft_version}"
116-
body = rootProject.file("changelog.md").text
116+
releaseName = "v${mod_version}"
117+
118+
String changelog = "\n\n## Changelog\n\n" + versionChangelog()
119+
String versions = "## MC versions\n\n"
120+
if (project.hasProperty("release_game_versions_fabric"))
121+
versions = String.format("%s - Fabric: %s\n", versions,
122+
project.property("release_game_versions_fabric"))
123+
if (project.hasProperty("release_game_versions_neoforge"))
124+
versions = String.format("%s - NeoForge: %s\n", versions,
125+
project.property("release_game_versions_neoforge"))
126+
body = versions + changelog
127+
117128
targetCommitish = grgitService.service.get().grgit.branch.current().name
118129
overwrite = false
119130
allowUploadToExisting = true
@@ -125,6 +136,24 @@ subprojects {
125136
}
126137
}
127138

139+
String versionChangelog() {
140+
List<String> lines = rootProject.file("CHANGELOG.md").readLines()
141+
StringBuilder builder = new StringBuilder()
142+
for (int i = 4; i < lines.size(); i++) {
143+
String line = lines.get(i)
144+
if (line.isBlank()) {
145+
// pass
146+
} else if (line.startsWith("## ")) {
147+
break
148+
}
149+
else {
150+
if (!builder.isEmpty()) builder.append("\n")
151+
builder.append(line)
152+
}
153+
}
154+
return builder.toString()
155+
}
156+
128157
static String capsLoader(String loader) {
129158
switch(loader) {
130159
case "fabric": return "Fabric"

buildSrc/src/main/groovy/multiloader-common.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ repositories {
5454
}
5555

5656
sourcesJar {
57-
from(rootProject.file("LICENSE")) {
57+
from(rootProject.file("LICENSE.txt")) {
5858
rename { "${it}_${mod_name}" }
5959
}
6060
}
6161

6262
jar {
63-
from(rootProject.file("LICENSE")) {
63+
from(rootProject.file("LICENSE.txt")) {
6464
rename { "${it}_${mod_name}" }
6565
}
6666

@@ -114,7 +114,7 @@ processResources {
114114
"neoforge_loader_versions": neoforge_loader_versions,
115115
"neoforge_versions": neoforge_versions,
116116
]
117-
filesMatching(["pack.mcmeta", "*.mod.json", "META-INF/*mods.toml", "*.mixins.json"]) {
117+
filesMatching(["pack.mcmeta", "*.mod.json", "META-INF/*mods.toml", "*.mixins.json", "assets/"+mod_id+"/lang/*.json"]) {
118118
expand expandProps
119119
}
120120
inputs.properties(expandProps)

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 2.0.2
4+
5+
- Changed nothing

common/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ plugins {
55

66
dependencies {
77
compileOnly("org.spongepowered:mixin:${mixin_version}")
8-
compileOnly("io.github.llamalad7:mixinextras-common:${mixinextras_version}")
9-
annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}")
8+
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}"))
109
}
1110

1211
neoForge {
File renamed without changes.

common/src/main/resources/signcopy.mixins.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"mixins": [
88
],
99
"client": [
10-
"MixinSignBlock",
11-
"MixinAbstractSignEditScreen"
10+
"MixinAbstractSignEditScreen",
11+
"MixinSignBlock"
1212
],
1313
"server": [
1414
],

fabric/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ dependencies {
1010
parchment("org.parchmentmc.data:parchment-${parchment_minecraft_version}:${parchment_version}@zip")
1111
}
1212

13+
// Fabric loader and API
1314
modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}")
1415
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}")
16+
17+
// JiJ MixinExtras if required to be newer than minimum loader-provided version
18+
// include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${mixinextras_version}")))
1519
}
1620

1721
loom {
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
/*
2-
* Copyright 2024 TerminalMC
2+
* SignCopy by TerminalMC
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* To the extent possible under law, the person who associated CC0 with
5+
* SignCopy has waived all copyright and related or neighboring rights
6+
* to SignCopy.
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
8+
* You should have received a copy of the CC0 legalcode along with this
9+
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
1510
*/
1611

1712
package dev.terminalmc.signcopy;
@@ -21,6 +16,7 @@
2116
public class SignCopyFabric implements ClientModInitializer {
2217
@Override
2318
public void onInitializeClient() {
19+
// Main initialization
2420
SignCopy.init();
2521
}
2622
}

fabric/src/main/resources/fabric.mod.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"entrypoints": {
1717
"main": [],
1818
"client": ["${mod_group}.${mod_id}.${mod_name}Fabric"],
19-
"server": [],
20-
"modmenu": ["${mod_group}.${mod_id}.gui.screen.ModMenuIntegration"]
19+
"server": []
2120
},
2221

2322
"mixins": [
@@ -30,8 +29,7 @@
3029
"depends": {
3130
"java": [$java_versions_fabric_list],
3231
"minecraft": [$minecraft_versions_fabric_list],
33-
"fabricloader": [$fabric_loader_versions_list],
34-
"fabric-api": [$fabric_api_versions_list]
32+
"fabricloader": [$fabric_loader_versions_list]
3533
},
3634

3735
"recommends": {},

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Neo/Forge version ranges: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html
33

44
# Project
5-
mod_version=2.0.1+1.21
5+
mod_version=2.0.2+1.21
66
mod_group=dev.terminalmc
77
mod_id=signcopy
88
mod_name=SignCopy

neoforge/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ plugins {
44
}
55

66
dependencies {
7+
// JiJ MixinExtras if required to be newer than minimum loader-provided version
8+
// implementation(jarJar("io.github.llamalad7:mixinextras-neoforge:${mixinextras_version}"))
79
}
810

911
neoForge {
@@ -24,9 +26,6 @@ neoForge {
2426
client {
2527
client()
2628
}
27-
data {
28-
data()
29-
}
3029
server {
3130
server()
3231
}
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
/*
2-
* Copyright 2024 TerminalMC
2+
* SignCopy by TerminalMC
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* To the extent possible under law, the person who associated CC0 with
5+
* SignCopy has waived all copyright and related or neighboring rights
6+
* to SignCopy.
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
8+
* You should have received a copy of the CC0 legalcode along with this
9+
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
1510
*/
1611

1712
package dev.terminalmc.signcopy;
@@ -22,6 +17,7 @@
2217
@Mod(value = SignCopy.MOD_ID, dist = Dist.CLIENT)
2318
public class SignCopyNeoForge {
2419
public SignCopyNeoForge() {
20+
// Main initialization
2521
SignCopy.init();
2622
}
2723
}

settings.gradle

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,9 @@ pluginManagement {
2323
}
2424
filter { includeGroupAndSubgroups("org.spongepowered") }
2525
}
26-
exclusiveContent {
27-
forRepositories(
28-
maven {
29-
name = "NeoForge"
30-
url = "https://maven.neoforged.net/releases"
31-
}
32-
)
33-
filter { includeGroupAndSubgroups("net.neoforged.licenser") }
26+
maven {
27+
name = "NeoForge"
28+
url = "https://maven.neoforged.net/releases"
3429
}
3530
}
3631
}

0 commit comments

Comments
 (0)