From 62bd91acf4d5d1ba5bd84ba770fb3a4b828732f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Geoffroy?= Date: Tue, 2 Apr 2024 10:10:03 +0200 Subject: [PATCH] UPC-139 Publish new properties to output file --- .../sonar/updatecenter/common/UpdateCenterSerializer.java | 7 ++++++- .../updatecenter/common/UpdateCenterSerializerTest.java | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sonar-update-center-common/src/main/java/org/sonar/updatecenter/common/UpdateCenterSerializer.java b/sonar-update-center-common/src/main/java/org/sonar/updatecenter/common/UpdateCenterSerializer.java index 23dd02cc..58cf96a6 100644 --- a/sonar-update-center-common/src/main/java/org/sonar/updatecenter/common/UpdateCenterSerializer.java +++ b/sonar-update-center-common/src/main/java/org/sonar/updatecenter/common/UpdateCenterSerializer.java @@ -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()); diff --git a/sonar-update-center-common/src/test/java/org/sonar/updatecenter/common/UpdateCenterSerializerTest.java b/sonar-update-center-common/src/test/java/org/sonar/updatecenter/common/UpdateCenterSerializerTest.java index 3d4148d8..829578fd 100644 --- a/sonar-update-center-common/src/test/java/org/sonar/updatecenter/common/UpdateCenterSerializerTest.java +++ b/sonar-update-center-common/src/test/java/org/sonar/updatecenter/common/UpdateCenterSerializerTest.java @@ -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"); @@ -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");