(program, BSP_ROOT, RTT_ROOT, Env, project_name, project_path)
| 175 | zip.close() |
| 176 | |
| 177 | def MkDist(program, BSP_ROOT, RTT_ROOT, Env, project_name, project_path): |
| 178 | print('make distribution....') |
| 179 | |
| 180 | if project_path == None: |
| 181 | dist_dir = os.path.join(BSP_ROOT, 'dist', project_name) |
| 182 | else: |
| 183 | dist_dir = project_path |
| 184 | |
| 185 | rtt_dir_path = os.path.join(dist_dir, 'rt-thread') |
| 186 | |
| 187 | # copy BSP files |
| 188 | print('=> %s' % os.path.basename(BSP_ROOT)) |
| 189 | bsp_copy_files(BSP_ROOT, dist_dir) |
| 190 | |
| 191 | # do bsp special dist handle |
| 192 | if 'dist_handle' in Env: |
| 193 | print("=> start dist handle") |
| 194 | dist_handle = Env['dist_handle'] |
| 195 | dist_handle(BSP_ROOT, dist_dir) |
| 196 | |
| 197 | # copy tools directory |
| 198 | print('=> components') |
| 199 | do_copy_folder(os.path.join(RTT_ROOT, 'components'), os.path.join(rtt_dir_path, 'components')) |
| 200 | |
| 201 | # skip documentation directory |
| 202 | # skip examples |
| 203 | |
| 204 | # copy include directory |
| 205 | print('=> include') |
| 206 | do_copy_folder(os.path.join(RTT_ROOT, 'include'), os.path.join(rtt_dir_path, 'include')) |
| 207 | |
| 208 | # copy all libcpu/ARCH directory |
| 209 | print('=> libcpu') |
| 210 | import rtconfig |
| 211 | do_copy_folder(os.path.join(RTT_ROOT, 'libcpu', rtconfig.ARCH), os.path.join(rtt_dir_path, 'libcpu', rtconfig.ARCH)) |
| 212 | do_copy_file(os.path.join(RTT_ROOT, 'libcpu', 'Kconfig'), os.path.join(rtt_dir_path, 'libcpu', 'Kconfig')) |
| 213 | do_copy_file(os.path.join(RTT_ROOT, 'libcpu', 'SConscript'), os.path.join(rtt_dir_path, 'libcpu', 'SConscript')) |
| 214 | |
| 215 | # copy src directory |
| 216 | print('=> src') |
| 217 | do_copy_folder(os.path.join(RTT_ROOT, 'src'), os.path.join(rtt_dir_path, 'src')) |
| 218 | |
| 219 | # copy tools directory |
| 220 | print('=> tools') |
| 221 | do_copy_folder(os.path.join(RTT_ROOT, 'tools'), os.path.join(rtt_dir_path, 'tools'), ignore_patterns('*.pyc')) |
| 222 | |
| 223 | do_copy_file(os.path.join(RTT_ROOT, 'Kconfig'), os.path.join(rtt_dir_path, 'Kconfig')) |
| 224 | do_copy_file(os.path.join(RTT_ROOT, 'AUTHORS'), os.path.join(rtt_dir_path, 'AUTHORS')) |
| 225 | do_copy_file(os.path.join(RTT_ROOT, 'COPYING'), os.path.join(rtt_dir_path, 'COPYING')) |
| 226 | do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(rtt_dir_path, 'README.md')) |
| 227 | do_copy_file(os.path.join(RTT_ROOT, 'README_zh.md'), os.path.join(rtt_dir_path, 'README_zh.md')) |
| 228 | |
| 229 | print('Update configuration files...') |
| 230 | # change RTT_ROOT in SConstruct |
| 231 | bsp_update_sconstruct(dist_dir) |
| 232 | # change RTT_ROOT in Kconfig |
| 233 | bsp_update_kconfig(dist_dir) |
| 234 | bsp_update_kconfig_library(dist_dir) |
no test coverage detected