Skip to content

Commit

Permalink
Allow generating Java9+ modpack from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
wlhlm committed Dec 5, 2024
1 parent 72111ee commit 5deab0a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/gtnh/assembler/assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ def get_progress(self) -> float:

async def assemble(self, side: Side, verbose: bool = False) -> None:
"""
Method called to assemble the release for all the supports.
Method called to assemble the release for all the supported platforms.
:param side: the target side
:param verbose: bool flag enabling verbose mod
:return: None
"""

if side not in {side.CLIENT, side.SERVER}:
raise ValueError(f"Only valid sides are {Side.CLIENT} or {Side.SERVER}, got {side}")
if side not in {side.CLIENT, side.CLIENT_JAVA9, side.SERVER, side.SERVER_JAVA9}:
raise ValueError(f"Only valid sides are {Side.CLIENT}/{Side.CLIENT_JAVA9} or {Side.SERVER}/{Side.SERVER_JAVA9}, got {side}")

if self.current_task_reset_callback is not None:
self.current_task_reset_callback()
Expand All @@ -108,12 +108,16 @@ async def assemble(self, side: Side, verbose: bool = False) -> None:
assemblers_client if side.is_client() else assemblers_server
)

for plateform, assembling in assemblers.items():
for platform, assembling in assemblers.items():
if side.is_java9() and platform in [Archive.TECHNIC, Archive.CURSEFORGE]:
# Java 9 is currently not supported on Technic and Curse
continue

if self.current_task_reset_callback is not None:
self.current_task_reset_callback()

if self.callback:
self.callback(self.get_progress(), f"Assembling {side} {plateform} archive") # type: ignore
self.callback(self.get_progress(), f"Assembling {side} {platform} archive") # type: ignore
await assembling(side, verbose)

# TODO: Remove when the maven urls are calculated on add, instead of in curse
Expand Down Expand Up @@ -169,6 +173,7 @@ async def assemble_technic(self, side: Side, verbose: bool = False) -> None:
"""
await self.technic_assembler.assemble(side, verbose)

# Changes to this method may need updates to utils.compress_changelog()
def generate_changelog(self) -> Path:
"""
Method to generate the changelog of a release.
Expand Down
2 changes: 1 addition & 1 deletion src/gtnh/cli/assemble_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@click.command()
@click.argument("side", type=click.Choice([Side.CLIENT, Side.SERVER]))
@click.argument("side", type=click.Choice([Side.CLIENT, Side.CLIENT_JAVA9, Side.SERVER, Side.SERVER_JAVA9]))
@click.argument("release_name")
@click.option("--verbose", default=False, is_flag=True)
async def assemble_release(side: Side, release_name: str, verbose: bool) -> None:
Expand Down

0 comments on commit 5deab0a

Please sign in to comment.