FaceBook/infer-不同构建系统的支持
2015-06-14 16:10
155 查看
Analyzing apps or projects
比如我们要了解gradle构建系统:
目前支持的构建系统:
gradle
gradlew
后面的任务不局限与build,如果你想分析测试代码,可能使用的就是test.
文件
infer分析文件是通过javac 和clang来编译.当然你也可以使用gcc,但是gcc的内部原理还是使用clang来编译,如果你不使用clang来编译文件,infer是无法分析的.构建系统
infer支持多个构建系统(buck,gradle,maven,Xcodebuild和Make),而且可以并行的执行编译命令从而让infer变得更快,例如infer -- make -j8(不知道make -j8啥意思?自行google).考虑到不同的项目,请尽量使用clean操作在分析前保持项目的纯洁.下面详细说明每一个构建系统的使用方式,如果想查看每个构建系统的命令的使用详细信息,使用如下形式的命令了解.
infer --help -- <build system>
比如我们要了解gradle构建系统:
58deMacBook-Pro:c_hello wuxian$ infer --help -- gradle usage: infer [-h] [-o <directory>] [-i] [-g] [-a ANALYZER] [-m <analyzer_mode>] [-nf] [-v] [-j n] [-x <projectname>] [-r <githash>] [--buck] [--infer_cache <directory>] [-pr PROJECT_ROOT] [--objc_ml_buckets OBJC_ML_BUCKETS] [-nt] [-- <cmd>] optional arguments: -h, --help show this help message and exit -v, --version Get version of the analyzer global arguments: -o <directory>, --out <directory> Set the Infer results directory -i, --incremental Do not delete the results directory across Infer runs -g, --debug Generate extra debugging information -a ANALYZER, --analyzer ANALYZER Select the analyzer within: compile, capture, infer, eradicate, checkers, tracing -m <analyzer_mode>, --analyzer_mode <analyzer_mode> Select a special analyzer mode such as graphql1 or graphql2 -nf, --no-filtering Also show the results from the experimental checks. Warning: some checks may contain many false alarms backend arguments: -j n, --multicore n Set the number of cores to be used for the analysis (default uses all cores) -x <projectname>, --project <projectname> Project name, for recording purposes only -r <githash>, --revision <githash> The githash, for recording purposes only --buck To use when run with buck --infer_cache <directory> Select a directory to contain the infer cache -pr PROJECT_ROOT, --project_root PROJECT_ROOT Location of the project root (default is current directory) --objc_ml_buckets OBJC_ML_BUCKETS memory leak buckets to be checked, separated by commas. The possible buckets are cf (Core Foundation), arc, narc (No arc) -nt, --notest Prints output of symbolic execution gradle module: Run analysis of code built with a command like: gradle [options] [task] Analysis examples: infer -- gradle build infer -- ./gradlew build supported compiler/build-system commands: -- <cmd> Command to run the compiler/build-system. Supported build commands (run `infer --help -- <cmd_name>` for extra help, e.g. `infer --help -- javac`): buck, gcc, xcodebuild, javac, cc, make, gradlew, g++, clang, gradle, ant, clang++, analyze, mvn
目前支持的构建系统:
buck, gcc,xcodebuild, javac, cc, make, gradlew, g++, clang,gradle, ant, clang++, analyze, mvn
Gradle
两种方式可以分析gradle构建的项目gradle
gradlew
infer -- gradle <gradle task, e.g. "build"> infer -- ./gradlew <gradle task, e.g. "build">
后面的任务不局限与build,如果你想分析测试代码,可能使用的就是test.
Buck
infer -- buck <buck target>
Maven
infer -- mvn <maven target>
XcodeBuild
infer支持分析xcodebuild构建的app,但是只支持分析.m和
.c文件,自动忽略
.cpp,
.mm,
.cc文件后缀的文件.
infer -- xcodebuild -target <target name> -configuration <build configuration> -sdk iphonesimulator
Make
infer支持分析Make构建系统,但是会忽略C++文件
infer -- make <make target>
相关文章推荐
- css 动画效果
- JS 父页面接收子页面返回值
- json解析
- CSS多行文本固定高度的居中
- String BuffferedReader和sacnner
- CSS强制换行和禁止换行代码
- FaceBook/infer-inferTraceBugs命令使用
- CSS跑马灯
- Swap Nodes in Pairs
- 使用JSON数据格式模拟股票实时信息
- 19 Remove Nth Node From End of List(去掉链表中倒数第n个节点Easy)
- div边框弧形设计,radius的用法,CSS3 border-radius 属性
- ExtJS控件样式的修改(示例无边框panel)
- JQuery
- FaceBook/infer-infer工作流
- 剑指offer 11 - 数值的整数次方
- Maven工程错误 之 Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0
- css 动画效果1
- 纯CSS画的基本图形(矩形、圆形、三角形、多边形、爱心、八卦等)
- CSS盒子模型