Skip to content

Commit

Permalink
UPC-138 Update plugin matrix with LTA
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-geoffroy-sonarsource committed Mar 27, 2024
1 parent 58ae279 commit b6c67a2
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

public class CompatibilityMatrix {
private static final Comparator<SonarVersionModel> 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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -52,8 +52,8 @@ public String getRealVersion() {
return realVersion;
}

public boolean isLts() {
return isLts;
public boolean isLta() {
return isLta;
}

public String getReleaseDate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
<#list matrix.sqVersions as sqVersion>
<th>
${sqVersion.displayVersion}
<#if sqVersion.isLts() >
<br/> <strong>(LTS)</strong>
<#if sqVersion.isLta() >
<br/> <strong>(LTA)</strong>
</#if>
</th>
</#list>
</tr>
<tr>
<td style="white-space:nowrap"><strong>Plugin / Release Date</strong></td>
<#list matrix.sqVersions as sqVersion>
<td${sqVersion.isLts()?string(' class="lts"', '')}>${(sqVersion.releaseDate)!}</td>
<td${sqVersion.isLta()?string(' class="lta"', '')}>${(sqVersion.releaseDate)!}</td>
</#list>
</tr>
</thead>
Expand All @@ -41,7 +41,7 @@
</strong>
</td>
<#list matrix.sqVersions as sqVersion>
<td${sqVersion.isLts()?string(' class="lts"', '')}>
<td${sqVersion.isLta()?string(' class="lta"', '')}>
<#if plugin.supports(sqVersion.realVersion) >
${plugin.supportedVersion(sqVersion.realVersion)}
<#else>
Expand Down
2 changes: 1 addition & 1 deletion sonar-update-center-mojo/src/main/resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ table th {
color: white;
}

table td.lts {
table td.lta {
background-color: rgba(202, 227, 242, 0.5);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<th><strong>SonarQube Version</strong></th>
<th>
3.7
<br/> <strong>(LTS)</strong>
<br/> <strong>(LTA)</strong>
</th>
<th>
10.0
Expand All @@ -29,7 +29,7 @@
</tr>
<tr>
<td style="white-space:nowrap"><strong>Plugin / Release Date</strong></td>
<td class="lts"></td>
<td class="lta"></td>
<td></td>
<td></td>
<td></td>
Expand All @@ -41,7 +41,7 @@
abap
</strong>
</td>
<td class="lts">
<td class="lta">
<img class="emoticon" alt="(not compatible)" src="error.png" />
</td>
<td>
Expand All @@ -59,7 +59,7 @@
bar
</strong>
</td>
<td class="lts">
<td class="lta">
<img class="emoticon" alt="(not compatible)" src="error.png" />
</td>
<td>
Expand All @@ -77,7 +77,7 @@
foo
</strong>
</td>
<td class="lts">
<td class="lta">
<img class="emoticon" alt="(not compatible)" src="error.png" />
</td>
<td>
Expand Down

0 comments on commit b6c67a2

Please sign in to comment.