聲納擴展使用底層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