diff options
author | David Rautureau <david.rautureau@sonarsource.com> | 2018-03-28 12:37:09 +0200 |
---|---|---|
committer | Janos Gyerik <janos.gyerik@sonarsource.com> | 2018-04-04 14:25:32 +0200 |
commit | a70aa466e5d5b198958ea015f3b22467227d5b2c (patch) | |
tree | 3656d33c9e30e2a17ed7a4dce45bedf89e3ad327 | |
parent | c9e60ded9b8ffe4f97c73447c3ceda6919662a1e (diff) | |
download | sonarqube-a70aa466e5d5b198958ea015f3b22467227d5b2c.tar.gz sonarqube-a70aa466e5d5b198958ea015f3b22467227d5b2c.zip |
BUILD-630 Generate javadoc ad sources jars with Gradle only on release branches
-rw-r--r-- | build.gradle | 5 | ||||
-rw-r--r-- | plugins/sonar-xoo-plugin/build.gradle | 6 | ||||
-rw-r--r-- | server/sonar-db-core/build.gradle | 8 | ||||
-rw-r--r-- | server/sonar-db-dao/build.gradle | 8 | ||||
-rw-r--r-- | server/sonar-db-migration/build.gradle | 6 | ||||
-rw-r--r-- | server/sonar-plugin-bridge/build.gradle | 6 | ||||
-rw-r--r-- | server/sonar-process/build.gradle | 6 | ||||
-rw-r--r-- | server/sonar-qa-util/build.gradle | 6 | ||||
-rw-r--r-- | server/sonar-server/build.gradle | 8 | ||||
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/OfficialDistribution.java | 2 | ||||
-rw-r--r-- | server/sonar-web/build.gradle | 2 | ||||
-rw-r--r-- | sonar-core/build.gradle | 6 | ||||
-rw-r--r-- | sonar-home/build.gradle | 6 | ||||
-rw-r--r-- | sonar-markdown/build.gradle | 6 | ||||
-rw-r--r-- | sonar-plugin-api/build.gradle | 6 | ||||
-rw-r--r-- | sonar-scanner-engine/build.gradle | 6 | ||||
-rw-r--r-- | sonar-scanner-protocol/build.gradle | 6 | ||||
-rw-r--r-- | sonar-testing-harness/build.gradle | 6 | ||||
-rw-r--r-- | sonar-ws/build.gradle | 6 | ||||
-rwxr-xr-x | travis.sh | 8 |
20 files changed, 76 insertions, 43 deletions
diff --git a/build.gradle b/build.gradle index 48bfe8e3e19..2100179599d 100644 --- a/build.gradle +++ b/build.gradle @@ -38,6 +38,7 @@ allprojects { ext { release = project.hasProperty('release') && project.getProperty('release') + official = project.hasProperty('official') && project.getProperty('official') } repositories { @@ -264,9 +265,9 @@ subprojects { task ide(dependsOn: ['generateProto', 'generateTestProto']) { } - if (release) { + if (official) { jar { - // do not break incremental build on non-release versions + // do not break incremental build on non official versions manifest { attributes( 'Version': "${version}", diff --git a/plugins/sonar-xoo-plugin/build.gradle b/plugins/sonar-xoo-plugin/build.gradle index 5bd56009cde..66c6d051b68 100644 --- a/plugins/sonar-xoo-plugin/build.gradle +++ b/plugins/sonar-xoo-plugin/build.gradle @@ -38,8 +38,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/server/sonar-db-core/build.gradle b/server/sonar-db-core/build.gradle index 8a4ee3042d6..df83a0aeaac 100644 --- a/server/sonar-db-core/build.gradle +++ b/server/sonar-db-core/build.gradle @@ -76,9 +76,11 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact testJar - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + artifact testJar + } } } } diff --git a/server/sonar-db-dao/build.gradle b/server/sonar-db-dao/build.gradle index 98149ad92e5..f7103bceaae 100644 --- a/server/sonar-db-dao/build.gradle +++ b/server/sonar-db-dao/build.gradle @@ -55,9 +55,11 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact testJar - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + artifact testJar + } } } } diff --git a/server/sonar-db-migration/build.gradle b/server/sonar-db-migration/build.gradle index f26ceaf8255..7360daec774 100644 --- a/server/sonar-db-migration/build.gradle +++ b/server/sonar-db-migration/build.gradle @@ -39,8 +39,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/server/sonar-plugin-bridge/build.gradle b/server/sonar-plugin-bridge/build.gradle index ea490280280..d1fdaf049e8 100644 --- a/server/sonar-plugin-bridge/build.gradle +++ b/server/sonar-plugin-bridge/build.gradle @@ -20,8 +20,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/server/sonar-process/build.gradle b/server/sonar-process/build.gradle index 3ca3addbcec..862d121f001 100644 --- a/server/sonar-process/build.gradle +++ b/server/sonar-process/build.gradle @@ -35,8 +35,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/server/sonar-qa-util/build.gradle b/server/sonar-qa-util/build.gradle index aab7d38eb88..da6634f460c 100644 --- a/server/sonar-qa-util/build.gradle +++ b/server/sonar-qa-util/build.gradle @@ -22,8 +22,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/server/sonar-server/build.gradle b/server/sonar-server/build.gradle index 7242701eede..c88c09d48b3 100644 --- a/server/sonar-server/build.gradle +++ b/server/sonar-server/build.gradle @@ -98,9 +98,11 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact testJar - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + artifact testJar + } } } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/OfficialDistribution.java b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/OfficialDistribution.java index c999b6fec14..6b3f752574d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/OfficialDistribution.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/OfficialDistribution.java @@ -35,7 +35,7 @@ public class OfficialDistribution { public boolean check() { // the dependency com.sonarsource:sonarsource-branding is shaded to webapp - // during release (see sonar-web pom) + // during official build (see sonar-web pom) File brandingFile = new File(serverFileSystem.getHomeDir(), BRANDING_FILE_PATH); // no need to check that the file exists. java.io.File#length() returns zero in this case. return brandingFile.length() > 0L; diff --git a/server/sonar-web/build.gradle b/server/sonar-web/build.gradle index d56a846ff3a..f7be5a3d07e 100644 --- a/server/sonar-web/build.gradle +++ b/server/sonar-web/build.gradle @@ -55,7 +55,7 @@ node { } yarn_run { - if (release) { dependsOn copyBranding } + if (official) { dependsOn copyBranding } inputs.dir('config') inputs.dir('public') inputs.dir('scripts') diff --git a/sonar-core/build.gradle b/sonar-core/build.gradle index 768ec42b247..a2d0f1bb189 100644 --- a/sonar-core/build.gradle +++ b/sonar-core/build.gradle @@ -50,8 +50,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/sonar-home/build.gradle b/sonar-home/build.gradle index ea6d5b07f44..c4323e91133 100644 --- a/sonar-home/build.gradle +++ b/sonar-home/build.gradle @@ -23,8 +23,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/sonar-markdown/build.gradle b/sonar-markdown/build.gradle index 7b46ac42b1f..ec958b2434c 100644 --- a/sonar-markdown/build.gradle +++ b/sonar-markdown/build.gradle @@ -23,8 +23,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/sonar-plugin-api/build.gradle b/sonar-plugin-api/build.gradle index 8bf8e28798b..047cf35b695 100644 --- a/sonar-plugin-api/build.gradle +++ b/sonar-plugin-api/build.gradle @@ -75,8 +75,10 @@ publishing { publications { mavenJava(MavenPublication) { artifact source: shadowJar, classifier: null - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/sonar-scanner-engine/build.gradle b/sonar-scanner-engine/build.gradle index a99e09ddb23..c7d662c821d 100644 --- a/sonar-scanner-engine/build.gradle +++ b/sonar-scanner-engine/build.gradle @@ -57,8 +57,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/sonar-scanner-protocol/build.gradle b/sonar-scanner-protocol/build.gradle index ba5129d508a..788ab75e8c4 100644 --- a/sonar-scanner-protocol/build.gradle +++ b/sonar-scanner-protocol/build.gradle @@ -28,8 +28,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/sonar-testing-harness/build.gradle b/sonar-testing-harness/build.gradle index 562642ff813..f6493bcca95 100644 --- a/sonar-testing-harness/build.gradle +++ b/sonar-testing-harness/build.gradle @@ -24,8 +24,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/sonar-ws/build.gradle b/sonar-ws/build.gradle index 4080e7048a5..6f8aa851426 100644 --- a/sonar-ws/build.gradle +++ b/sonar-ws/build.gradle @@ -34,8 +34,10 @@ publishing { publications { mavenJava(MavenPublication) { from components.java - artifact sourcesJar - artifact javadocJar + if (release) { + artifact sourcesJar + artifact javadocJar + } } } } diff --git a/travis.sh b/travis.sh index 0e3207b53ca..300ee86f70d 100755 --- a/travis.sh +++ b/travis.sh @@ -96,7 +96,7 @@ BUILD) echo 'Build and analyze master' ./gradlew --no-daemon --console plain \ -DbuildNumber=$BUILD_NUMBER \ - build sonarqube artifactoryPublish -PjacocoEnabled=true -Prelease=true \ + build sonarqube artifactoryPublish -PjacocoEnabled=true -Pofficial=true -Prelease=true \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.login=$SONAR_TOKEN \ -Dsonar.projectVersion=$INITIAL_VERSION \ @@ -109,7 +109,7 @@ BUILD) echo 'Build release branch' ./gradlew --no-daemon --console plain \ -DbuildNumber=$BUILD_NUMBER \ - build sonarqube artifactoryPublish -PjacocoEnabled=true -Prelease=true \ + build sonarqube artifactoryPublish -PjacocoEnabled=true -Pofficial=true -Prelease=true \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.login=$SONAR_TOKEN \ -Dsonar.branch.name=$TRAVIS_BRANCH \ @@ -123,7 +123,7 @@ BUILD) echo 'Build and analyze internal pull request' ./gradlew --no-daemon --console plain \ -DbuildNumber=$BUILD_NUMBER \ - build sonarqube artifactoryPublish -PjacocoEnabled=true -Prelease=true \ + build sonarqube artifactoryPublish -PjacocoEnabled=true -Pofficial=true \ -Dsonar.host.url=$SONAR_HOST_URL \ -Dsonar.login=$SONAR_TOKEN \ -Dsonar.analysis.buildNumber=$BUILD_NUMBER \ @@ -140,7 +140,7 @@ BUILD) else echo 'Build feature branch or external pull request' ./gradlew --no-daemon --console plain \ - -DbuildNumber=$BUILD_NUMBER -Prelease=true \ + -DbuildNumber=$BUILD_NUMBER -Pofficial=true \ build artifactoryPublish fi ;; |