From 8c0b3350b714e835e91d89f958eefa531533070a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Wed, 6 Nov 2019 17:01:34 +0100 Subject: [PATCH] SONAR-12677 do not duplicate configuration of bundled plugins into the sonar-docs module and the edition modules also, make sonar-docs support being built from public sources which do not contain commercial editions --- server/sonar-docs/build.gradle | 40 +++++--------- sonar-application/build.gradle | 66 +++++++++--------------- sonar-application/bundled_plugins.gradle | 20 +++++++ 3 files changed, 57 insertions(+), 69 deletions(-) create mode 100644 sonar-application/bundled_plugins.gradle diff --git a/server/sonar-docs/build.gradle b/server/sonar-docs/build.gradle index 7ebd1374106..b7bc9f82eb3 100644 --- a/server/sonar-docs/build.gradle +++ b/server/sonar-docs/build.gradle @@ -15,40 +15,24 @@ sonarqube { group = 'com.sonarsource.sonarqube' configurations { - languagePlugin { transitive = false } + bundledPlugin { + transitive = false + } } -dependencies { - languagePlugin 'com.sonarsource.abap:sonar-abap-plugin@jar' // private - languagePlugin 'com.sonarsource.slang:sonar-apex-plugin@jar' // private - languagePlugin "org.sonarsource.dotnet:sonar-csharp-plugin@jar" - languagePlugin 'com.sonarsource.cpp:sonar-cfamily-plugin@jar' // private - languagePlugin 'com.sonarsource.cobol:sonar-cobol-plugin@jar' // private - languagePlugin 'org.sonarsource.css:sonar-css-plugin@jar' - languagePlugin 'org.sonarsource.flex:sonar-flex-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' // private - languagePlugin 'com.sonarsource.plsql:sonar-plsql-plugin@jar' // private - languagePlugin 'org.sonarsource.python:sonar-python-plugin@jar' - languagePlugin 'com.sonarsource.rpg:sonar-rpg-plugin@jar' // private - languagePlugin 'org.sonarsource.slang:sonar-go-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' // private - languagePlugin 'org.sonarsource.typescript:sonar-typescript-plugin@jar' - languagePlugin 'com.sonarsource.tsql:sonar-tsql-plugin@jar' // private - languagePlugin "org.sonarsource.dotnet:sonar-vbnet-plugin@jar" - languagePlugin 'com.sonarsource.plugins.vb:sonar-vb-plugin@jar' // private - languagePlugin 'org.sonarsource.html:sonar-html-plugin@jar' - languagePlugin 'org.sonarsource.xml:sonar-xml-plugin@jar' +// loads the bundled_plugins.gradle of each edition +// (they will all add there own bundled plugins to the bundledPlugin dependency configuration) +apply from: new File(rootDir, 'sonar-application/bundled_plugins.gradle') +File closeSourceDir = new File(rootDir, 'private'); +if (closeSourceDir.exists()) { + apply from: new File(closeSourceDir, 'edition-developer/bundled_plugins.gradle') + apply from: new File(closeSourceDir, 'edition-enterprise/bundled_plugins.gradle') + apply from: new File(closeSourceDir, 'edition-datacenter/bundled_plugins.gradle') } task extractAnalyzerDocFiles { doLast { - configurations.languagePlugin.files.each { + configurations.bundledPlugin.files.each { File file = it copy { from(zipTree(file).matching { include 'static/documentation.md' }) { diff --git a/sonar-application/build.gradle b/sonar-application/build.gradle index bda9596383d..e2fcdaa1fd9 100644 --- a/sonar-application/build.gradle +++ b/sonar-application/build.gradle @@ -27,49 +27,33 @@ configurations { } dependencies { - // please keep list ordered - compile 'org.slf4j:slf4j-api' - - compile 'org.elasticsearch.client:transport' - compile project(':server:sonar-ce') - compile project(':server:sonar-main') - compile project(':server:sonar-process') - compile project(':server:sonar-webserver') - compile project(':sonar-core') - compile project(path: ':sonar-plugin-api', configuration: 'shadow') - compile project(':sonar-plugin-api-impl') - - compileOnly 'com.google.code.findbugs:jsr305' - - jsw 'tanukisoft:wrapper:3.2.3' - scanner project(path: ':sonar-scanner-engine-shaded', configuration: 'shadow') - web project(':server:sonar-web') - shutdowner project(':sonar-shutdowner') - - jdbc_h2 'com.h2database:h2' - jdbc_mssql 'com.microsoft.sqlserver:mssql-jdbc' - jdbc_postgresql 'org.postgresql:postgresql' - - bundledPlugin 'org.sonarsource.css:sonar-css-plugin@jar' - bundledPlugin "org.sonarsource.dotnet:sonar-csharp-plugin@jar" - bundledPlugin "org.sonarsource.dotnet:sonar-vbnet-plugin@jar" - bundledPlugin 'org.sonarsource.flex:sonar-flex-plugin@jar' - bundledPlugin 'org.sonarsource.html:sonar-html-plugin@jar' - bundledPlugin 'org.sonarsource.java:sonar-java-plugin@jar' - bundledPlugin 'org.sonarsource.jacoco:sonar-jacoco-plugin@jar' - bundledPlugin 'org.sonarsource.javascript:sonar-javascript-plugin@jar' - bundledPlugin 'org.sonarsource.php:sonar-php-plugin@jar' - bundledPlugin 'org.sonarsource.python:sonar-python-plugin@jar' - bundledPlugin 'org.sonarsource.slang:sonar-go-plugin@jar' - bundledPlugin "org.sonarsource.slang:sonar-kotlin-plugin@jar" - bundledPlugin "org.sonarsource.slang:sonar-ruby-plugin@jar" - bundledPlugin 'org.sonarsource.scm.git:sonar-scm-git-plugin@jar' - bundledPlugin 'org.sonarsource.scm.svn:sonar-scm-svn-plugin@jar' - bundledPlugin "org.sonarsource.slang:sonar-scala-plugin@jar" - bundledPlugin 'org.sonarsource.typescript:sonar-typescript-plugin@jar' - bundledPlugin 'org.sonarsource.xml:sonar-xml-plugin@jar' + // please keep list ordered + compile 'org.slf4j:slf4j-api' + + compile 'org.elasticsearch.client:transport' + compile project(':server:sonar-ce') + compile project(':server:sonar-main') + compile project(':server:sonar-process') + compile project(':server:sonar-webserver') + compile project(':sonar-core') + compile project(path: ':sonar-plugin-api', configuration: 'shadow') + compile project(':sonar-plugin-api-impl') + + compileOnly 'com.google.code.findbugs:jsr305' + + jsw 'tanukisoft:wrapper:3.2.3' + scanner project(path: ':sonar-scanner-engine-shaded', configuration: 'shadow') + web project(':server:sonar-web') + shutdowner project(':sonar-shutdowner') + + jdbc_h2 'com.h2database:h2' + jdbc_mssql 'com.microsoft.sqlserver:mssql-jdbc' + jdbc_postgresql 'org.postgresql:postgresql' } +// declare dependencies in configuration bundledPlugin to be packaged in extensions/plugins +apply from: 'bundled_plugins.gradle' + jar { manifest { attributes( diff --git a/sonar-application/bundled_plugins.gradle b/sonar-application/bundled_plugins.gradle new file mode 100644 index 00000000000..4867e92946e --- /dev/null +++ b/sonar-application/bundled_plugins.gradle @@ -0,0 +1,20 @@ +dependencies { + bundledPlugin 'org.sonarsource.css:sonar-css-plugin@jar' + bundledPlugin "org.sonarsource.dotnet:sonar-csharp-plugin@jar" + bundledPlugin "org.sonarsource.dotnet:sonar-vbnet-plugin@jar" + bundledPlugin 'org.sonarsource.flex:sonar-flex-plugin@jar' + bundledPlugin 'org.sonarsource.html:sonar-html-plugin@jar' + bundledPlugin 'org.sonarsource.java:sonar-java-plugin@jar' + bundledPlugin 'org.sonarsource.jacoco:sonar-jacoco-plugin@jar' + bundledPlugin 'org.sonarsource.javascript:sonar-javascript-plugin@jar' + bundledPlugin 'org.sonarsource.php:sonar-php-plugin@jar' + bundledPlugin 'org.sonarsource.python:sonar-python-plugin@jar' + bundledPlugin 'org.sonarsource.slang:sonar-go-plugin@jar' + bundledPlugin "org.sonarsource.slang:sonar-kotlin-plugin@jar" + bundledPlugin "org.sonarsource.slang:sonar-ruby-plugin@jar" + bundledPlugin 'org.sonarsource.scm.git:sonar-scm-git-plugin@jar' + bundledPlugin 'org.sonarsource.scm.svn:sonar-scm-svn-plugin@jar' + bundledPlugin "org.sonarsource.slang:sonar-scala-plugin@jar" + bundledPlugin 'org.sonarsource.typescript:sonar-typescript-plugin@jar' + bundledPlugin 'org.sonarsource.xml:sonar-xml-plugin@jar' +} -- 2.39.5