2012-05-21 34 views
2

任何人都可以告诉我如何整合Sonar和Apache Buildr吗?Sonar和Apache Buildr

我从https://github.com/apache/buildr下载sonar.rb并把它放在/var/lib/gems/1.8/gems/buildr-1.4.6/addon/buildr

但我不知道该怎么称呼这个任务来自我的项目。 我已经加了

require 'buildr/sonar' 
include Buildr::Sonar 

我不知道我在哪里,必须配置声纳性能。

谢谢 Soccertrash

回答

2

声纳扩展使用底层Ant任务,并传递从buildr参数蚂蚁。您可以使用的参数将记录在Buildr的下一个版本中。但是,让你从这里开始是一个使用所有配置参数的简单示例。必须设置的唯一属性是“已启用”,而其余部分尝试设置合理的默认值。

require 'buildr/sonar' 

define "foo" do 
    project.version = "1.0.0" 

    define "bar" do ... end 

    sonar.enabled = true 
    sonar.project_name = 'Foo-Project' 
    sonar.key = 'foo:project' 
    sonar.jdbc_url = 'jdbc:jtds:sqlserver://example.org/SONAR;instance=MyInstance;SelectMethod=Cursor' 
    sonar.jdbc_driver_class_name = 'net.sourceforge.jtds.jdbc.Driver' 
    sonar.jdbc_username = 'sonar' 
    sonar.jdbc_password = 'secret' 
    sonar.host_url = 'http://127.0.0.1:9000' 
    sonar.sources << project('foo:bar')._(:source, :main, :java) 
    sonar.binaries << project('foo:bar').compile.target 
    sonar.libraries << project('foo:bar').compile.dependencies 

end 
+0

我刚刚添加了sonar.enabled = true以及所有其他属性。但没有输出消息Sonar任务已执行。我必须把Sonar.rb放在别的地方吗? 我只是运行“buildr”或“buildr install”,但是任务没有执行。 – Soccertrash

+0

我也安装了“gem install antwrap” - >没有效果 – Soccertrash