MCPcopy Create free account
hub / github.com/Tencent/CodeAnalysis / __init__

Method __init__

client/tool/util/compile.py:35–58  ·  view source on GitHub ↗

编译模块构造函数 :param params:

(self, params, sensitive, sensitive_word_maps, build_cmd=None, shell=True)

Source from the content-addressed store, hash-verified

33 stop_on_output_flag = False
34
35 def __init__(self, params, sensitive, sensitive_word_maps, build_cmd=None, shell=True):
36 """
37 编译模块构造函数
38 :param params:
39 """
40 self.params = params
41 self.sensitive = sensitive
42 self.sensitive_word_maps = sensitive_word_maps
43 self.shell = shell
44 # 编译条件1: 编译命令
45 if build_cmd:
46 self.build_cmd = build_cmd
47 else:
48 self.build_cmd = params["build_cmd"]
49 if not self.build_cmd:
50 raise CompileTaskError("编译语言项目执行静态分析需要输入编译命令,请填入编译命令后重试!")
51 # 编译条件2: 编译项目路径
52 self.build_cwd = params["source_dir"]
53 build_cwd = os.environ.get("BUILD_CWD", None)
54 self.build_cwd = os.path.join(self.build_cwd, build_cwd) if build_cwd else self.build_cwd
55 # 编译条件3: 编译中断设置
56 self.stop_on_output = os.environ.get("STOP_ON_OUTPUT")
57 # 编译条件4: 执行前置命令
58 self.pre_cmd()
59
60 @staticmethod
61 def generate_shell_file(cmd, log_flag=True, shell_name="tca_build"):

Callers

nothing calls this directly

Calls 3

pre_cmdMethod · 0.95
CompileTaskErrorClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected