Do not clear compatibility justifications on known pre-release patterns
//DEPS io.vertx:vertx-core:3.9.4
//DEPS info.picocli:picocli:4.6.3
-
-import java.io.*;
-import java.util.*;
-import java.util.stream.*;
-import java.nio.charset.*;
-import java.nio.file.*;
-
-import io.vertx.core.json.*;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.vertx.core.json.JsonArray;
+import io.vertx.core.json.JsonObject;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
import picocli.CommandLine.Parameters;
+import java.io.File;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.util.*;
import java.util.concurrent.Callable;
-
-import com.fasterxml.jackson.annotation.*;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
@Command(name = "compatibility", mixinStandardHelpOptions = true, version = "0.1",
description = "Mutiny Compatibility Utils")
@@ -29,6 +31,14 @@ class CompatibilityUtils implements Callable<Integer> {
@Option(names = "--do-not-clear-version-prefix", description = "Do not clear if the version starts with the prefix (e.g., `1.2`, `1.`, etc)")
private String[] clearExcludes = new String[0];
+ private final Set<String> preReleaseFragments = Set.of(
+ "-alpha",
+ "-beta",
+ "-milestone",
+ "-rc",
+ "-pre"
+ );
+
@Option(names = "--version", description = "The release version")
private String version = "";
@@ -57,6 +67,12 @@ class CompatibilityUtils implements Callable<Integer> {
}
if (command.equalsIgnoreCase("clear")) {
+ for (String fragment : preReleaseFragments) {
+ if (version.contains(fragment)) {
+ System.out.println("Not clearing for version " + version + " (it's a pre-release)");
+ return 0;
+ }
+ }
for (String exclude : clearExcludes) {
if (version.startsWith(exclude)) {
System.out.println("Not clearing for version " + version + " (starts with `" + exclude + "`)");
@@ -218,7 +234,7 @@ class CompatibilityUtils implements Callable<Integer> {
return code;
}
- @java.lang.Override
+ @Override
public java.lang.String toString() {
if (isNotBlank(oldMethod) && isNotBlank(newMethod)) {
return "`" + oldMethod + "` updated to `" + newMethod + "`: _" + justification + "_";
