mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-26 09:08:25 +00:00
[fix][feature]Default to the previous fully packaged logic, add a 'dist-strip' option for simplified packaging.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
# group definition.
|
||||
# 2024-04-21 Bernard Add toolchain detection in sdk packages
|
||||
# 2025-01-05 Bernard Add logging as Env['log']
|
||||
# 2025-03-02 ZhaoCake Add MkDist_Strip
|
||||
|
||||
import os
|
||||
import sys
|
||||
@@ -504,7 +505,7 @@ def GetLocalDepend(options, depend):
|
||||
# for list type depend
|
||||
for item in depend:
|
||||
if item != '':
|
||||
if not item in options or options[item] == 0:
|
||||
if not depend in options or item == 0:
|
||||
building = False
|
||||
|
||||
return building
|
||||
@@ -958,7 +959,7 @@ def GenTargetProject(program = None):
|
||||
ZigBuildProject(Env, Projects)
|
||||
|
||||
def EndBuilding(target, program = None):
|
||||
from mkdist import MkDist
|
||||
from mkdist import MkDist, MkDist_Strip
|
||||
|
||||
need_exit = False
|
||||
|
||||
@@ -986,17 +987,25 @@ def EndBuilding(target, program = None):
|
||||
|
||||
project_name = GetOption('project-name')
|
||||
project_path = GetOption('project-path')
|
||||
if GetOption('make-dist') and program != None:
|
||||
MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path)
|
||||
need_exit = True
|
||||
if GetOption('make-dist-ide') and program != None:
|
||||
import subprocess
|
||||
if not isinstance(project_path, str) or len(project_path) == 0 :
|
||||
project_path = os.path.join(BSP_ROOT, 'rt-studio-project')
|
||||
MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path)
|
||||
child = subprocess.Popen('scons --target=eclipse --project-name="{}"'.format(project_name), cwd=project_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
stdout, stderr = child.communicate()
|
||||
need_exit = True
|
||||
|
||||
# 合并处理打包相关选项
|
||||
if program != None:
|
||||
if GetOption('make-dist'):
|
||||
MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path)
|
||||
need_exit = True
|
||||
elif GetOption('dist_strip'):
|
||||
MkDist_Strip(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path)
|
||||
need_exit = True
|
||||
elif GetOption('make-dist-ide'):
|
||||
import subprocess
|
||||
if not isinstance(project_path, str) or len(project_path) == 0:
|
||||
project_path = os.path.join(BSP_ROOT, 'rt-studio-project')
|
||||
MkDist(program, BSP_ROOT, Rtt_Root, Env, project_name, project_path)
|
||||
child = subprocess.Popen('scons --target=eclipse --project-name="{}"'.format(project_name),
|
||||
cwd=project_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
stdout, stderr = child.communicate()
|
||||
need_exit = True
|
||||
|
||||
if GetOption('cscope'):
|
||||
from cscope import CscopeDatabase
|
||||
CscopeDatabase(Projects)
|
||||
|
||||
Reference in New Issue
Block a user