声纳扩展使用底层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
我刚刚添加了sonar.enabled = true以及所有其他属性。但没有输出消息Sonar任务已执行。我必须把Sonar.rb放在别的地方吗? 我只是运行“buildr”或“buildr install”,但是任务没有执行。 – Soccertrash
我也安装了“gem install antwrap” - >没有效果 – Soccertrash