From d57f3071ec1060dc23c5c4bce542f3d802a252a7 Mon Sep 17 00:00:00 2001 From: Michal Duda Date: Wed, 7 Aug 2019 12:39:35 +0200 Subject: SONAR-12384 update gradle build --- server/sonar-docs/build.gradle | 60 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) (limited to 'server/sonar-docs/build.gradle') diff --git a/server/sonar-docs/build.gradle b/server/sonar-docs/build.gradle index 51b967e54be..d851ab04c60 100644 --- a/server/sonar-docs/build.gradle +++ b/server/sonar-docs/build.gradle @@ -1,3 +1,9 @@ +import java.util.regex.Matcher +import java.util.regex.Pattern + +Pattern PLUGIN_NAME_PATTERN = Pattern.compile("(sonar-.*-plugin)(.*)") + + /** * This module is building the zip file containing the static web site */ @@ -8,6 +14,58 @@ sonarqube { group = 'com.sonarsource.sonarqube' +configurations { + languagePlugin { transitive = false } +} + +dependencies { + languagePlugin 'com.sonarsource.abap:sonar-abap-plugin@jar' + languagePlugin 'com.sonarsource.slang:sonar-apex-plugin@jar' + languagePlugin "org.sonarsource.dotnet:sonar-csharp-plugin@jar" + languagePlugin 'com.sonarsource.cpp:sonar-cfamily-plugin@jar' + languagePlugin 'com.sonarsource.cobol:sonar-cobol-plugin@jar' + languagePlugin 'org.sonarsource.css:sonar-css-plugin@jar' + languagePlugin 'org.sonarsource.flex:sonar-flex-plugin@jar' + languagePlugin 'org.sonarsource.go:sonar-go-plugin@jar' + languagePlugin 'org.sonarsource.java:sonar-java-plugin@jar' + languagePlugin 'org.sonarsource.javascript:sonar-javascript-plugin@jar' + languagePlugin "org.sonarsource.slang:sonar-kotlin-plugin@jar" + languagePlugin 'org.sonarsource.php:sonar-php-plugin@jar' + languagePlugin 'com.sonarsource.pli:sonar-pli-plugin@jar' + languagePlugin 'com.sonarsource.plsql:sonar-plsql-plugin@jar' + languagePlugin 'org.sonarsource.python:sonar-python-plugin@jar' + languagePlugin 'com.sonarsource.rpg:sonar-rpg-plugin@jar' + languagePlugin "org.sonarsource.slang:sonar-ruby-plugin@jar" + languagePlugin "org.sonarsource.slang:sonar-scala-plugin@jar" + languagePlugin 'com.sonarsource.swift:sonar-swift-plugin@jar' + languagePlugin 'org.sonarsource.typescript:sonar-typescript-plugin@jar' + languagePlugin 'com.sonarsource.tsql:sonar-tsql-plugin@jar' + languagePlugin "org.sonarsource.dotnet:sonar-vbnet-plugin@jar" + languagePlugin 'com.sonarsource.plugins.vb:sonar-vb-plugin@jar' + languagePlugin 'org.sonarsource.html:sonar-html-plugin@jar' + languagePlugin 'org.sonarsource.xml:sonar-xml-plugin@jar' +} + +task extractAnalyzerDocFiles { + doLast { + configurations.languagePlugin.files.each { + File file = it + copy { + from(zipTree(file).matching { include 'static/documentation.md' }) { + eachFile { fcd -> + Matcher m = PLUGIN_NAME_PATTERN.matcher(file.getName()) + if (m.find()) { + fcd.relativePath = new RelativePath(true, m.group(1) + '.md') + } + } + includeEmptyDirs = false + } + into "$buildDir/tmp/plugin-documentation/" + } + } + } +} + yarn_run { def docsVersion = version.split("[.-]").take(2).join('.') environment = [ GATSBY_DOCS_VERSION: docsVersion ] @@ -48,7 +106,7 @@ task zip(type: Zip) { } } zip.dependsOn yarn_run -assemble.dependsOn zip +assemble.dependsOn zip, extractAnalyzerDocFiles publishing { publications { -- cgit v1.2.3