Skip to content

Commit 1960874

Browse files
committed
Add function to make best-effort attempt at finding the latest version of rascal-maven-plugin
1 parent 0976d9a commit 1960874

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎src/org/rascalmpl/library/util/Reflective.rsc‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ private str pomXml(str name, str group, str version)
529529
' \<plugin\>
530530
' \<groupId\>org.rascalmpl\</groupId\>
531531
' \<artifactId\>rascal-maven-plugin\</artifactId\>
532-
' \<version\>0.30.3\</version\>
532+
' \<version\><getRascalMavenPluginVersion()>\</version\>
533533
' \<configuration\>
534534
' \<errorsAsWarnings\>true\</errorsAsWarnings\>
535535
' \<bin\>${project.build.outputDirectory}\</bin\>
@@ -552,6 +552,16 @@ private str pomXml(str name, str group, str version)
552552
'\</project\>
553553
";
554554

555+
private str getRascalMavenPluginVersion() {
556+
try { // Best-effort attempt to get the latest version
557+
loc l = |https://api.github.com/repos/usethesource/rascal-maven-plugin/releases/latest|;
558+
if (/"tag_name":\s*"v<version:[0-9]+\.[0-9]+\.[0-9]+>"/ := readFile(l)) {
559+
return version;
560+
}
561+
} catch _: ;
562+
return "0.31.0"; // 2 March 2026
563+
}
564+
555565
private str vscodeSettings() = "{
556566
' \"search.exclude\": {
557567
' \"/target/\": true,

0 commit comments

Comments
 (0)