diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2019-11-18 18:04:25 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-12-02 20:46:11 +0100 |
commit | 7a1d413a16810fb673905a00cd3d9071ba8cbe76 (patch) | |
tree | 086e5badffb00589ce334aba6a73712d21f8636b | |
parent | 6c12781c2f9f5ee27dea9304c747e1ac14c6a81f (diff) | |
download | sonarqube-7a1d413a16810fb673905a00cd3d9071ba8cbe76.tar.gz sonarqube-7a1d413a16810fb673905a00cd3d9071ba8cbe76.zip |
SONAR-12665 gradle.properties must not contain -SNAPSHOT anymore
because any build of SonarQube must now be releasable
however, -SNAPSHOT should still be used as version when no buildNumber is provided (ie. on local builds) and as the projectVersion of the project analyzed on Next
-rw-r--r-- | build.gradle | 44 | ||||
-rw-r--r-- | gradle.properties | 2 |
2 files changed, 23 insertions, 23 deletions
diff --git a/build.gradle b/build.gradle index 339f4e24d7c..58e989ec11f 100644 --- a/build.gradle +++ b/build.gradle @@ -33,23 +33,6 @@ if (project.hasProperty('time-tracker')) { } } -ext { - slangVersion = '1.5.0.315' - dotnetVersion = '7.17.0.9346' - - // Analyze SonarQube with SonarQube! - versionInSources = version -} - -apply plugin: 'org.sonarqube' -sonarqube { - properties { - property 'sonar.projectName', projectTitle - property 'sonar.projectVersion', versionInSources - property 'sonar.buildString', version - } -} - if (!JavaVersion.current().java11Compatible) { throw new GradleException("JDK 11+ is required to perform this build. It's currently " + System.getProperty("java.home") + ".") @@ -59,12 +42,15 @@ allprojects { apply plugin: 'com.jfrog.artifactory' apply plugin: 'maven-publish' + ext.versionInSources = version ext.buildNumber = System.getProperty("buildNumber") - ext.versionWithoutBuildNumber = version - // Replaces the version defined in sources, usually x.y-SNAPSHOT, by a version identifying the build. - if (version.endsWith('-SNAPSHOT') && ext.buildNumber != null) { - def versionSuffix = (version.toString().count('.') == 1 ? ".0.${ext.buildNumber}" : ".${ext.buildNumber}") - version = version.replace('-SNAPSHOT', versionSuffix) + // when no buildNumber is provided, then project version must end with '-SNAPSHOT' + if (ext.buildNumber == null) { + version = "${version}-SNAPSHOT".toString() + ext.versionWithoutBuildNumber = version + } else { + ext.versionWithoutBuildNumber = version + version = (version.toString().count('.') == 1 ? "${version}.0.${ext.buildNumber}" : "${version}.${ext.buildNumber}").toString() } ext { @@ -90,6 +76,20 @@ allprojects { } } +ext { + slangVersion = '1.5.0.315' + dotnetVersion = '7.17.0.9346' +} + +apply plugin: 'org.sonarqube' +sonarqube { + properties { + property 'sonar.projectName', projectTitle + property 'sonar.projectVersion', "${versionInSources}-SNAPSHOT" + property 'sonar.buildString', version + } +} + subprojects { apply plugin: 'com.github.hierynomus.license' apply plugin: 'io.spring.dependency-management' diff --git a/gradle.properties b/gradle.properties index b278fa68343..0aad12a2ae5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group=org.sonarsource.sonarqube -version=8.1-SNAPSHOT +version=8.1 description=Open source platform for continuous inspection of code quality projectTitle=SonarQube |