[tools] Add project config reset feature to eclipse target.
This commit is contained in:
parent
ab81ff6815
commit
d0d15c75a2
|
@ -167,15 +167,20 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
|
||||||
default = False,
|
default = False,
|
||||||
help = 'make distribution for RT-Thread Studio IDE')
|
help = 'make distribution for RT-Thread Studio IDE')
|
||||||
AddOption('--project-path',
|
AddOption('--project-path',
|
||||||
dest = 'make-project-path',
|
dest = 'project-path',
|
||||||
type = 'string',
|
type = 'string',
|
||||||
default = False,
|
default = False,
|
||||||
help = 'set dist-ide project output path')
|
help = 'set dist-ide project output path')
|
||||||
AddOption('--project-name',
|
AddOption('--project-name',
|
||||||
dest = 'make-project-name',
|
dest = 'project-name',
|
||||||
type = 'string',
|
type = 'string',
|
||||||
default = False,
|
default = False,
|
||||||
help = 'set project name')
|
help = 'set project name')
|
||||||
|
AddOption('--reset-project-config',
|
||||||
|
dest = 'reset-project-config',
|
||||||
|
action = 'store_true',
|
||||||
|
default = False,
|
||||||
|
help = 'reset the project configurations to default')
|
||||||
AddOption('--cscope',
|
AddOption('--cscope',
|
||||||
dest = 'cscope',
|
dest = 'cscope',
|
||||||
action = 'store_true',
|
action = 'store_true',
|
||||||
|
@ -847,7 +852,8 @@ def GenTargetProject(program = None):
|
||||||
|
|
||||||
if GetOption('target') == 'eclipse':
|
if GetOption('target') == 'eclipse':
|
||||||
from eclipse import TargetEclipse
|
from eclipse import TargetEclipse
|
||||||
TargetEclipse(Env)
|
TargetEclipse(Env, GetOption('reset-project-config'), GetOption('project-name'))
|
||||||
|
|
||||||
|
|
||||||
def EndBuilding(target, program = None):
|
def EndBuilding(target, program = None):
|
||||||
import rtconfig
|
import rtconfig
|
||||||
|
@ -882,8 +888,8 @@ 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
|
||||||
project_path = GetOption('make-project-path')
|
project_path = GetOption('project-path')
|
||||||
project_name = GetOption('make-project-name')
|
project_name = GetOption('project-name')
|
||||||
|
|
||||||
if not isinstance(project_path, str) or len(project_path) == 0 :
|
if not isinstance(project_path, str) or len(project_path) == 0 :
|
||||||
print("\nwarning : --project-path=your_project_path parameter is required.")
|
print("\nwarning : --project-path=your_project_path parameter is required.")
|
||||||
|
|
Loading…
Reference in New Issue