Skip to content

Latest commit

 

History

History
64 lines (40 loc) · 1.22 KB

README.md

File metadata and controls

64 lines (40 loc) · 1.22 KB

sbt-sonar

SBT plugin to generate sonar properties for projects.

Work in progress without warranties.

It should work with SBT 0.11.3, 0.12.x and 0.13.0.

Usage

Add to project/plugins.sbt:

//release versions will be pushed to Maven Central
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

addSbtPlugin("info.schleichardt" % "sbt-sonar" % "TODO")

Add to build.sbt (project/Build.scala see beyond):

sonarSettings

OR project/Build.scala:

import info.schleichardt.sbt.sonar.SbtSonarPlugin._

val main = project(...).settings(sonarSettings:_*)

Run sonar:

sbt test sonar

Use the gen-sonar-prop task after the testing tasks, since the configuration checks for existing folders.

Customization

Override or Add settings in build.sbt

0.13.0:

sonarProperties := sonarProperties.value ++ 
Map("sonar.projectName" -> "override-name", "new.key" -> "new.value")

Older SBT

sonarProperties ~= { old => old ++ 
Map("sonar.projectName" -> "override-name", "new.key" -> "new.value") }

Other Stuff

  • Do not use it with Play 2.1.3, Play has problems to generate correct test reports.