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 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. sonarqube {
  2. properties {
  3. property 'sonar.projectName', "${projectTitle} :: Application"
  4. }
  5. }
  6. configurations {
  7. ce
  8. jsw
  9. scanner
  10. server
  11. webapp
  12. jdbc_mssql {
  13. transitive = false
  14. }
  15. jdbc_mysql {
  16. transitive = false
  17. }
  18. jdbc_postgresql {
  19. transitive = false
  20. }
  21. jdbc_h2 {
  22. transitive = false
  23. }
  24. bundledPlugin {
  25. transitive = false
  26. }
  27. }
  28. dependencies {
  29. compile 'org.elasticsearch.client:transport'
  30. compile project(':server:sonar-main')
  31. compile project(':server:sonar-process')
  32. compileOnly 'com.google.code.findbugs:jsr305'
  33. ce project(':server:sonar-ce')
  34. jsw 'tanukisoft:wrapper:3.2.3'
  35. scanner project(path: ':sonar-scanner-engine-shaded', configuration: 'shadow')
  36. server project(':server:sonar-server')
  37. webapp project(path: ':server:sonar-web', configuration: 'archives')
  38. jdbc_mssql 'com.microsoft.sqlserver:mssql-jdbc'
  39. jdbc_mysql 'mysql:mysql-connector-java'
  40. jdbc_postgresql 'org.postgresql:postgresql'
  41. jdbc_h2 'com.h2database:h2'
  42. bundledPlugin 'org.sonarsource.java:sonar-java-plugin:5.1.0.13090@jar'
  43. bundledPlugin 'org.sonarsource.javascript:sonar-javascript-plugin:4.0.0.5862@jar'
  44. bundledPlugin 'org.sonarsource.dotnet:sonar-csharp-plugin:6.7.1.4347@jar'
  45. bundledPlugin 'org.sonarsource.scm.git:sonar-scm-git-plugin:1.4.0.1037@jar'
  46. bundledPlugin 'org.sonarsource.scm.svn:sonar-scm-svn-plugin:1.7.0.1017@jar'
  47. bundledPlugin 'org.sonarsource.php:sonar-php-plugin:2.12.1.3018@jar'
  48. bundledPlugin 'org.sonarsource.python:sonar-python-plugin:1.9.0.2010@jar'
  49. bundledPlugin 'org.sonarsource.flex:sonar-flex-plugin:2.3@jar'
  50. bundledPlugin 'org.sonarsource.xml:sonar-xml-plugin:1.4.3.1027@jar'
  51. bundledPlugin 'org.sonarsource.typescript:sonar-typescript-plugin:1.5.0.2122@jar'
  52. testCompile 'junit:junit'
  53. testCompile 'org.assertj:assertj-core'
  54. testCompile 'org.mockito:mockito-core'
  55. }
  56. jar {
  57. manifest {
  58. attributes(
  59. 'Class-Path': configurations.compile.collect { "common/${it.getName()}" }.join(' '),
  60. 'Main-Class': 'org.sonar.application.App'
  61. )
  62. }
  63. }
  64. task zip(type: Zip) {
  65. duplicatesStrategy DuplicatesStrategy.EXCLUDE
  66. def archiveDir = "sonarqube-$version"
  67. into("${archiveDir}/") {
  68. from file('src/main/assembly')
  69. exclude 'elasticsearch/modules/lang-expression/**'
  70. exclude 'elasticsearch/modules/lang-groovy/**'
  71. exclude 'elasticsearch/modules/lang-mustache/**'
  72. exclude 'elasticsearch/modules/lang-painless/**'
  73. exclude 'elasticsearch/modules/transport-netty3/**'
  74. }
  75. // Create the empty dir (plugins) required by elasticsearch
  76. into("${archiveDir}/elasticsearch/") {
  77. from "$buildDir/elasticsearch"
  78. }
  79. into("${archiveDir}/lib/") {
  80. from jar
  81. }
  82. into("${archiveDir}/lib/bundled-plugins/") {
  83. from configurations.bundledPlugin
  84. }
  85. into("${archiveDir}/lib/jsw/") {
  86. from configurations.jsw
  87. }
  88. into("${archiveDir}/lib/scanner/") {
  89. from configurations.scanner
  90. }
  91. into("${archiveDir}/lib/common/") {
  92. from configurations.ce + configurations.server + configurations.compile
  93. }
  94. dependsOn configurations.webapp
  95. into("${archiveDir}/web/") {
  96. from {
  97. configurations.webapp.files.collect { zipTree(it) }
  98. }
  99. }
  100. into("${archiveDir}/lib/jdbc/mssql/") {
  101. from configurations.jdbc_mssql
  102. }
  103. into("${archiveDir}/lib/jdbc/mysql/") {
  104. from configurations.jdbc_mysql
  105. }
  106. into("${archiveDir}/lib/jdbc/postgresql/") {
  107. from configurations.jdbc_postgresql
  108. }
  109. into("${archiveDir}/lib/jdbc/h2/") {
  110. from configurations.jdbc_h2
  111. }
  112. }
  113. // Create the empty dir required by elasticsearch
  114. zip.doFirst {
  115. new File(buildDir, 'elasticsearch/plugins').mkdirs()
  116. }
  117. // Check the size of the archive
  118. zip.doLast {
  119. def minLength = 155000000
  120. def maxLength = 170000000
  121. def length = new File(distsDir, archiveName).length()
  122. if (length < minLength)
  123. throw new GradleException("$archiveName size ($length) too small. Min is $minLength")
  124. if (length > maxLength)
  125. throw new GradleException("$distsDir/$archiveName size ($length) too large. Max is $maxLength")
  126. }
  127. assemble.dependsOn zip
  128. artifactoryPublish.skip = false
  129. publishing {
  130. publications {
  131. mavenJava(MavenPublication) {
  132. artifact zip
  133. }
  134. }
  135. }