From b6c67a27b826416e36243fe4e7ec9841dc344875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Geoffroy?= Date: Wed, 27 Mar 2024 17:17:55 +0100 Subject: [PATCH] UPC-138 Update plugin matrix with LTA --- .../sonar/updatecenter/mojo/CompatibilityMatrix.java | 6 +++--- .../org/sonar/updatecenter/mojo/SonarVersionModel.java | 10 +++++----- .../sonar/updatecenter/mojo/matrix-template.html.ftl | 8 ++++---- sonar-update-center-mojo/src/main/resources/styles.css | 2 +- .../sonar/updatecenter/mojo/SonarVersionModelTest.java | 2 +- .../CompatibilityMatrixTest/compatibility-matrix.html | 10 +++++----- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sonar-update-center-mojo/src/main/java/org/sonar/updatecenter/mojo/CompatibilityMatrix.java b/sonar-update-center-mojo/src/main/java/org/sonar/updatecenter/mojo/CompatibilityMatrix.java index a736570e..dfb1e7fd 100644 --- a/sonar-update-center-mojo/src/main/java/org/sonar/updatecenter/mojo/CompatibilityMatrix.java +++ b/sonar-update-center-mojo/src/main/java/org/sonar/updatecenter/mojo/CompatibilityMatrix.java @@ -36,7 +36,7 @@ public class CompatibilityMatrix { private static final Comparator SONAR_VERSION_MODEL_COMPARATOR = - Comparator.comparing(SonarVersionModel::isLts).thenComparing(svm -> Version.create(svm.getRealVersion())).reversed(); + Comparator.comparing(SonarVersionModel::isLta).thenComparing(svm -> Version.create(svm.getRealVersion())).reversed(); private final File outputDirectory; private final UpdateCenter center; @@ -67,8 +67,8 @@ public void generateHtml() throws IOException { for (Release sq : center.getSonar().getMajorReleases()) { String displayVersion = sq.getVersion().getMajor() + "." + sq.getVersion().getMinor(); Date releaseDate = sq.getDate(); - boolean isLts = center.getSonar().getLtsRelease().equals(sq); - sqVersions.add(new SonarVersionModel(sq.getVersion().toString(), displayVersion, releaseDate, isLts)); + boolean isLta = center.getSonar().getLtaVersion().equals(sq); + sqVersions.add(new SonarVersionModel(sq.getVersion().toString(), displayVersion, releaseDate, isLta)); } sqVersions.sort(SONAR_VERSION_MODEL_COMPARATOR); diff --git a/sonar-update-center-mojo/src/main/java/org/sonar/updatecenter/mojo/SonarVersionModel.java b/sonar-update-center-mojo/src/main/java/org/sonar/updatecenter/mojo/SonarVersionModel.java index 1851cf1c..d477a7fc 100644 --- a/sonar-update-center-mojo/src/main/java/org/sonar/updatecenter/mojo/SonarVersionModel.java +++ b/sonar-update-center-mojo/src/main/java/org/sonar/updatecenter/mojo/SonarVersionModel.java @@ -27,13 +27,13 @@ public class SonarVersionModel { private final String realVersion; private final String displayVersion; - private final boolean isLts; + private final boolean isLta; @Nullable private final Date releaseDate; - public SonarVersionModel(String realVersion, String displayVersion, @Nullable Date releaseDate, boolean isLts) { + public SonarVersionModel(String realVersion, String displayVersion, @Nullable Date releaseDate, boolean isLta) { this.realVersion = realVersion; - this.isLts = isLts; + this.isLta = isLta; this.displayVersion = displayVersion; this.releaseDate = releaseDate; } @@ -52,8 +52,8 @@ public String getRealVersion() { return realVersion; } - public boolean isLts() { - return isLts; + public boolean isLta() { + return isLta; } public String getReleaseDate() { diff --git a/sonar-update-center-mojo/src/main/resources/org/sonar/updatecenter/mojo/matrix-template.html.ftl b/sonar-update-center-mojo/src/main/resources/org/sonar/updatecenter/mojo/matrix-template.html.ftl index a84542c4..3e0f3753 100644 --- a/sonar-update-center-mojo/src/main/resources/org/sonar/updatecenter/mojo/matrix-template.html.ftl +++ b/sonar-update-center-mojo/src/main/resources/org/sonar/updatecenter/mojo/matrix-template.html.ftl @@ -16,8 +16,8 @@ <#list matrix.sqVersions as sqVersion> ${sqVersion.displayVersion} - <#if sqVersion.isLts() > -
(LTS) + <#if sqVersion.isLta() > +
(LTA) @@ -25,7 +25,7 @@ Plugin / Release Date <#list matrix.sqVersions as sqVersion> - ${(sqVersion.releaseDate)!} + ${(sqVersion.releaseDate)!} @@ -41,7 +41,7 @@ <#list matrix.sqVersions as sqVersion> - + <#if plugin.supports(sqVersion.realVersion) > ${plugin.supportedVersion(sqVersion.realVersion)} <#else> diff --git a/sonar-update-center-mojo/src/main/resources/styles.css b/sonar-update-center-mojo/src/main/resources/styles.css index ebade59c..fc916705 100644 --- a/sonar-update-center-mojo/src/main/resources/styles.css +++ b/sonar-update-center-mojo/src/main/resources/styles.css @@ -53,6 +53,6 @@ table th { color: white; } -table td.lts { +table td.lta { background-color: rgba(202, 227, 242, 0.5); } diff --git a/sonar-update-center-mojo/src/test/java/org/sonar/updatecenter/mojo/SonarVersionModelTest.java b/sonar-update-center-mojo/src/test/java/org/sonar/updatecenter/mojo/SonarVersionModelTest.java index 05cfa16d..426813f8 100644 --- a/sonar-update-center-mojo/src/test/java/org/sonar/updatecenter/mojo/SonarVersionModelTest.java +++ b/sonar-update-center-mojo/src/test/java/org/sonar/updatecenter/mojo/SonarVersionModelTest.java @@ -38,6 +38,6 @@ public void testGetters() { assertThat(model.getDisplayVersion()).isEqualTo("6.7"); assertThat(model.getRealVersion()).isEqualTo("6.7.1"); assertThat(model.getReleaseDate()).isEqualTo("Nov 2017"); - assertThat(model.isLts()).isTrue(); + assertThat(model.isLta()).isTrue(); } } diff --git a/sonar-update-center-mojo/src/test/resources/org/sonar/updatecenter/mojo/CompatibilityMatrixTest/compatibility-matrix.html b/sonar-update-center-mojo/src/test/resources/org/sonar/updatecenter/mojo/CompatibilityMatrixTest/compatibility-matrix.html index c00f9060..314d22d7 100644 --- a/sonar-update-center-mojo/src/test/resources/org/sonar/updatecenter/mojo/CompatibilityMatrixTest/compatibility-matrix.html +++ b/sonar-update-center-mojo/src/test/resources/org/sonar/updatecenter/mojo/CompatibilityMatrixTest/compatibility-matrix.html @@ -15,7 +15,7 @@ SonarQube Version 3.7 -
(LTS) +
(LTA) 10.0 @@ -29,7 +29,7 @@ Plugin / Release Date - + @@ -41,7 +41,7 @@ abap - + (not compatible) @@ -59,7 +59,7 @@ bar - + (not compatible) @@ -77,7 +77,7 @@ foo - + (not compatible)