Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
tools::build_api Namespace Reference
Functions | |
def | prep_report |
def | prep_properties |
def | create_result |
def | add_result_to_report |
def | get_config |
def | is_official_target |
def | transform_release_toolchains |
def | get_mbed_official_release |
def | prepare_toolchain |
def | merge_region_list |
def | scan_resources |
def | build_project |
def | build_library |
def | mbed2_obj_path |
Legacy methods ###. | |
def | build_lib |
def | build_mbed_libs |
def | get_unique_supported_toolchains |
def | mcu_toolchain_list |
def | mcu_target_list |
def | mcu_toolchain_matrix |
def | get_target_supported_toolchains |
def | print_build_results |
def | print_build_memory_usage |
def | write_build_report |
Detailed Description
mbed SDK Copyright (c) 2011-2016 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Function Documentation
def tools::build_api::add_result_to_report | ( | report, | |
result | |||
) |
Add a single result to a report dictionary Positional arguments: report - the report to append to result - the result to append
Definition at line 108 of file build_api.py.
def tools::build_api::build_lib | ( | lib_id, | |
target, | |||
toolchain_name, | |||
verbose = False , |
|||
clean = False , |
|||
macros = None , |
|||
notify = None , |
|||
jobs = 1 , |
|||
silent = False , |
|||
report = None , |
|||
properties = None , |
|||
extra_verbose = False , |
|||
build_profile = None |
|||
) |
Legacy method for building mbed libraries Positional arguments: lib_id - the library's unique identifier target - the MCU or board that the project will compile for toolchain_name - the name of the build tools Keyword arguments: clean - Rebuild everything if True verbose - Write the actual tools command lines used if True macros - additional macros notify - Notify function for logs jobs - how many compilers we can run at once silent - suppress printing of progress indicators report - a dict where a result may be appended properties - UUUUHHHHH beats me extra_verbose - even more output! build_profile - a dict of flags that will be passed to the compiler
Definition at line 808 of file build_api.py.
def tools::build_api::build_library | ( | src_paths, | |
build_path, | |||
target, | |||
toolchain_name, | |||
dependencies_paths = None , |
|||
name = None , |
|||
clean = False , |
|||
archive = True , |
|||
notify = None , |
|||
verbose = False , |
|||
macros = None , |
|||
inc_dirs = None , |
|||
jobs = 1 , |
|||
silent = False , |
|||
report = None , |
|||
properties = None , |
|||
extra_verbose = False , |
|||
project_id = None , |
|||
remove_config_header_file = False , |
|||
app_config = None , |
|||
build_profile = None |
|||
) |
Build a library Positional arguments: src_paths - a path or list of paths that contain all files needed to build the library build_path - the directory where all of the object files will be placed target - the MCU or board that the project will compile for toolchain_name - the name of the build tools Keyword arguments: dependencies_paths - The location of libraries to include when linking name - the name of the library clean - Rebuild everything if True archive - whether the library will create an archive file notify - Notify function for logs verbose - Write the actual tools command lines used if True macros - additional macros inc_dirs - additional directories where include files may be found jobs - how many compilers we can run at once silent - suppress printing of progress indicators report - a dict where a result may be appended properties - UUUUHHHHH beats me extra_verbose - even more output! project_id - the name that goes in the report remove_config_header_file - delete config header file when done building app_config - location of a chosen mbed_app.json file build_profile - a dict of flags that will be passed to the compiler
Definition at line 645 of file build_api.py.
def tools::build_api::build_mbed_libs | ( | target, | |
toolchain_name, | |||
verbose = False , |
|||
clean = False , |
|||
macros = None , |
|||
notify = None , |
|||
jobs = 1 , |
|||
silent = False , |
|||
report = None , |
|||
properties = None , |
|||
extra_verbose = False , |
|||
build_profile = None |
|||
) |
Function returns True is library was built and false if building was skipped Positional arguments: target - the MCU or board that the project will compile for toolchain_name - the name of the build tools Keyword arguments: verbose - Write the actual tools command lines used if True clean - Rebuild everything if True macros - additional macros notify - Notify function for logs jobs - how many compilers we can run at once silent - suppress printing of progress indicators report - a dict where a result may be appended properties - UUUUHHHHH beats me extra_verbose - even more output! build_profile - a dict of flags that will be passed to the compiler
Definition at line 973 of file build_api.py.
def tools::build_api::build_project | ( | src_paths, | |
build_path, | |||
target, | |||
toolchain_name, | |||
libraries_paths = None , |
|||
linker_script = None , |
|||
clean = False , |
|||
notify = None , |
|||
verbose = False , |
|||
name = None , |
|||
macros = None , |
|||
inc_dirs = None , |
|||
jobs = 1 , |
|||
silent = False , |
|||
report = None , |
|||
properties = None , |
|||
project_id = None , |
|||
project_description = None , |
|||
extra_verbose = False , |
|||
config = None , |
|||
app_config = None , |
|||
build_profile = None , |
|||
stats_depth = None |
|||
) |
Build a project. A project may be a test or a user program. Positional arguments: src_paths - a path or list of paths that contain all files needed to build the project build_path - the directory where all of the object files will be placed target - the MCU or board that the project will compile for toolchain_name - the name of the build tools Keyword arguments: libraries_paths - The location of libraries to include when linking linker_script - the file that drives the linker to do it's job clean - Rebuild everything if True notify - Notify function for logs verbose - Write the actual tools command lines used if True name - the name of the project macros - additional macros inc_dirs - additional directories where include files may be found jobs - how many compilers we can run at once silent - suppress printing of progress indicators report - a dict where a result may be appended properties - UUUUHHHHH beats me project_id - the name put in the report project_description - the human-readable version of what this thing does extra_verbose - even more output! config - a Config object to use instead of creating one app_config - location of a chosen mbed_app.json file build_profile - a dict of flags that will be passed to the compiler stats_depth - depth level for memap to display file/dirs
Definition at line 491 of file build_api.py.
def tools::build_api::create_result | ( | target_name, | |
toolchain_name, | |||
id_name, | |||
description | |||
) |
Create a result dictionary Positional arguments: target_name - the target being built for toolchain_name - the toolchain doing the building id_name - the name of the executable or library being built description - a human readable description of what's going on
Definition at line 89 of file build_api.py.
def tools::build_api::get_config | ( | src_paths, | |
target, | |||
toolchain_name | |||
) |
Get the configuration object for a target-toolchain combination Positional arguments: src_paths - paths to scan for the configuration files target - the device we are building for toolchain_name - the string that identifies the build tools
Definition at line 123 of file build_api.py.
def tools::build_api::get_mbed_official_release | ( | version ) |
Given a release version string, return a tuple that contains a target and the supported toolchains for that release. Ex. Given '2', return (('LPC1768', ('ARM', 'GCC_ARM')), ('K64F', ('ARM', 'GCC_ARM')), ...) Positional arguments: version - The version string. Should be a string contained within RELEASE_VERSIONS
Definition at line 259 of file build_api.py.
def tools::build_api::get_target_supported_toolchains | ( | target ) |
Returns target supported toolchains list Positional arguments: target - the target to get the supported toolchains of
Definition at line 1328 of file build_api.py.
def tools::build_api::get_unique_supported_toolchains | ( | release_targets = None ) |
Get list of all unique toolchains supported by targets Keyword arguments: release_targets - tuple structure returned from get_mbed_official_release(). If release_targets is not specified, then it queries all known targets
Definition at line 1139 of file build_api.py.
def tools::build_api::is_official_target | ( | target_name, | |
version | |||
) |
Returns True, None if a target is part of the official release for the given version. Return False, 'reason' if a target is not part of the official release for the given version. Positional arguments: target_name - Name if the target (ex. 'K64F') version - The release version string. Should be a string contained within RELEASE_VERSIONS
Definition at line 167 of file build_api.py.
def tools::build_api::mbed2_obj_path | ( | target_name, | |
toolchain_name | |||
) |
Legacy methods ###.
Definition at line 804 of file build_api.py.
def tools::build_api::mcu_target_list | ( | release_version = '5' ) |
Shows target list
Definition at line 1198 of file build_api.py.
def tools::build_api::mcu_toolchain_list | ( | release_version = '5' ) |
Shows list of toolchains
Definition at line 1165 of file build_api.py.
def tools::build_api::mcu_toolchain_matrix | ( | verbose_html = False , |
|
platform_filter = None , |
|||
release_version = '5' |
|||
) |
Shows target map using prettytable Keyword arguments: verbose_html - emit html instead of a simple table platform_filter - remove results that match the string release_version - get the matrix for this major version number
Definition at line 1235 of file build_api.py.
def tools::build_api::merge_region_list | ( | region_list, | |
destination, | |||
padding = b'\xFF' |
|||
) |
Merge the region_list into a single image Positional Arguments: region_list - list of regions, which should contain filenames destination - file name to write all regions to padding - bytes to fill gapps with
Definition at line 405 of file build_api.py.
def tools::build_api::prep_properties | ( | properties, | |
target_name, | |||
toolchain_name, | |||
vendor_label | |||
) |
Setup test properties Positional arguments: properties - the dict to fill target_name - the target the test is targeting toolchain_name - the toolchain that will compile the test vendor_label - the vendor
Definition at line 70 of file build_api.py.
def tools::build_api::prep_report | ( | report, | |
target_name, | |||
toolchain_name, | |||
id_name | |||
) |
Setup report keys Positional arguments: report - the report to fill target_name - the target being used toolchain_name - the toolchain being used id_name - the name of the executable or library being built
Definition at line 52 of file build_api.py.
def tools::build_api::prepare_toolchain | ( | src_paths, | |
build_dir, | |||
target, | |||
toolchain_name, | |||
macros = None , |
|||
clean = False , |
|||
jobs = 1 , |
|||
notify = None , |
|||
silent = False , |
|||
verbose = False , |
|||
extra_verbose = False , |
|||
config = None , |
|||
app_config = None , |
|||
build_profile = None |
|||
) |
Prepares resource related objects - toolchain, target, config Positional arguments: src_paths - the paths to source directories target - ['LPC1768', 'LPC11U24', etc.] toolchain_name - ['ARM', 'uARM', 'GCC_ARM', 'GCC_CR'] Keyword arguments: macros - additional macros clean - Rebuild everything if True jobs - how many compilers we can run at once notify - Notify function for logs silent - suppress printing of progress indicators verbose - Write the actual tools command lines used if True extra_verbose - even more output! config - a Config object to use instead of creating one app_config - location of a chosen mbed_app.json file build_profile - a list of mergeable build profiles
Definition at line 293 of file build_api.py.
def tools::build_api::print_build_memory_usage | ( | report ) |
Generate result table with memory usage values for build results Aggregates (puts together) reports obtained from self.get_memory_summary() Positional arguments: report - Report generated during build procedure.
Definition at line 1352 of file build_api.py.
def tools::build_api::print_build_results | ( | result_list, | |
build_name | |||
) |
Generate result string for build results Positional arguments: result_list - the list of results to print build_name - the name of the build we are printing result for
Definition at line 1338 of file build_api.py.
def tools::build_api::scan_resources | ( | src_paths, | |
toolchain, | |||
dependencies_paths = None , |
|||
inc_dirs = None , |
|||
base_path = None , |
|||
collect_ignores = False |
|||
) |
Scan resources using initialized toolcain Positional arguments src_paths - the paths to source directories toolchain - valid toolchain object dependencies_paths - dependency paths that we should scan for include dirs inc_dirs - additional include directories which should be added to the scanner resources
Definition at line 450 of file build_api.py.
def tools::build_api::transform_release_toolchains | ( | toolchains, | |
version | |||
) |
Given a list of toolchains and a release version, return a list of only the supported toolchains for that release Positional arguments: toolchains - The list of toolchains version - The release version string. Should be a string contained within RELEASE_VERSIONS
Definition at line 244 of file build_api.py.
def tools::build_api::write_build_report | ( | build_report, | |
template_filename, | |||
filename | |||
) |
Write a build report to disk using a template file Positional arguments: build_report - a report generated by the build system template_filename - a file that contains the template for the style of build report filename - the location on disk to write the file to
Definition at line 1397 of file build_api.py.
Generated on Tue Jul 12 2022 14:27:17 by
