MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / compile

Method compile

client/tool/javawarning.py:24–46  ·  view source on GitHub ↗

编译执行函数 :param params: :return:

(self, params)

Source from the content-addressed store, hash-verified

22 CodeLintModel.__init__(self, params)
23
24 def compile(self, params):
25 """
26 编译执行函数
27 :param params:
28 :return:
29 """
30 work_dir = params.work_dir
31 build_log_path = os.path.join(work_dir, "build.log")
32 # build_err_path = os.path.join(work_dir, "build.err")
33 # 如果指定了编译log文件,则直接跳过编译
34 if "JAVAWARNING_BUILD_LOG" in os.environ:
35 return True
36 # 1. javac -Xlint:all
37 build_cmd = params.get("build_cmd")
38 if not build_cmd:
39 raise CompileTaskError("编译语言项目执行静态分析需要输入编译命令,请填入编译命令后重试!")
40 BasicCompile(
41 params,
42 sensitive=self.sensitive,
43 sensitive_word_maps=self.sensitive_word_maps,
44 build_cmd=BasicCompile.generate_shell_file(build_cmd),
45 ).compile(build_out=build_log_path, build_err=build_log_path)
46 return True
47
48 def analyze(self, params):
49 """

Callers

nothing calls this directly

Calls 4

CompileTaskErrorClass · 0.90
BasicCompileClass · 0.90
generate_shell_fileMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected