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)

[((46, 57), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (55, 57), False, 'import os\n'), ((278, 313), 'os.path.join', 'os.path.join', (['dist_dir', '"""libraries"""'], {}), "(dist_dir, 'libraries')\n", (290, 313), False, 'import os\n'), ((433, 474), 'mkdist.bsp_copy_files', 'bsp_copy_files', (['library_path', 'library_dir'], {}), '(library_path, library_dir)\n', (447, 474), False, 'from mkdist import bsp_copy_files\n'), ((87, 112), 'os.path.dirname', 'os.path.dirname', (['cwd_path'], {}), '(cwd_path)\n', (102, 112), False, 'import os\n'), ((388, 413), 'os.path.dirname', 'os.path.dirname', (['BSP_ROOT'], {}), '(BSP_ROOT)\n', (403, 413), False, 'import os\n')]