Skip to content

Commit

Permalink
ci(common): Use idf_build_apps >= 2.0 to fix pkg deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cermak committed Sep 26, 2024
1 parent 1b62adb commit eb7ea34
Showing 1 changed file with 15 additions and 36 deletions.
51 changes: 15 additions & 36 deletions ci/build_apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
This file is used in CI for esp-protocols build tests
Expand All @@ -10,8 +10,6 @@

from idf_build_apps import build_apps, find_apps, setup_logging
from idf_build_apps.constants import SUPPORTED_TARGETS
from packaging import version
from pkg_resources import get_distribution

if __name__ == '__main__':
parser = argparse.ArgumentParser(
Expand Down Expand Up @@ -51,43 +49,24 @@
SUPPORTED_TARGETS.append('linux')
ignore_warning = 'warning: ' # Ignore all common warnings on linux builds
setup_logging(2)
if version.parse(get_distribution('idf_build_apps').version) >= version.parse('2.0.0'):
apps = find_apps(
args.paths,
recursive=args.recursive,
target=args.target,
build_dir='build_@t_@w',
config_rules_str=args.rules,
build_log_filename='build_log.txt',
size_json_filename='size.json' if not args.linux else None,
check_warnings=True,
preserve=not args.delete,
manifest_files=args.manifests,
default_build_targets=SUPPORTED_TARGETS,
manifest_rootpath='.',
)
else:
apps = find_apps(
args.paths,
recursive=args.recursive,
target=args.target,
build_dir='build_@t_@w',
config_rules_str=args.rules,
build_log_path='build_log.txt',
size_json_path='size.json' if not args.linux else None,
check_warnings=True,
preserve=not args.delete,
manifest_files=args.manifests,
default_build_targets=SUPPORTED_TARGETS,
manifest_rootpath='.',
)

for app in apps:
print(app)
apps = find_apps(
args.paths,
recursive=args.recursive,
target=args.target,
build_dir='build_@t_@w',
config_rules_str=args.rules,
build_log_filename='build_log.txt',
size_json_filename='size.json' if not args.linux else None,
check_warnings=True,
manifest_files=args.manifests,
default_build_targets=SUPPORTED_TARGETS,
manifest_rootpath='.',
)

sys.exit(
build_apps(apps,
dry_run=False,
keep_going=False,
no_preserve=args.delete,
ignore_warning_strs=ignore_warning)
)

0 comments on commit eb7ea34

Please sign in to comment.