aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/build.gradle
blob: 131b5fb406b4ef01407a92cd456debe7bdc1bc53 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
sonarqube {
  properties {
    property "sonar.projectName", "${projectTitle} :: Web"
    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/libs/require.js,src/main/js/**/__tests__/**"
  }
}

apply plugin: 'com.moowork.node'

configurations {
  branding
}
dependencies {
  branding 'com.sonarsource:sonarsource-branding:1.3.0.307@war'
}

def webappDir = "${buildDir}/webapp"
def brandingDir = "${buildDir}/branding"

task unzipBranding(type: Copy) {
  from { zipTree(configurations.branding.singleFile) }
  into brandingDir
}
task copyBrandingSrc(type: Copy, dependsOn: unzipBranding) {
  into projectDir
  from file(brandingDir)
  include '**/*.js'
  includeEmptyDirs = false
}
task copyBrandingWebapp(type: Copy, dependsOn: unzipBranding) {
  into "${projectDir}/public"
  from file("${brandingDir}/src/main/webapp")
  include '**/*.svg'
  includeEmptyDirs = false
}
task copyBrandingFile(type: Copy, dependsOn: unzipBranding) {
  into "${projectDir}/public"
  from file(brandingDir)
  include '**/branding'
  includeEmptyDirs = false
}
task copyBranding() {
  dependsOn copyBrandingSrc
  dependsOn copyBrandingWebapp
  dependsOn copyBrandingFile
}

node {
  version = '8.5.0'
  yarnVersion = '1.1.0'
  download = true
}

yarn_run {
  if (release) { dependsOn copyBranding }
  inputs.dir('config')
  inputs.dir('public')
  inputs.dir('scripts')
  inputs.dir('src')
  inputs.file('.babelrc')
  inputs.file('build.gradle')
  inputs.file('package.json')
  inputs.file('tsconfig.json')
  inputs.file('yarn.lock')
  outputs.dir(webappDir)

  args = ['build']
}