Add support for GraalVM Enterprise Edition.

Fixes #5.
This commit is contained in:
Fabio Niephaus
2022-03-03 17:24:24 +01:00
committed by Fabio Niephaus
parent 1a4a7ccb68
commit 2240cb3432
13 changed files with 415 additions and 41 deletions

View File

@@ -2,6 +2,7 @@ import {GRAALVM_PLATFORM} from './constants'
import {exec} from '@actions/exec'
import {join} from 'path'
const BASE_FLAGS = ['--non-interactive', 'install', '--no-progress']
const COMPONENT_TO_POST_INSTALL_HOOK = new Map<string, Map<string, string>>([
[
'linux',
@@ -21,10 +22,16 @@ const COMPONENT_TO_POST_INSTALL_HOOK = new Map<string, Map<string, string>>([
])
export async function setUpGUComponents(
gdsToken: string,
graalVMHome: string,
components: string[]
): Promise<void> {
await exec('gu', ['install', '--no-progress'].concat(components))
const optionalFlags = []
if (gdsToken.length > 0) {
optionalFlags.push('--token', gdsToken)
}
await exec('gu', BASE_FLAGS.concat(optionalFlags, components))
const platformHooks = COMPONENT_TO_POST_INSTALL_HOOK.get(GRAALVM_PLATFORM)
if (platformHooks) {