def main():
    parser = get_parser()
    args = parser.parse_args()

    services, apps = manifests_discovery(root_dirs=args.user_app,
                                         ignore_paths=['BUILD', '.git'])

    generate_spm_code(services, apps, args.output_dir)
Example #2
0
def generate_psa_code():
    # Find all manifest files in the mbed-os tree
    service_manifest_files, test_manifest_files = manifests_discovery(
        root_dir=MBED_OS_ROOT)

    # Generate partition code for each manifest file
    generate_partitions_sources(service_manifest_files + test_manifest_files)

    # Generate default system psa setup file (only system partitions)
    generate_psa_setup(service_manifest_files, SPM_CORE_ROOT, weak_setup=True)

    tests_dict = {}
    for test_manifest in test_manifest_files:
        test_dir = os.path.dirname(test_manifest)
        if test_dir not in tests_dict:
            tests_dict[test_dir] = [test_manifest]
        else:
            tests_dict[test_dir].append(test_manifest)

    for test_dir in tests_dict:
        generate_psa_setup(service_manifest_files + tests_dict[test_dir],
                           test_dir,
                           weak_setup=False)
def generate_psa_code():
    # Find all manifest files in the mbed-os tree
    manifest_files = manifests_discovery(MBED_OS_ROOT)

    # Generate partition code for each manifest file
    generate_partitions_sources(manifest_files)

    test_manifest_files = sorted(
        [path for path in manifest_files if 'TESTS' in path])
    system_manifest_files = sorted(
        list(set(manifest_files) - set(test_manifest_files)))

    # Generate default system psa setup file (only system partitions)
    generate_psa_setup(system_manifest_files, SPM_CORE_ROOT, weak_setup=True)

    tests_dir_content = [
        path_join(SPM_TESTS_ROOT, f) for f in os.listdir(SPM_TESTS_ROOT)
    ]
    spm_tests = [path for path in tests_dir_content if os.path.isdir(path)]

    # Build a dictionary for test partition in the form of:
    # { test_root: manifest_list }
    # For each test generate specific psa setup file (system + test partitions)
    tests_dict = {test_root: [] for test_root in spm_tests}
    for test_root in spm_tests:
        tests_dict[test_root] = [
            manifest_path for manifest_path in test_manifest_files
            if test_root in manifest_path
        ]

        if not tests_dict[test_root]:
            continue
        tests_dict[test_root] += system_manifest_files
        generate_psa_setup(sorted(tests_dict[test_root]),
                           test_root,
                           weak_setup=False)
Example #4
0
def generate_tfm_code():
    service_manifests, tests_manifests = manifests_discovery(MBED_OS_ROOT)
    generate_partition_source_files(service_manifests, tests_manifests)
def generate_tfm_code():
    _, tests_manifests = manifests_discovery(TESTS_DIR)
    generate_partition_source_files(SERVICES_MANIFESTS, tests_manifests)
def main():
    services, _ = manifests_discovery(root_dir=SERVICES_DIR)
    _, tests = manifests_discovery(root_dir=TESTS_DIR)
    generate_psa_code(services, tests)
    generate_tfm_code(services, tests)