aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-vsts/build.gradle
blob: c1631df9969fe04a06383723d82f6b0e4b98a370 (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
sonarqube {
  properties {
    property "sonar.projectName", "${projectTitle} :: VSTS"
    property "sonar.sources", "src/main/js"
    property "sonar.tests", "src/main/js"
    property "sonar.test.inclusions", "src/main/js/**/__tests__/**"
    property "sonar.exclusions", "src/main/js/libs/third-party/**/*,src/main/js/**/__tests__/**"
    property "sonar.eslint.reportPaths", "eslint-report.json"
  }
}

yarn_run {
  ['config', 'public', 'scripts', 'src'].each {
    inputs.dir(it).withPathSensitivity(PathSensitivity.RELATIVE)
  }
  ['.babelrc', 'package.json', 'tsconfig.json', 'yarn.lock'].each {
    inputs.file(it).withPathSensitivity(PathSensitivity.RELATIVE)
  }
  outputs.dir('build/webapp')
  outputs.cacheIf { true }
  dependsOn(yarn, ':server:sonar-web:yarn')
  args = ['build']
}
build.dependsOn(yarn_run)

def sources = fileTree(dir: "src") + fileTree(dir: "scripts") + fileTree(dir: "config")

task licenseCheckWeb(type: com.hierynomus.gradle.license.tasks.LicenseCheck) {
  source = sources
}
licenseMain.dependsOn licenseCheckWeb

task licenseFormatWeb(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {
  source = sources
}
licenseFormat.dependsOn licenseFormatWeb