|
|
|
@ -17,8 +17,7 @@
|
|
|
|
|
package org.springframework.boot.buildpack.platform.build;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.stream.IntStream;
|
|
|
|
|
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
@ -32,8 +31,7 @@ final class ApiVersions {
|
|
|
|
|
/**
|
|
|
|
|
* The platform API versions supported by this release.
|
|
|
|
|
*/
|
|
|
|
|
static final ApiVersions SUPPORTED_PLATFORMS = new ApiVersions(ApiVersion.of(0, 3), ApiVersion.of(0, 4),
|
|
|
|
|
ApiVersion.of(0, 5), ApiVersion.of(0, 6), ApiVersion.of(0, 7), ApiVersion.of(0, 8));
|
|
|
|
|
static final ApiVersions SUPPORTED_PLATFORMS = ApiVersions.of(0, IntStream.rangeClosed(3, 9));
|
|
|
|
|
|
|
|
|
|
private final ApiVersion[] apiVersions;
|
|
|
|
|
|
|
|
|
@ -92,8 +90,12 @@ final class ApiVersions {
|
|
|
|
|
* @throws IllegalArgumentException if any values could not be parsed
|
|
|
|
|
*/
|
|
|
|
|
static ApiVersions parse(String... values) {
|
|
|
|
|
List<ApiVersion> versions = Arrays.stream(values).map(ApiVersion::parse).collect(Collectors.toList());
|
|
|
|
|
return new ApiVersions(versions.toArray(new ApiVersion[] {}));
|
|
|
|
|
return new ApiVersions(Arrays.stream(values).map(ApiVersion::parse).toArray(ApiVersion[]::new));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ApiVersions of(int major, IntStream minorsInclusive) {
|
|
|
|
|
return new ApiVersions(
|
|
|
|
|
minorsInclusive.mapToObj((minor) -> ApiVersion.of(major, minor)).toArray(ApiVersion[]::new));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|