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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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-io:commons-io'
  10. compile 'commons-lang:commons-lang'
  11. compile 'com.google.code.gson:gson'
  12. // shaded, but not relocated
  13. compile project(':sonar-check-api')
  14. compileOnly 'ch.qos.logback:logback-classic'
  15. compileOnly 'com.google.code.findbugs:jsr305'
  16. compileOnly 'javax.servlet:javax.servlet-api'
  17. compileOnly 'junit:junit'
  18. // Used by LogTesterJUnit5
  19. compileOnly 'org.junit.jupiter:junit-jupiter-api'
  20. compileOnly 'org.slf4j:slf4j-api'
  21. testCompile 'com.google.guava:guava'
  22. testCompile 'com.tngtech.java:junit-dataprovider'
  23. testCompile 'org.assertj:assertj-core'
  24. testCompile 'org.mockito:mockito-core'
  25. testCompile project(':sonar-plugin-api-impl')
  26. testCompile project(':ut-monitoring')
  27. }
  28. configurations {
  29. // Make the compileOnly dependencies available when compiling/running tests
  30. testImplementation.extendsFrom compileOnly
  31. }
  32. def on3Digits(version) {
  33. def projectversion3digits = version - ~/-\w+/
  34. projectversion3digits = projectversion3digits.tokenize('.').plus(0).take(3).join('.')
  35. }
  36. import org.apache.tools.ant.filters.ReplaceTokens
  37. processResources {
  38. filter ReplaceTokens, tokens: [
  39. // The build version is composed of 4 fields, including the semantic version and the build number provided by Travis.
  40. 'project.buildVersion': project.version.endsWith('SNAPSHOT') ? project.version : on3Digits(project.version) + '.' + (System.getProperty("buildNumber") ?: '0'),
  41. 'project.version.3digits': project.version.endsWith('SNAPSHOT') ? project.version : on3Digits(project.version)
  42. ]
  43. }
  44. shadowJar {
  45. configurations = [project.configurations.runtimeClasspath]
  46. minimize {
  47. exclude(project(':sonar-check-api'))
  48. }
  49. relocate('com.google', 'org.sonar.api.internal.google')
  50. relocate('org.apache.commons', 'org.sonar.api.internal.apachecommons')
  51. }
  52. // only interested in shadowJar
  53. jar.enabled = false
  54. artifactoryPublish.skip = false
  55. publishing {
  56. publications {
  57. mavenJava(MavenPublication) {
  58. artifact source: shadowJar, classifier: null
  59. if (release) {
  60. artifact sourcesJar
  61. artifact javadocJar
  62. }
  63. }
  64. }
  65. }