import os
import sys
import shutil
cwd_path = os.getcwd()
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))

# BSP dist function
def dist_do_building(BSP_ROOT, dist_dir):
    from mkdist import bsp_copy_files
    import rtconfig

    library_dir  = os.path.join(dist_dir, 'libraries')

    print("=> copy nrf52 bsp libraries")
    library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')

    bsp_copy_files(library_path, library_dir)

[((4, 11, 4, 22), 'os.getcwd', 'os.getcwd', ({}, {}), '()', False, 'import os\n'), ((12, 19, 12, 54), 'os.path.join', 'os.path.join', ({(12, 32, 12, 40): 'dist_dir', (12, 42, 12, 53): '"""libraries"""'}, {}), "(dist_dir, 'libraries')", False, 'import os\n'), ((17, 4, 17, 45), 'mkdist.bsp_copy_files', 'bsp_copy_files', ({(17, 19, 17, 31): 'library_path', (17, 33, 17, 44): 'library_dir'}, {}), '(library_path, library_dir)', False, 'from mkdist import bsp_copy_files\n'), ((5, 29, 5, 54), 'os.path.dirname', 'os.path.dirname', ({(5, 45, 5, 53): 'cwd_path'}, {}), '(cwd_path)', False, 'import os\n'), ((15, 32, 15, 57), 'os.path.dirname', 'os.path.dirname', ({(15, 48, 15, 56): 'BSP_ROOT'}, {}), '(BSP_ROOT)', False, 'import os\n')]