aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/design-system/build.gradle
blob: ae8b1e7b5e1e8ea56b247b5bc29264753a4b8563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
sonar {
  properties {
    property 'sonar.projectName', "${projectTitle} :: Web :: Design System"
    property "sonar.sources", "src"
    property "sonar.exclusions", "src/**/__tests__/**,src/types/**,src/@types/**,src/helpers/testUtils.tsx"
    property "sonar.tests", "src"
    property "sonar.test.inclusions", "src/**/__tests__/**"
    property "sonar.eslint.reportPaths", "eslint-report/eslint-report.json"
    property "sonar.javascript.lcov.reportPaths", "./coverage/lcov.info"
    property "sonar.coverage.exclusions", "src/components/icons/**/*,src/components/visual-components/**/*"
    property "sonar.cpd.exclusions", "**/*"
  }
}

task "yarn_validate-ci"(type: Exec) {
  dependsOn ":server:sonar-web:yarn_run"

  inputs.dir('src')

  ['package.json', '../yarn.lock', 'jest.config.js'].each {
    inputs.file(it).withPathSensitivity(PathSensitivity.RELATIVE)
  }
 
  outputs.dir('coverage')
  outputs.cacheIf { true }

  commandLine osAdaptiveCommand(['npm', 'run', 'validate-ci'])
}

task "yarn_lint-report-ci"(type: Exec) {
  dependsOn ":server:sonar-web:yarn_run"

  ['src'].each {
    inputs.dir(it)
  }
  ['package.json', '../yarn.lock', 'tsconfig.json', '.eslintrc'].each {
    inputs.file(it)
  }
  outputs.dir('eslint-report')
  outputs.cacheIf { true }

  commandLine osAdaptiveCommand(['npm', 'run', 'lint-report-ci'])
}