1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- 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/**/__tests__/**"
- property "sonar.eslint.reportPaths", "eslint-report.json"
- }
- }
-
- 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
- }
-
- yarn_run {
- if (official) { dependsOn copyBranding }
- ['config', 'public', 'scripts', 'src', '../sonar-docs/src'].each {
- inputs.dir(it).withPathSensitivity(PathSensitivity.RELATIVE)
- }
- ['.babelrc', 'package.json', 'tsconfig.json', 'yarn.lock'].each {
- inputs.file(it).withPathSensitivity(PathSensitivity.RELATIVE)
- }
- outputs.dir(webappDir)
- outputs.cacheIf { true }
- 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
- exclude 'main/js/helpers/standards.json'
- if (official) exclude 'main/js/app/components/GlobalFooterBranding.js'
- }
- licenseMain.dependsOn licenseCheckWeb
-
- task licenseFormatWeb(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {
- source = sources
- if (official) exclude 'main/js/app/components/GlobalFooterBranding.js'
- }
- licenseFormat.dependsOn licenseFormatWeb
|