diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/building.py | 14 | ||||
| -rw-r--r-- | tools/file_check.py | 1 | ||||
| -rw-r--r-- | tools/menuconfig.py | 27 |
3 files changed, 33 insertions, 9 deletions
diff --git a/tools/building.py b/tools/building.py index 90554a3082..32ce449622 100644 --- a/tools/building.py +++ b/tools/building.py @@ -448,7 +448,8 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ duplicate=0, exports='remove_components')) # include testcases - objs.extend(SConscript(Rtt_Root + '/examples/utest/testcases/SConscript', + if os.path.isfile(os.path.join(Rtt_Root, 'examples/utest/testcases/SConscript')): + objs.extend(SConscript(Rtt_Root + '/examples/utest/testcases/SConscript', variant_dir=kernel_vdir + '/examples/utest/testcases', duplicate=0)) @@ -924,14 +925,11 @@ def EndBuilding(target, program = None): project_name = GetOption('project-name') if not isinstance(project_path, str) or len(project_path) == 0 : - print("\nwarning : --project-path=your_project_path parameter is required.") - print("\nstop!") - exit(0) - + project_path = os.path.join(BSP_ROOT, 'dist_ide_project') + print("\nwarning : --project-path not specified, use default path: {0}.".format(project_path)) if not isinstance(project_name, str) or len(project_name) == 0: - print("\nwarning : --project-name=your_project_name parameter is required.") - print("\nstop!") - exit(0) + project_name = "dist_ide_project" + print("\nwarning : --project-name not specified, use default project name: {0}.".format(project_name)) rtt_ide = {'project_path' : project_path, 'project_name' : project_name} MkDist(program, BSP_ROOT, Rtt_Root, Env, rtt_ide) diff --git a/tools/file_check.py b/tools/file_check.py index 046b2a009f..63767782b5 100644 --- a/tools/file_check.py +++ b/tools/file_check.py @@ -84,6 +84,7 @@ class CheckOut: try: os.system('git remote add rtt_repo {}'.format(self.rtt_repo)) os.system('git fetch rtt_repo') + os.system('git merge rtt_repo/{}'.format(self.rtt_branch)) os.system('git reset rtt_repo/{} --soft'.format(self.rtt_branch)) os.system('git status > git.txt') except Exception as e: diff --git a/tools/menuconfig.py b/tools/menuconfig.py index c0a33718de..853e4fe7f8 100644 --- a/tools/menuconfig.py +++ b/tools/menuconfig.py @@ -217,8 +217,27 @@ def touch_env(): if os.path.exists(os.path.join(env_dir, 'tools', 'scripts')): os.environ["PATH"] = os.path.join(env_dir, 'tools', 'scripts') + ';' + os.environ["PATH"] +# Exclude utestcases +def exclude_utestcases(RTT_ROOT): + if os.path.isfile(os.path.join(RTT_ROOT, 'examples/utest/testcases/Kconfig')): + return + + if not os.path.isfile(os.path.join(RTT_ROOT, 'Kconfig')): + return + + with open(os.path.join(RTT_ROOT, 'Kconfig'), 'r') as f: + data = f.readlines() + with open(os.path.join(RTT_ROOT, 'Kconfig'), 'w') as f: + for line in data: + if line.find('examples/utest/testcases/Kconfig') == -1: + f.write(line) + # menuconfig for Linux def menuconfig(RTT_ROOT): + + # Exclude utestcases + exclude_utestcases(RTT_ROOT) + kconfig_dir = os.path.join(RTT_ROOT, 'tools', 'kconfig-frontends') os.system('scons -C ' + kconfig_dir) @@ -250,6 +269,9 @@ def menuconfig(RTT_ROOT): def guiconfig(RTT_ROOT): import pyguiconfig + # Exclude utestcases + exclude_utestcases(RTT_ROOT) + if sys.platform != 'win32': touch_env() @@ -260,7 +282,7 @@ def guiconfig(RTT_ROOT): fn = '.config' fn_old = '.config.old' - sys.argv = ['guiconfig', 'Kconfig']; + sys.argv = ['guiconfig', 'Kconfig'] pyguiconfig._main() if os.path.isfile(fn): @@ -281,6 +303,9 @@ def guiconfig(RTT_ROOT): def guiconfig_silent(RTT_ROOT): import defconfig + # Exclude utestcases + exclude_utestcases(RTT_ROOT) + if sys.platform != 'win32': touch_env() |
