|
17 | 17 | GIT_TAG = GIT_REF.split("/")[-1]
|
18 | 18 | print(f"--- Git Ref: {GIT_REF} Git Tag: {GIT_TAG} ---")
|
19 | 19 |
|
| 20 | +chapter_to_chapter_number = { |
| 21 | + "onikakushi": 1, |
| 22 | + "watanagashi": 2, |
| 23 | + "tatarigoroshi": 3, |
| 24 | + "himatsubushi": 4, |
| 25 | + "meakashi": 5, |
| 26 | + "tsumihoroboshi": 6, |
| 27 | + "minagoroshi": 7, |
| 28 | + "matsuribayashi": 8, |
| 29 | + "rei": 9, |
| 30 | +} |
| 31 | + |
| 32 | +class BuildVariant: |
| 33 | + def __init__(self,chapter, unity, system, target_crc32=None): |
| 34 | + self.chapter = chapter |
| 35 | + self.unity = unity |
| 36 | + self.system = system |
| 37 | + self.target_crc32 = target_crc32 |
| 38 | + self.chapter_number = chapter_to_chapter_number[chapter] |
| 39 | + self.data_dir = f"HigurashiEp{self.chapter_number}_Data" |
| 40 | + |
| 41 | + def get_build_command(self) -> str: |
| 42 | + args = [self.chapter, self.unity, self.system] |
| 43 | + |
| 44 | + if self.target_crc32 is not None: |
| 45 | + args.append(self.target_crc32) |
| 46 | + |
| 47 | + return " ".join(args) |
| 48 | + |
20 | 49 | # List of build variants for any given chapter
|
21 | 50 | #
|
22 | 51 | # There must be a corresponding vanilla sharedassets0.assets file located at:
|
23 | 52 | # assets\vanilla\{CHAPTER_NAME}[-{CRC32}]\{OS}-{UNITY_VERSION}\sharedassets0.assets
|
24 | 53 | # for each entry.
|
25 | 54 | chapter_to_build_variants = {
|
26 | 55 | "onikakushi": [
|
27 |
| - "onikakushi 5.2.2f1 win", |
28 |
| - "onikakushi 5.2.2f1 unix", |
| 56 | + BuildVariant("onikakushi", "5.2.2f1", "win"), |
| 57 | + BuildVariant("onikakushi", "5.2.2f1", "unix"), |
29 | 58 | ],
|
30 | 59 | "watanagashi": [
|
31 |
| - "watanagashi 5.2.2f1 win", |
32 |
| - "watanagashi 5.2.2f1 unix" |
| 60 | + BuildVariant("watanagashi", "5.2.2f1", "win"), |
| 61 | + BuildVariant("watanagashi", "5.2.2f1", "unix"), |
33 | 62 | ],
|
34 | 63 | "tatarigoroshi": [
|
35 |
| - "tatarigoroshi 5.4.0f1 win", |
36 |
| - "tatarigoroshi 5.4.0f1 unix", |
37 |
| - "tatarigoroshi 5.3.5f1 win", |
38 |
| - "tatarigoroshi 5.3.4p1 win", |
39 |
| - "tatarigoroshi 5.3.4p1 unix", |
| 64 | + BuildVariant("tatarigoroshi", "5.4.0f1", "win"), |
| 65 | + BuildVariant("tatarigoroshi", "5.4.0f1", "unix"), |
| 66 | + BuildVariant("tatarigoroshi", "5.3.5f1", "win"), |
| 67 | + BuildVariant("tatarigoroshi", "5.3.4p1", "win"), |
| 68 | + BuildVariant("tatarigoroshi", "5.3.4p1", "unix"), |
40 | 69 | ],
|
41 | 70 | "himatsubushi": [
|
42 |
| - "himatsubushi 5.4.1f1 win", |
43 |
| - "himatsubushi 5.4.1f1 unix" |
| 71 | + BuildVariant("himatsubushi", "5.4.1f1", "win"), |
| 72 | + BuildVariant("himatsubushi", "5.4.1f1", "unix"), |
44 | 73 | ],
|
45 | 74 | "meakashi": [
|
46 |
| - "meakashi 5.5.3p3 win", |
47 |
| - "meakashi 5.5.3p3 unix", |
48 |
| - "meakashi 5.5.3p1 win", |
49 |
| - "meakashi 5.5.3p1 unix", |
| 75 | + BuildVariant("meakashi", "5.5.3p3", "win"), |
| 76 | + BuildVariant("meakashi", "5.5.3p3", "unix"), |
| 77 | + BuildVariant("meakashi", "5.5.3p1", "win"), |
| 78 | + BuildVariant("meakashi", "5.5.3p1", "unix"), |
50 | 79 | ],
|
51 | 80 | "tsumihoroboshi": [
|
52 |
| - "tsumihoroboshi 5.5.3p3 win", |
53 |
| - "tsumihoroboshi 5.5.3p3 unix" |
| 81 | + BuildVariant("tsumihoroboshi", "5.5.3p3", "win"), |
| 82 | + BuildVariant("tsumihoroboshi", "5.5.3p3", "unix"), |
54 | 83 | # While GOG Windows is ver 5.6.7f1, we actually downgrade back to 5.5.3p3 in the installer, so we don't need this version.
|
55 | 84 | #'tsumihoroboshi 5.6.7f1 win'
|
56 | 85 | ],
|
57 | 86 | "minagoroshi": [
|
58 |
| - "minagoroshi 5.6.7f1 win", |
59 |
| - "minagoroshi 5.6.7f1 unix" |
| 87 | + BuildVariant("minagoroshi", "5.6.7f1", "win"), |
| 88 | + BuildVariant("minagoroshi", "5.6.7f1", "unix"), |
60 | 89 | # While GOG Windows is ver 5.6.7f1, we actually downgrade back to 5.5.3p3 in the installer, so we don't need this version.
|
61 | 90 | # 'matsuribayashi 5.6.7f1 win'
|
62 | 91 | # 'matsuribayashi 5.6.7f1 unix'
|
63 | 92 | ],
|
64 | 93 | "matsuribayashi": [
|
65 |
| - "matsuribayashi 2017.2.5 unix", |
| 94 | + BuildVariant("matsuribayashi", "2017.2.5", "unix"), |
66 | 95 | # Special version for GOG/Mangagamer Linux with SHA256:
|
67 | 96 | # A200EC2A85349BC03B59C8E2F106B99ED0CBAAA25FC50928BB8BA2E2AA90FCE9
|
68 | 97 | # CRC32L 51100D6D
|
69 |
| - "matsuribayashi 2017.2.5 unix 51100D6D", |
70 |
| - "matsuribayashi 2017.2.5 win", |
| 98 | + BuildVariant("matsuribayashi", "2017.2.5", "unix", "51100D6D"), |
| 99 | + BuildVariant("matsuribayashi", "2017.2.5", "win"), |
71 | 100 | ],
|
72 | 101 | 'rei': [
|
73 |
| - 'rei 2019.4.3 win', |
74 |
| - 'rei 2019.4.4 win', |
75 |
| - 'rei 2019.4.3 unix', |
76 |
| - 'rei 2019.4.4 unix', |
| 102 | + BuildVariant("rei", "2019.4.3", "win"), |
| 103 | + BuildVariant("rei", "2019.4.4", "win"), |
| 104 | + BuildVariant("rei", "2019.4.3", "unix"), |
| 105 | + BuildVariant("rei", "2019.4.4", "unix"), |
77 | 106 | ],
|
78 | 107 | }
|
79 | 108 |
|
@@ -122,7 +151,7 @@ def get_chapter_name_from_git_tag():
|
122 | 151 | return None
|
123 | 152 |
|
124 | 153 |
|
125 |
| -def get_build_variants(selected_chapter: str) -> List[str]: |
| 154 | +def get_build_variants(selected_chapter: str) -> List[BuildVariant]: |
126 | 155 | if selected_chapter == "all":
|
127 | 156 | commands = []
|
128 | 157 | for command in chapter_to_build_variants.values():
|
@@ -275,9 +304,9 @@ def save(self):
|
275 | 304 | )
|
276 | 305 |
|
277 | 306 | # Build all the requested variants
|
278 |
| -for command in build_variants: |
279 |
| - print(f"Building .assets for {command}...") |
| 307 | +for build_variant in build_variants: |
| 308 | + print(f"Building .assets for {build_variant.get_build_command()}...") |
280 | 309 | if working_cargo:
|
281 |
| - call(f"cargo run {command}") |
| 310 | + call(f"cargo run {build_variant.get_build_command()}") |
282 | 311 | else:
|
283 |
| - call(f"ui-compiler.exe {command}") |
| 312 | + call(f"ui-compiler.exe {build_variant.get_build_command()}") |
0 commit comments