Skip to content

Commit

Permalink
UPC-139 Publish new properties to output file
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-geoffroy-sonarsource committed Apr 2, 2024
1 parent b6c67a2 commit 62bd91a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ public static Properties toProperties(UpdateCenter center) {
if (center.getSonar().getLtsRelease() != null) {
set(p, "ltsVersion", center.getSonar().getLtsRelease().getVersion().toString());
}

if (center.getSonar().getLtaVersion() != null) {
set(p, "ltaVersion", center.getSonar().getLtaVersion().getVersion().toString());
}
if (center.getSonar().getPastLtaVersion() != null) {
set(p, "pastLtaVersion", center.getSonar().getPastLtaVersion().getVersion().toString());
}
for (Release sonarRelease : center.getSonar().getAllReleases()) {
set(p, sonarRelease.getVersion() + CHANGELOG_URL_SUFFIX, sonarRelease.getChangelogUrl());
set(p, sonarRelease.getVersion() + DISPLAY_VERSION_SUFFIX, sonarRelease.getDisplayVersion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public void test_to_properties() throws IOException, URISyntaxException {
.setDownloadUrl("http://dist.sonar.codehaus.org/sonar-enterprise-2.1.zip", Release.Edition.ENTERPRISE)
.setDownloadUrl("http://dist.sonar.codehaus.org/sonar-datacenter-2.1.zip", Release.Edition.DATACENTER);
sonar.setLtsRelease("2.0");
sonar.setLtaVersion("2.0");
sonar.setPastLtaVersion("1.0");

Plugin foo = Plugin.factory("foo");

Expand Down Expand Up @@ -78,6 +80,8 @@ public void test_to_properties() throws IOException, URISyntaxException {
assertProperty(properties, "2.1.downloadEnterpriseUrl", "http://dist.sonar.codehaus.org/sonar-enterprise-2.1.zip");
assertProperty(properties, "2.1.downloadDatacenterUrl", "http://dist.sonar.codehaus.org/sonar-datacenter-2.1.zip");
assertProperty(properties, "ltsVersion", "2.0");
assertProperty(properties, "ltaVersion", "2.0");
assertProperty(properties, "pastLtaVersion", "1.0");
assertProperty(properties, "plugins", "bar,foo");
assertProperty(properties, "foo.name", "Foo");
assertProperty(properties, "foo.organizationUrl", "http://www.sonarsource.org");
Expand Down

0 comments on commit 62bd91a

Please sign in to comment.