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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. sonarqube {
  2. properties {
  3. property "sonar.projectName", "${projectTitle} :: Web"
  4. property "sonar.sources", "src/main/js"
  5. property "sonar.tests", "src/main/js"
  6. property "sonar.test.inclusions", "src/main/js/**/__tests__/**"
  7. property "sonar.exclusions", "src/main/js/**/__tests__/**"
  8. property "sonar.eslint.reportPaths", "eslint-report.json"
  9. }
  10. }
  11. configurations {
  12. branding
  13. }
  14. dependencies {
  15. branding 'com.sonarsource:sonarsource-branding:1.3.0.307@war'
  16. }
  17. def webappDir = "${buildDir}/webapp"
  18. def brandingDir = "${buildDir}/branding"
  19. task unzipBranding(type: Copy) {
  20. from { zipTree(configurations.branding.singleFile) }
  21. into brandingDir
  22. }
  23. task copyBrandingSrc(type: Copy, dependsOn: unzipBranding) {
  24. into projectDir
  25. from file(brandingDir)
  26. include '**/*.js'
  27. includeEmptyDirs = false
  28. }
  29. task copyBrandingWebapp(type: Copy, dependsOn: unzipBranding) {
  30. into "${projectDir}/public"
  31. from file("${brandingDir}/src/main/webapp")
  32. include '**/*.svg'
  33. includeEmptyDirs = false
  34. }
  35. task copyBrandingFile(type: Copy, dependsOn: unzipBranding) {
  36. into "${projectDir}/public"
  37. from file(brandingDir)
  38. include '**/branding'
  39. includeEmptyDirs = false
  40. }
  41. task copyBranding() {
  42. dependsOn copyBrandingSrc
  43. dependsOn copyBrandingWebapp
  44. dependsOn copyBrandingFile
  45. }
  46. yarn_run {
  47. if (official) { dependsOn copyBranding }
  48. ['config', 'public', 'scripts', 'src', '../sonar-docs/src'].each {
  49. inputs.dir(it).withPathSensitivity(PathSensitivity.RELATIVE)
  50. }
  51. ['.babelrc', 'package.json', 'tsconfig.json', 'yarn.lock'].each {
  52. inputs.file(it).withPathSensitivity(PathSensitivity.RELATIVE)
  53. }
  54. outputs.dir(webappDir)
  55. outputs.cacheIf { true }
  56. args = ['build']
  57. }
  58. build.dependsOn(yarn_run)
  59. def sources = fileTree(dir: "src") + fileTree(dir: "scripts") + fileTree(dir: "config")
  60. task licenseCheckWeb(type: com.hierynomus.gradle.license.tasks.LicenseCheck) {
  61. source = sources
  62. exclude 'main/js/helpers/standards.json'
  63. if (official) exclude 'main/js/app/components/GlobalFooterBranding.js'
  64. }
  65. licenseMain.dependsOn licenseCheckWeb
  66. task licenseFormatWeb(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {
  67. source = sources
  68. if (official) exclude 'main/js/app/components/GlobalFooterBranding.js'
  69. }
  70. licenseFormat.dependsOn licenseFormatWeb