summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-05-14 20:31:12 +0800
committerGitHub <[email protected]>2021-05-14 20:31:12 +0800
commit19db57cde4fce8a89a96eafb6b0467f7655aac1c (patch)
tree27cc06f1cd3eb8d4025bf67528a584bb4ca488a5
parent0e8a2643840683eab9199921ee7c0c8de05562c0 (diff)
parent3369a2c1c89a79b4e773ace71c81b5f42b35e4d0 (diff)
Merge pull request #4687 from Guozhanxin/utest
[fix] Fix the problem of an error when opening menuconfig after the p…
-rw-r--r--tools/mkdist.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/mkdist.py b/tools/mkdist.py
index 7765873baa..a29db7b080 100644
--- a/tools/mkdist.py
+++ b/tools/mkdist.py
@@ -105,6 +105,18 @@ def bsp_update_sconstruct(dist_dir):
f.write('if not os.getenv("RTT_ROOT"): \n RTT_ROOT="rt-thread"\n\n')
f.write(line)
+def bsp_update_kconfig_testcases(dist_dir):
+ # delete testcases in rt-thread/Kconfig
+ if not os.path.isfile(os.path.join(dist_dir, 'rt-thread/Kconfig')):
+ return
+
+ with open(os.path.join(dist_dir, 'rt-thread/Kconfig'), 'r') as f:
+ data = f.readlines()
+ with open(os.path.join(dist_dir, 'rt-thread/Kconfig'), 'w') as f:
+ for line in data:
+ if line.find('examples/utest/testcases/Kconfig') == -1:
+ f.write(line)
+
def bsp_update_kconfig(dist_dir):
# change RTT_ROOT in Kconfig
if not os.path.isfile(os.path.join(dist_dir, 'Kconfig')):
@@ -307,11 +319,14 @@ def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env):
do_copy_file(os.path.join(RTT_ROOT, 'libcpu', 'Kconfig'), os.path.join(target_path, 'libcpu', 'Kconfig'))
do_copy_file(os.path.join(RTT_ROOT, 'libcpu', 'SConscript'), os.path.join(target_path, 'libcpu', 'SConscript'))
+ print('Update configuration files...')
# change RTT_ROOT in SConstruct
bsp_update_sconstruct(dist_dir)
# change RTT_ROOT in Kconfig
bsp_update_kconfig(dist_dir)
bsp_update_kconfig_library(dist_dir)
+ # delete testcases in Kconfig
+ bsp_update_kconfig_testcases(dist_dir)
# update all project files
bs_update_ide_project(dist_dir, target_path)
@@ -374,12 +389,14 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None):
do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(target_path, 'README.md'))
do_copy_file(os.path.join(RTT_ROOT, 'README_zh.md'), os.path.join(target_path, 'README_zh.md'))
+ print('Update configuration files...')
# change RTT_ROOT in SConstruct
bsp_update_sconstruct(dist_dir)
# change RTT_ROOT in Kconfig
bsp_update_kconfig(dist_dir)
bsp_update_kconfig_library(dist_dir)
-
+ # delete testcases in Kconfig
+ bsp_update_kconfig_testcases(dist_dir)
# update all project files
if rttide == None:
bs_update_ide_project(dist_dir, target_path)