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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. property "sonar.typescript.lcov.reportPaths", "coverage/lcov.info"
  10. }
  11. }
  12. apply plugin: 'com.moowork.node'
  13. def webappDir = "${buildDir}/webapp"
  14. yarn_run {
  15. ['config', 'public', 'scripts', 'src', '../sonar-docs/src'].each {
  16. inputs.dir(it).withPathSensitivity(PathSensitivity.RELATIVE)
  17. }
  18. ['babel.config.js', 'package.json', 'tsconfig.json', 'yarn.lock'].each {
  19. inputs.file(it).withPathSensitivity(PathSensitivity.RELATIVE)
  20. }
  21. outputs.dir(webappDir)
  22. outputs.cacheIf { true }
  23. args = ['build-release']
  24. }
  25. build.dependsOn(yarn_run)
  26. "yarn_validate-ci" {
  27. // Note that outputs are not relocatable, because contain absolute paths, and that's why inputs are not relativized
  28. ['config', 'src/main/js'].each {
  29. inputs.dir(it)
  30. }
  31. ['package.json', 'yarn.lock', 'tsconfig.json', '.eslintrc'].each {
  32. inputs.file(it)
  33. }
  34. outputs.file('eslint-report.json')
  35. outputs.dir('coverage')
  36. outputs.cacheIf { true }
  37. dependsOn(yarn)
  38. }
  39. def sources = fileTree(dir: "src") + fileTree(dir: "scripts") + fileTree(dir: "config")
  40. task licenseCheckWeb(type: com.hierynomus.gradle.license.tasks.LicenseCheck) {
  41. source = sources
  42. exclude 'main/js/helpers/standards.json'
  43. if (official) exclude 'main/js/app/components/GlobalFooterBranding.js'
  44. }
  45. licenseMain.dependsOn licenseCheckWeb
  46. task licenseFormatWeb(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {
  47. source = sources
  48. if (official) exclude 'main/js/app/components/GlobalFooterBranding.js'
  49. }
  50. licenseFormat.dependsOn licenseFormatWeb