Skip to content

Commit

Permalink
build-from-source option plumbing
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed May 27, 2024
1 parent d459f0a commit 70c69a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Lib/gftools/packager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ def assets_are_same(src: Path, dst: Path) -> bool:


def package_family(
family_path: Path, metadata: fonts_pb2.FamilyProto, latest_release=False
family_path: Path,
metadata: fonts_pb2.FamilyProto,
latest_release=False,
build_from_source=False,
):
"""Create a family into a google/fonts repo."""
log.info(f"Downloading family to '{family_path}'")
Expand Down Expand Up @@ -598,6 +601,7 @@ def make_package(
base_repo: str = "google",
head_repo: str = "google",
latest_release: bool = False,
build_from_source: bool = False,
issue_number=None,
**kwargs,
):
Expand Down Expand Up @@ -679,7 +683,9 @@ def make_package(

with current_git_state(repo, family_path):
branch = create_git_branch(metadata, repo, head_repo)
packaged = package_family(family_path, metadata, latest_release)
packaged = package_family(
family_path, metadata, latest_release, build_from_source
)
title, msg, branch = commit_family(
branch, family_path, metadata, repo, head_repo, issue_number
)
Expand Down
8 changes: 7 additions & 1 deletion Lib/gftools/scripts/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,17 @@ def main(args=None):
default="ofl",
choices=("ofl", "apache", "ufl"),
)
parser.add_argument(
obtain_group = parser.add_mutually_exclusive_group()
obtain_group.add_argument(
"--latest-release",
help="Get assets from latest upstream release",
action="store_true",
)
obtain_group.add_argument(
"--build-from-source",
help="Download and build fonts from source files",
action="store_true",
)
parser.add_argument(
"--log-level",
choices=("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"),
Expand Down

0 comments on commit 70c69a4

Please sign in to comment.