您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

build.gradle 4.1KB

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