有没有人试过这个并引导我进一步.解决方法 除了您在上面指定的文章之外,我几乎没有添加任何内容.您可以按照以下步骤 *** 作,
先决条件:
>声纳
>声纳跑步者
> SonarQube Objective-C插件(许可)
> XCTool
> OClint(违规)和gcovr(代码覆盖)
> MysqL和JDK
安装步骤:
>下载并安装MysqL dmg.然后从系统偏好设置或通过命令行启动MysqL服务器,或者如果重新启动它必须是命令行.
>要开始 – sudo /usr/local/MysqL/support-files/MysqL.server start
>要重新启动 – sudo /usr/local/MysqL/support-files/MysqL.server restart
>要停止 – sudo /usr/local/MysqL/support-files/MysqL.server停止
>下载并安装最新的JDK版本.
>转到终端并输入以下命令进行安装
先决条件. (Homebrew是包
Mac *** 作系统管理系统.安装自制软件,输入命令 –
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)")
>声纳 – brew安装声纳
> Sonar-runner – brew安装声纳 – 跑步者
> XCTool – brew install xctool
> OClint – brew install oclint或
brew install https://gist.githubusercontent.com/TonyAnhTran/e1522b93853c5a456b74/raw/157549c7a77261e906fb88bc5606afd8bd727a73/oclint.rb for version 0.8.1(updated))
> gcovr – brew安装gcovr
组态:
– 设置声纳的环境路径:
export SONAR_HOME=/usr/local/Cellar/sonar-runner/2.4/libexecexport SONAR=$SONAR_HOME/binexport PATH=$SONAR:$PATH
最后命令echo $SONAR_HOME应返回路径 – /usr/local/Cellar/sonar-runner/2.4/libexec
– 设置MysqL DB:
export PATH=${PATH}:/usr/local/MysqL/binMysqL -u root;CREATE DATABASE sonar_firstdb;CREATE USER 'sonar'@'localhost' IDENTIFIED BY 'sonar';GRANT ALL PRIVILEGES ON sonar_firstdb.* TO 'sonar'@'localhost';FLUSH PRIVILEGES;exit
– 设置声纳配置设置:
vi /usr/local/Cellar/sonar/5.1.2/libexec/conf/sonar.propertIEs
您可以注释掉除凭据和MysqL之外的大多数选项,并确保输入正确的数据库名称.
例如:
sonar.jdbc.url=jdbc:MysqL://localhost:3306/**sonar_firstdb**?useUnicode=true&characterEnCoding=utf8&rewriteBatchedStatements=true
.
vi /usr/local/Cellar/sonar-runner/2.4/libexec/conf/sonar-runner.propertIEs
您可以注释掉除凭据和MysqL之外的大多数选项,并确保输入正确的数据库名称.
例如:
sonar.jdbc.url=jdbc:MysqL://localhost:3306/sonar_firstdb?useUnicode=true&characterEnCoding=utf8
>使用命令启动声纳 –
sonar start
该命令将启动声纳,因此在您选择的浏览器中导航到http://localhost:9000.登录(admin / admin)并浏览一下.
>现在你必须安装Objective-C或Swift插件.
移至设置 – >系统 – >更新中心 – >可用插件(安装所需的插件).
添加pligin后,必须重新启动声纳才能完成安装,并在安装插件后添加许可证密钥.
>通过终端转到您希望声纳检查的项目的根目录,并使用以下命令创建项目特定的属性文件:
vi sonar-project.propertIEs
添加以下项目特定属性,并根据项目编辑粗体部分.
// required configuration sonar.projectKey=**com.payoda.wordsudoku**sonar.projectname=**DragDroP**sonar.projectVersion=**1.0**sonar.language=**objc**// Project descriptionsonar.projectDescription=**Sample description**// Path to source directorIEssonar.sources=**~/path to your project**// Path to test directorIEs (comment if no test)//sonar.tests=testSrcDir// Xcode project configuration (.xcodeproj or .xcworkspace)// -> If you have a project: configure only sonar.objectivec.project// -> If you have a workspace: configure sonar.objectivec.workspace and sonar.objectivec.project// and use the later to specify which project(s) to include in the analysis (comma separated List)sonar.objectivec.project=**DragDrop.xcodeproj**// sonar.objectivec.workspace=myApplication.xcworkspace// Scheme to build your applicationsonar.objectivec.appScheme=**DragDroP**// Scheme to build and run your tests (comment following line of you don't have any tests)//sonar.objectivec.testScheme=myApplicationTests/////////////////////////// Optional configuration// EnCoding of the source codesonar.sourceEnCoding=**UTF-8**// JUnit report generated by run-sonar.sh is stored in sonar-reports/TEST-report.xml// Change it only if you generate the file on your own// Change it only if you generate the file on your own// The XML files have to be prefixed by TEST- otherwise they are not processed// sonar.junit.reportsPath=sonar-reports/// Cobertura report generated by run-sonar.sh is stored in sonar-reports/coverage.xml// Change it only if you generate the file on your own// sonar.objectivec.coverage.reportPattern=sonar-reports/coverage*.xml// OClint report generated by run-sonar.sh is stored in sonar-reports/oclint.xml// Change it only if you generate the file on your own// sonar.objectivec.oclint.report=sonar-reports/oclint.xml// Paths to exclude from coverage report (tests,3rd party librarIEs etc.)// sonar.objectivec.excludedpathsFromCoverage=pattern1,pattern2sonar.objectivec.excludedpathsFromCoverage=.*Tests.*// Project SCM settings// sonar.scm.enabled=true// sonar.scm.url=scm:git:https://...
>保存文件,您可以将其重复用于其他项目.>在项目根目录中运行命令 – sonar-runner
总结以上是内存溢出为你收集整理的objective-c – 使用Sonarqube和Xcode全部内容,希望文章能够帮你解决objective-c – 使用Sonarqube和Xcode所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)