Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.

Commit

Permalink
Basic version gate for new android build command
Browse files Browse the repository at this point in the history
Related to #11
  • Loading branch information
kobaltcore committed May 14, 2022
1 parent da8b119 commit 5c0c25b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ renotize = "^1.5.3"
diff-match-patch = "^20200713"
PyYAML = "^5.4.1"
rich = "^10.16.2"
semantic-version = "^2.9.0"

[tool.poetry.dev-dependencies]
flake8 = "^4.0.1"
Expand Down
26 changes: 19 additions & 7 deletions renconstruct/renconstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from subprocess import run, Popen, PIPE, STDOUT
from importlib import import_module, invalidate_caches

### Versioning ###
from semantic_version import Version

### Logging ###
from rich.text import Text
from rich.logging import RichHandler
Expand Down Expand Up @@ -395,13 +398,22 @@ def cli(project, output, config, debug):
if config["build"]["android"]:
with gha_group("Build Android"):
logger.info("Building Android package")
cmd = "renutil {} launch {} -h android_build \
{} assembleRelease --destination {}".format(
registry_cmd,
config["renutil"]["version"],
shlex.quote(config["project"]),
shlex.quote(config["output"]),
)
if Version(config["renutil"]["version"]) >= Version("7.4.9"):
cmd = "renutil {} launch {} -h android_build \
{} --destination {}".format(
registry_cmd,
config["renutil"]["version"],
shlex.quote(config["project"]),
shlex.quote(config["output"]),
)
else:
cmd = "renutil {} launch {} -h android_build \
{} assembleRelease --destination {}".format(
registry_cmd,
config["renutil"]["version"],
shlex.quote(config["project"]),
shlex.quote(config["output"]),
)
proc = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT)
for line in proc.stdout:
line = str(line.strip(), "utf-8")
Expand Down

0 comments on commit 5c0c25b

Please sign in to comment.