Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow generating Java9+ modpacks from CLI #182

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/gtnh/assembler/assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,17 @@ 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 +110,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 +175,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
Loading