由于我们的项目非常庞大,并且将所有目标组合成单个编译+分析+发布将需要很长时间才能完成。所以我想并行运行 klocwork 分析。
这是我现在所拥有的(在各种子任务中拆分目标):
kw-analysis -> kw-analysis-sub-1
| -> kw-analysis-sub-2
| -> ...
| -> kw-analysis-sub-n
| |
| + the sub-task will handle:
| 1. compile single target and generate spec: kwinject_<target_name>.out :
| $ export KWWRAP_HOOKS_DIR='/temp/kw/hooks'
| $ export PATH=${KWWRAP_HOOKS_DIR}:$PATH
| $ make <target_name>
| $ kwinject --trace-in "/temp/kw/kwwrap.trace" --output "kwinject_<target_name>.out"
| 2. trace and anslysis for each target:
| $ kwbuildproject --url "<https://url:port>/<project_name>" [-I] --table-directory kwtable_<target_name> kwinject_<target_name>.out
| 3. archive kwtable_<target_name> folder
|
+ leading job will do:
1. copy all kwtable_<target_name> from sub-analysis jobs (downstream jobs)
2. deploy and publish the result into klocwork sever once for all
<<<<<< this is the key point of parallel analysis
据我所知,发布单个 kwtable 可以是:
$ kwadmin --url <https://url:port> load --name <build_name> <project_name> kwtable_<target_name>
但是,似乎kwadmin
既不支持多个 kwtabels 通过:
kwadmin load --name <build_name> ... kwtable_<target_name_1> kwtable_<target_name_2> ...
也不支持在存在的构建中添加额外的结果
$ kwadmin load --name <build_name> ... kwtable_<target_name_1>
|
+ create build first
$ kwadmin "append" --name <build_name> ... kwtable_<target_name_2>
*
+ append new result in <build_name> for anothers kwtables folder
那么,有什么方法可以并行运行 klocwork 分析。顺便说一句,我正在使用 Jenkins 作为集成工具