Эх сурвалжийг харах

[Sconscript] 增加编译过程中自动删除原仓库无用文件

Meco Man 4 жил өмнө
parent
commit
85dea04a19
1 өөрчлөгдсөн 13 нэмэгдсэн , 0 устгасан
  1. 13 0
      SConscript

+ 13 - 0
SConscript

@@ -1,5 +1,8 @@
 # RT-Thread building script for component
 
+import os
+import shutil
+
 from building import *
 
 cwd = GetCurrentDir()
@@ -7,6 +10,16 @@ src = Glob('*.c') + Glob('*.cpp')
 CPPPATH = [cwd]
 CPPDEFINES = ['LFS_CONFIG=lfs_config.h']
 
+#delate non-used files
+try:
+    shutil.rmtree(os.path.join(cwd,'.github'))
+    shutil.rmtree(os.path.join(cwd,'bd'))
+    shutil.rmtree(os.path.join(cwd,'scripts'))
+    shutil.rmtree(os.path.join(cwd,'tests'))
+    os.remove(os.path.join(cwd,'Makefile'))
+except:
+    pass
+
 group = DefineGroup('littlefs', src, depend = ['PKG_USING_LITTLEFS', 'RT_USING_DFS'], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
 
 Return('group')