facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.97k stars 2.02k forks source link

When I use compilation database, how to perform incremental #1606

Open nianyu94 opened 2 years ago

nianyu94 commented 2 years ago

When I use compilation database, how to perform incremental?

xcodebuild build -workspace app.xcworkspace -scheme scheme -destination 'generic/platform=iOS' COMPILER_INDEX_STORE_ENABLE=NO | tee xcodebuild.log > /dev/null
xcpretty -r json-compilation-database -o compile_commands.json < xcodebuild.log > /dev/null
infer run --skip-analysis-in-path Pods --compilation-database compile_commands.json
jvillard commented 2 years ago

You can pass the list of modified files to infer with --changed-files-index so that it only analyses what is needed for these files. It will still "build" (capture) all the files in the compilation database, and analyse what is needed from scratch so it's not quite incremental, but it can still be faster than analysing everything.