support bundling only specific boards (#166)

Support bundling only specified boards and skipping
the examples. This speedsup the process in case
the developer is only working on specific boards
at a time. By default every example and every board
are bundled.

Signed-off-by: Tobias Kohlbau <tobias@kohlbau.de>
wch-ch32v003
Tobias Kohlbau 7 months ago committed by GitHub
parent be113c7adc
commit e9859fbab2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -14,7 +14,7 @@ from dataclasses_json import dataclass_json, config as dcj_config, Exclude as J
from semver import Version from semver import Version
from marshmallow import fields from marshmallow import fields
from enum import Enum as StrEnum from enum import Enum as StrEnum
from argparse import ArgumentParser from argparse import ArgumentParser, BooleanOptionalAction
import pathspec import pathspec
import stat import stat
import tarfile import tarfile
@ -231,6 +231,9 @@ def get_batch_timestamp():
iso=render_time.isoformat(), iso=render_time.isoformat(),
) )
def list_of_str(arg):
return arg.split(',')
def main(): def main():
@ -238,6 +241,8 @@ def main():
arg_parser.add_argument("--base-url", type=str, required=False, default=DEFAULT_DEPLOYMENT_BASE, help="Sets the download URL for the packages.") arg_parser.add_argument("--base-url", type=str, required=False, default=DEFAULT_DEPLOYMENT_BASE, help="Sets the download URL for the packages.")
arg_parser.add_argument("--debug", action="store_true", required=False, default=False, help="Creates a deployment for local development, hosted by localhost:8080") arg_parser.add_argument("--debug", action="store_true", required=False, default=False, help="Creates a deployment for local development, hosted by localhost:8080")
arg_parser.add_argument("--examples", action=BooleanOptionalAction, required=False, default=True, help="Build the examples")
arg_parser.add_argument("--boards", type=list_of_str, help='list of boards to build', default=[])
cli_args = arg_parser.parse_args() cli_args = arg_parser.parse_args()
@ -296,6 +301,13 @@ def main():
pkg_dict = json.loads(meta_path.read_bytes()) pkg_dict = json.loads(meta_path.read_bytes())
pkg = PackageConfigurationSchema.load(pkg_dict) pkg = PackageConfigurationSchema.load(pkg_dict)
# Skip examples or non enabled boards
if any([
pkg.package_type == PackageType.example and not cli_args.examples,
pkg.package_type == PackageType.board_support and cli_args.boards and pkg.package_name not in cli_args.boards
]):
continue
pkg.version = version pkg.version = version
pkg.created = batch_timestamp pkg.created = batch_timestamp
pkg.package_dir = pkg_dir pkg.package_dir = pkg_dir
@ -517,4 +529,4 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()

Loading…
Cancel
Save