You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. sonarqube {
  2. properties {
  3. property 'sonar.projectName', "${projectTitle} :: Plugin API"
  4. }
  5. }
  6. apply plugin: 'com.github.johnrengelman.shadow'
  7. dependencies {
  8. // please keep the list grouped by configuration and ordered by name
  9. compile 'commons-codec:commons-codec'
  10. compile 'commons-io:commons-io'
  11. compile 'commons-lang:commons-lang'
  12. compile 'com.google.code.gson:gson'
  13. compile 'com.google.guava:guava'
  14. // shaded, but not relocated
  15. compile project(':sonar-check-api')
  16. compile(project(':sonar-duplications')) {
  17. exclude group: 'org.slf4', module: 'slf4j-api'
  18. }
  19. shadow 'org.codehaus.staxmate:staxmate'
  20. shadow 'org.codehaus.woodstox:stax2-api'
  21. shadow 'org.codehaus.woodstox:woodstox-core-lgpl'
  22. compileOnly 'ch.qos.logback:logback-classic'
  23. compileOnly 'ch.qos.logback:logback-core'
  24. compileOnly 'com.google.code.findbugs:jsr305'
  25. compileOnly 'javax.servlet:javax.servlet-api'
  26. compileOnly 'junit:junit'
  27. compileOnly 'org.slf4j:slf4j-api'
  28. testCompile 'com.tngtech.java:junit-dataprovider'
  29. testCompile 'org.assertj:assertj-core'
  30. testCompile 'org.mockito:mockito-core'
  31. testCompile project(':sonar-testing-harness')
  32. }
  33. sourceSets {
  34. // Make the compileOnly dependencies available when compiling/running tests
  35. test.compileClasspath += configurations.compileOnly + configurations.shadow
  36. test.runtimeClasspath += configurations.compileOnly + configurations.shadow
  37. }
  38. def on3Digits(version) {
  39. def projectversion3digits = version - ~/-\w+/
  40. projectversion3digits = projectversion3digits.tokenize('.').plus(0).take(3).join('.')
  41. }
  42. import org.apache.tools.ant.filters.ReplaceTokens
  43. processResources {
  44. filter ReplaceTokens, tokens: [
  45. // The build version is composed of 4 fields, including the semantic version and the build number provided by Travis.
  46. 'project.buildVersion': project.version.endsWith('SNAPSHOT') ? project.version : on3Digits(project.version) + '.' + System.getProperty("buildNumber"),
  47. 'project.version.3digits': project.version.endsWith('SNAPSHOT') ? project.version : on3Digits(project.version)
  48. ]
  49. }
  50. shadowJar {
  51. configurations = [project.configurations.default]
  52. relocate('com.google', 'org.sonar.api.internal.google')
  53. relocate('org.apache.commons', 'org.sonar.api.internal.apachecommons')
  54. dependencies {
  55. exclude(dependency('org.codehaus.woodstox:woodstox-core-lgpl'))
  56. exclude(dependency('org.codehaus.woodstox:stax2-api'))
  57. exclude(dependency('org.codehaus.staxmate:staxmate'))
  58. }
  59. }
  60. artifactoryPublish.skip = false
  61. publishing {
  62. publications {
  63. mavenJava(MavenPublication) {
  64. artifact source: shadowJar, classifier: null
  65. artifact sourcesJar
  66. artifact javadocJar
  67. }
  68. }
  69. }