@@ -174,7 +174,7 @@ export async function setUpGraalVMJDKDevBuild(): Promise<string> {
174174 return downloadAndExtractJDK ( downloadUrl )
175175}
176176
177- export function findHighestJavaVersion ( release : c . LatestReleaseResponseData , version : string ) : string {
177+ export function findHighestJavaVersion ( release : c . LatestReleaseResponseData , version : string ) : string | undefined {
178178 const graalVMIdentifierPattern = determineGraalVMLegacyIdentifier ( false , version , '(\\d+)' )
179179 const expectedFileNameRegExp = new RegExp (
180180 `^${ graalVMIdentifierPattern } ${ c . GRAALVM_FILE_EXTENSION . replace ( / \. / g, '\\.' ) } $`
@@ -192,9 +192,7 @@ export function findHighestJavaVersion(release: c.LatestReleaseResponseData, ver
192192 if ( highestJavaVersion > 0 ) {
193193 return String ( highestJavaVersion )
194194 } else {
195- throw new Error (
196- 'Could not find highest Java version. Please file an issue at: https://github.com/graalvm/setup-graalvm/issues.'
197- )
195+ return undefined
198196 }
199197}
200198
@@ -234,8 +232,10 @@ export async function setUpGraalVMRelease(gdsToken: string, version: string, jav
234232 return downloadExtractAndCacheJDK ( downloader , toolName , version )
235233}
236234
237- function findDownloadUrl ( release : c . LatestReleaseResponseData , javaVersion : string ) : string {
238- const graalVMIdentifier = determineGraalVMLegacyIdentifier ( false , c . VERSION_DEV , javaVersion )
235+ function findDownloadUrl ( release : c . LatestReleaseResponseData , javaVersion ?: string ) : string {
236+ const graalVMIdentifier = javaVersion
237+ ? determineGraalVMLegacyIdentifier ( false , c . VERSION_DEV , javaVersion )
238+ : determineGraalVMIdentifier ( false , c . VERSION_DEV )
239239 const expectedFileName = `${ graalVMIdentifier } ${ c . GRAALVM_FILE_EXTENSION } `
240240 for ( const asset of release . assets ) {
241241 if ( asset . name === expectedFileName ) {
@@ -247,6 +247,11 @@ function findDownloadUrl(release: c.LatestReleaseResponseData, javaVersion: stri
247247 )
248248}
249249
250+ function determineGraalVMIdentifier ( isEE : boolean , version : string ) : string {
251+ const infix = isEE ? 'ee' : version === c . VERSION_DEV ? 'community' : 'ce'
252+ return `graalvm-${ infix } -${ version } -${ c . GRAALVM_PLATFORM } -${ c . GRAALVM_ARCH } `
253+ }
254+
250255function determineGraalVMLegacyIdentifier ( isEE : boolean , version : string , javaVersion : string ) : string {
251256 return `${ determineLegacyToolName ( isEE , version , javaVersion ) } -${ c . GRAALVM_ARCH } -${ version } `
252257}
0 commit comments