菜鸟教程小白 发表于 2022-12-11 19:42:33

iOS : OCLint is not working with xcode 9. 2


                                            <p><p>我们已将 OCLint 与以下脚本集成到我们的一个项目中。</p>

<pre><code>source ~/.bash_profile
export PATH=$PATH:/usr/local/bin/

if [ -z &#34;${SCHEME+x}&#34; ]
then
export SCHEME=&#34;${PROJECT_NAME}&#34;
fi

if [ -z &#34;${WORKSPACE+x}&#34; ]
then
export WORKSPACE=&#34;${PROJECT_NAME}.xcworkspace&#34;
fi

cd &#34;${SOURCE_ROOT}&#34;

# Check if xctool and oclint are installed
if ! which -s xctool
then
echo &#39;error: xctool not found, install e.g. with homebrew&#39;
exit 1
fi

if ! which -s oclint-json-compilation-database
then
echo &#39;error: OCLint not installed, install e.g. with homebrew cask&#39;
exit 2
fi

# Cleanup before building
rm -f compile_commands.json
xctool -workspace &#34;${WORKSPACE}&#34; -scheme &#34;${SCHEME}&#34; clean &gt; /dev/null

# Build and analyze
# OCLint Rule Index: http://docs.oclint.org/en/dev/rules/index.html
xctool -workspace &#34;${WORKSPACE}&#34; -scheme &#34;${SCHEME}&#34; -reporter json-compilation-database:compile_commands.json build
oclint-json-compilation-database -e Pods -- -max-priority-1=100000 -max-priority-2=100000 -max-priority-3=100000 \

# Final cleanup
rm -f compile_commands.json
</code></pre>

<p>尽管代码包含大量警告和错误,但它给出了“零”警告和“零”错误。</p>

<p>它似乎可以在旧 XCodes 上正常工作,但不能在 XCode 9.2 上工作。</p>

<p><strong>谁能告诉我们在 xcode 9.2 中完美运行 OCLint 需要哪些更改?</strong></p>

<p>我们期望 xcode 在我们构建 OCLint 模式时显示警告。但我们现在没有得到任何结果。</p>

<p>如果我们做错了什么,请指导我们。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>几天前,当我们使用 oclint 0.11 从 xcode 8.2.1 升级到 xcode 9.2 时,我们遇到了类似的挑战
您可以尝试升级到 oclint-0.13.1 并重试看看是否有帮助。</p>

<p>还有其他一些调整,但不确定是否适合?</p>

<p> <a href="https://github.com/oclint/oclint/issues/245" rel="noreferrer noopener nofollow">https://github.com/oclint/oclint/issues/245</a>
(搜索 -fmodules 和 -gmodules 的文本,并删除所有匹配项。)</p>

<p> <a href="https://github.com/oclint/oclint/issues/302" rel="noreferrer noopener nofollow">https://github.com/oclint/oclint/issues/302</a>
(设置 CLANG_ENABLE_MODULE_DEBUGGING=NO)</p></p>
                                   
                                                <p style="font-size: 20px;">关于iOS : OCLint is not working with xcode 9. 2,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/48581395/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/48581395/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iOS : OCLint is not working with xcode 9. 2