提交 8329c29f 编写于 作者: S SummerGift

[修改] 将命令格式修改为 scons --dist-ide --target-path=your__prj_path --target-name=your_prj_name

上级 5c78ab74
...@@ -163,9 +163,19 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ ...@@ -163,9 +163,19 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
help = 'make distribution and strip useless files') help = 'make distribution and strip useless files')
AddOption('--dist-ide', AddOption('--dist-ide',
dest = 'make-dist-ide', dest = 'make-dist-ide',
type = 'string', action = 'store_true',
default = False, default = False,
help = 'make distribution for rt-thread eclipse ide') help = 'make distribution for rt-thread eclipse ide')
AddOption('--project-path',
dest = 'make-project-path',
type = 'string',
default = False,
help = 'set dist-ide project output path')
AddOption('--project-name',
dest = 'make-project-name',
type = 'string',
default = False,
help = 'set dist-ide project name')
AddOption('--cscope', AddOption('--cscope',
dest = 'cscope', dest = 'cscope',
action = 'store_true', action = 'store_true',
...@@ -872,8 +882,9 @@ def EndBuilding(target, program = None): ...@@ -872,8 +882,9 @@ def EndBuilding(target, program = None):
need_exit = True need_exit = True
if GetOption('make-dist-ide') and program != None: if GetOption('make-dist-ide') and program != None:
from mkdist import MkDist from mkdist import MkDist
output_path = GetOption('make-dist-ide')[5:] project_path = GetOption('make-project-path')
rtt_ide = {'output_path': output_path} project_name = GetOption('make-project-name')
rtt_ide = {'project_path' : project_path, 'project_name' : project_name}
MkDist(program, BSP_ROOT, Rtt_Root, Env, rtt_ide) MkDist(program, BSP_ROOT, Rtt_Root, Env, rtt_ide)
need_exit = True need_exit = True
if GetOption('cscope'): if GetOption('cscope'):
......
...@@ -312,10 +312,14 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None): ...@@ -312,10 +312,14 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None):
dist_name = os.path.basename(BSP_ROOT) dist_name = os.path.basename(BSP_ROOT)
if isinstance(rttide, dict): if rttide == None:
dist_dir = rttide['output_path']
else:
dist_dir = os.path.join(BSP_ROOT, 'dist', dist_name) dist_dir = os.path.join(BSP_ROOT, 'dist', dist_name)
else:
dist_dir = rttide['project_path']
if not isinstance(dist_dir, str):
print("\n--target-path=your_project_path parameter is required.")
print("\nstop!")
return
target_path = os.path.join(dist_dir, 'rt-thread') target_path = os.path.join(dist_dir, 'rt-thread')
...@@ -377,13 +381,13 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None): ...@@ -377,13 +381,13 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None):
bsp_update_kconfig_library(dist_dir) bsp_update_kconfig_library(dist_dir)
# update all project files # update all project files
if rttide != None: if rttide == None:
bs_update_ide_project(dist_dir, target_path, rttide)
else:
bs_update_ide_project(dist_dir, target_path) bs_update_ide_project(dist_dir, target_path)
else:
bs_update_ide_project(dist_dir, target_path, rttide)
# make zip package # make zip package
if rttide != None: if rttide == None:
zip_dist(dist_dir, dist_name) zip_dist(dist_dir, dist_name)
print('done!') print('done!')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册