Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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