Skip to content

Commit

Permalink
Merge pull request quarkusio#44833 from gsmet/various-fixes
Browse files Browse the repository at this point in the history
Some small improvements to CLI doc and also removed some reference to Java 11
  • Loading branch information
gsmet authored Dec 9, 2024
2 parents fbe2d6e + 139a74d commit d2669c9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ public JavaVersion getJavaVersion() {

public interface JavaVersion {

@Deprecated(forRemoval = true)
Status isExactlyJava11();

@Deprecated(forRemoval = true)
Status isJava11OrHigher();

@Deprecated(forRemoval = true)
Status isJava17OrHigher();

Status isJava21OrHigher();

Status isJava19OrHigher();
Expand All @@ -48,21 +39,6 @@ final class Unknown implements JavaVersion {
Unknown() {
}

@Override
public Status isExactlyJava11() {
return Status.UNKNOWN;
}

@Override
public Status isJava11OrHigher() {
return Status.UNKNOWN;
}

@Override
public Status isJava17OrHigher() {
return Status.UNKNOWN;
}

@Override
public Status isJava21OrHigher() {
return Status.UNKNOWN;
Expand All @@ -76,8 +52,6 @@ public Status isJava19OrHigher() {

final class Known implements JavaVersion {

private static final int JAVA_11_MAJOR = 55;
private static final int JAVA_17_MAJOR = 61;
private static final int JAVA_19_MAJOR = 63;
private static final int JAVA_21_MAJOR = 65;

Expand All @@ -87,21 +61,6 @@ final class Known implements JavaVersion {
this.determinedMajor = determinedMajor;
}

@Override
public Status isExactlyJava11() {
return equalStatus(JAVA_11_MAJOR);
}

@Override
public Status isJava11OrHigher() {
return higherOrEqualStatus(JAVA_11_MAJOR);
}

@Override
public Status isJava17OrHigher() {
return higherOrEqualStatus(JAVA_17_MAJOR);
}

@Override
public Status isJava19OrHigher() {
return higherOrEqualStatus(JAVA_19_MAJOR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class TargetQuarkusPlatformGroup {
static final String FULL_EXAMPLE = ToolsConstants.DEFAULT_PLATFORM_BOM_GROUP_ID + ":"
+ ToolsConstants.DEFAULT_PLATFORM_BOM_ARTIFACT_ID + ":2.2.0.Final";
+ ToolsConstants.DEFAULT_PLATFORM_BOM_ARTIFACT_ID + ":3.15.2";
PlatformStreamCoords streamCoords = null;
String validStream = null;

Expand All @@ -20,7 +20,7 @@ public class TargetQuarkusPlatformGroup {
CommandSpec spec;

@CommandLine.Option(paramLabel = "platformKey:streamId", names = { "-S",
"--stream" }, description = "A target stream, for example:%n io.quarkus.platform:2.0")
"--stream" }, description = "A target stream, for example:%n 3.15 or io.quarkus.platform:3.15")
void setStream(String stream) {
stream = stream.trim();
if (!stream.isEmpty()) {
Expand All @@ -39,7 +39,7 @@ void setStream(String stream) {
"--platform-bom" }, description = "A specific Quarkus platform BOM, for example:%n"
+ " " + FULL_EXAMPLE + "%n"
+ " io.quarkus::999-SNAPSHOT"
+ " 2.2.0.Final%n"
+ " 3.15.2%n"
+ "Default groupId: " + ToolsConstants.DEFAULT_PLATFORM_BOM_GROUP_ID + "%n"
+ "Default artifactId: " + ToolsConstants.DEFAULT_PLATFORM_BOM_ARTIFACT_ID + "%n")
void setPlatformBom(String bom) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
public class TargetQuarkusVersionGroup {

@CommandLine.Option(paramLabel = "targetStream", names = { "-S",
"--stream" }, description = "A target stream, for example:%n 2.0")
"--stream" }, description = "A target stream, for example:%n 3.15")
public String streamId;

@CommandLine.Option(paramLabel = "targetPlatformVersion", names = { "-P",
"--platform-version" }, description = "A specific target Quarkus platform version, for example:%n"
+ " 2.2.0.Final%n")
+ " 3.15.2%n")
public String platformVersion;

//@CommandLine.Option(names = { "-L",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public String toString() {
}

// ordering is important here, so let's keep them ordered
public static final SortedSet<Integer> JAVA_VERSIONS_LTS = new TreeSet<>(List.of(11, 17, 21));
public static final SortedSet<Integer> JAVA_VERSIONS_LTS = new TreeSet<>(List.of(17, 21));
public static final int DEFAULT_JAVA_VERSION = 17;
// we want to maximize the compatibility of extensions with the Quarkus ecosystem so let's stick to 17 by default
public static final String DEFAULT_JAVA_VERSION_FOR_EXTENSION = "17";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public void givenJavaVersion21ShouldReturn21() {

@Test
void shouldProperlyUseMinJavaVersion() {
assertThat(getCompatibleLTSVersions(new JavaVersion("11"))).isEqualTo(JAVA_VERSIONS_LTS);
assertThat(getCompatibleLTSVersions(new JavaVersion("17"))).containsExactly(17, 21);
assertThat(getCompatibleLTSVersions(new JavaVersion("21"))).containsExactly(21);
assertThat(getCompatibleLTSVersions(new JavaVersion("100"))).isEmpty();
Expand All @@ -52,8 +51,6 @@ public void givenAutoDetectShouldReturnAppropriateVersion() {

@Test
public void testDetermineBestLtsVersion() {
assertEquals(17, determineBestJavaLtsVersion(8));
assertEquals(11, determineBestJavaLtsVersion(11));
assertEquals(17, determineBestJavaLtsVersion(17));
assertEquals(17, determineBestJavaLtsVersion(18));
assertEquals(21, determineBestJavaLtsVersion(21));
Expand Down

0 comments on commit d2669c9

Please sign in to comment.