Skip to content
This repository was archived by the owner on Mar 22, 2026. It is now read-only.

Commit c6187f6

Browse files
committed
[TouchController] 修复 TouchController API 的打包
1 parent c0108e8 commit c6187f6

5 files changed

Lines changed: 49 additions & 2 deletions

File tree

touchcontroller/api/BUILD.bazel

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
12
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
23
load("//rule:maven_publish.bzl", "java_export")
34
load("//rule:mod_info_jar.bzl", "mod_info_jar")
@@ -19,13 +20,34 @@ expand_template(
1920
template = "resources/fabric.mod.json",
2021
)
2122

23+
expand_template(
24+
name = "mcmod_info",
25+
out = "mcmod.info",
26+
substitutions = substitutions,
27+
template = "resources/mcmod.info",
28+
)
29+
2230
expand_template(
2331
name = "neoforge_mods_toml",
2432
out = "META-INF/neoforge.mods.toml",
2533
substitutions = substitutions,
2634
template = "resources/META-INF/neoforge.mods.toml",
2735
)
2836

37+
expand_template(
38+
name = "mods_toml",
39+
out = "META-INF/mods.toml",
40+
substitutions = substitutions,
41+
template = "resources/META-INF/mods.toml",
42+
)
43+
44+
copy_file(
45+
name = "icon",
46+
src = "//touchcontroller/resources/texture:icon",
47+
out = "icon.png",
48+
is_executable = False,
49+
)
50+
2951
java_export(
3052
name = "api",
3153
srcs = glob(["**/*.java"]),
@@ -34,6 +56,9 @@ java_export(
3456
resource_strip_prefix = "touchcontroller/api",
3557
resources = [
3658
":fabric_mod_json",
59+
":icon",
60+
":mcmod_info",
61+
":mods_toml",
3762
":neoforge_mods_toml",
3863
],
3964
visibility = ["//touchcontroller:__subpackages__"],
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
modLoader = "javafml"
2+
loaderVersion = "[0,)"
3+
license = "${license}"
4+
issueTrackerURL = "${issue_tracker}"
5+
6+
[[mods]]
7+
modId = "touchcontroller_api"
8+
version = "${version}"
9+
displayName = "TouchController API"
10+
displayURL = "${home_page}"
11+
authors = "fifth_light"
12+
description = "${description}"
13+
logoFile = "icon.png"

touchcontroller/api/resources/META-INF/neoforge.mods.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ issueTrackerURL="${issue_tracker}"
44
[[mods]]
55
modId="touchcontroller_api"
66
version="${version}"
7-
displayName="${name}"
7+
displayName="TouchController API"
88
displayURL="${home_page}"
99
logoFile="icon.png"
1010
authors="fifth_light"

touchcontroller/api/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"schemaVersion": 1,
33
"id": "touchcontroller-api",
44
"version": "${version}",
5-
"name": "${name}",
5+
"name": "TouchController API",
66
"description": "${description}",
77
"authors": ["fifth_light"],
88
"license": "${license}",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[{
2+
"modid": "touchcontroller_api",
3+
"name": "TouchController API",
4+
"version": "${version}",
5+
"description": "${description}",
6+
"authorList": ["fifth_light"],
7+
"url": "${home_page}",
8+
"logoFile": "icon.png"
9+
}]

0 commit comments

Comments
 (0)