sonarqube {
  properties {
    property 'sonar.projectName', "${projectTitle} :: Scanner :: Protocol"
    property 'sonar.exclusions', 'src/main/java/org/sonar/scanner/protocol/viewer/**'
  }
}

dependencies {
  // please keep the list ordered
  compile 'com.google.code.gson:gson'
  compile 'com.google.protobuf:protobuf-java'
  compile 'commons-io:commons-io'
  compile 'net.jpountz.lz4:lz4'
  compile project(':sonar-core')

  compileOnly 'com.google.code.findbugs:jsr305'

  testCompile 'com.google.guava:guava'
  testCompile 'junit:junit'
  testCompile 'net.javacrumbs.json-unit:json-unit-assertj:0.0.15'
  testCompile 'org.assertj:assertj-core'
  testCompile 'org.mockito:mockito-core'
}

//create a single Jar with all dependencies
task fatJar(type: Jar) {
  manifest {
    attributes 'Main-Class': 'org.sonar.scanner.protocol.viewer.ScannerReportViewerApp'
  }
  baseName = project.name + '-all'
  from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
  with jar
}

build.dependsOn fatJar

// Used by sonar-db-core to run DB Unit Tests
artifactoryPublish.skip = false
publishing {
  publications {
    mavenJava(MavenPublication) {
      from components.java
      if (release) {
        artifact sourcesJar
        artifact javadocJar
      }
    }
  }
}