mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
add il2cpp support for linux from 2019.3 (#177)
This commit is contained in:
parent
9e2a1b2d35
commit
8eeb848483
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
import { has, get, trimEnd, trimStart } from 'lodash-es';
|
||||
import { trimEnd, trimStart } from 'lodash-es';
|
||||
import Platform from './platform';
|
||||
|
||||
class ImageTag {
|
||||
@ -15,15 +15,7 @@ class ImageTag {
|
||||
throw new Error(`Invalid version "${version}".`);
|
||||
}
|
||||
|
||||
if (!has(ImageTag.targetPlatformToImageSuffixMap, platform)) {
|
||||
throw new Error(`Platform "${platform}" is currently not supported.`);
|
||||
}
|
||||
|
||||
const builderPlatform = get(
|
||||
ImageTag.targetPlatformToImageSuffixMap,
|
||||
platform,
|
||||
ImageTag.imageSuffixes.generic,
|
||||
);
|
||||
const builderPlatform = ImageTag.getTargetPlatformToImageSuffixMap(platform, version);
|
||||
|
||||
Object.assign(this, { repository, name, version, platform, builderPlatform, customImage });
|
||||
}
|
||||
@ -39,38 +31,78 @@ class ImageTag {
|
||||
mac: 'mac-mono',
|
||||
windows: 'windows-mono',
|
||||
linux: 'base',
|
||||
linuxIl2cpp: 'linux-il2cpp',
|
||||
android: 'android',
|
||||
ios: 'ios',
|
||||
facebook: 'facebook',
|
||||
};
|
||||
}
|
||||
|
||||
static get targetPlatformToImageSuffixMap() {
|
||||
const { generic, webgl, mac, windows, linux, android, ios, facebook } = ImageTag.imageSuffixes;
|
||||
static getTargetPlatformToImageSuffixMap(platform, version) {
|
||||
const {
|
||||
generic,
|
||||
webgl,
|
||||
mac,
|
||||
windows,
|
||||
linux,
|
||||
linuxIl2cpp,
|
||||
android,
|
||||
ios,
|
||||
facebook,
|
||||
} = ImageTag.imageSuffixes;
|
||||
|
||||
const [major, minor] = version.split('.');
|
||||
// @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html
|
||||
return {
|
||||
[Platform.types.StandaloneOSX]: mac,
|
||||
[Platform.types.StandaloneWindows]: windows,
|
||||
[Platform.types.StandaloneWindows64]: windows,
|
||||
[Platform.types.StandaloneLinux64]: linux,
|
||||
[Platform.types.iOS]: ios,
|
||||
[Platform.types.Android]: android,
|
||||
[Platform.types.WebGL]: webgl,
|
||||
[Platform.types.WSAPlayer]: windows,
|
||||
[Platform.types.PS4]: windows,
|
||||
[Platform.types.XboxOne]: windows,
|
||||
[Platform.types.tvOS]: windows,
|
||||
[Platform.types.Switch]: windows,
|
||||
switch (platform) {
|
||||
case Platform.types.StandaloneOSX:
|
||||
return mac;
|
||||
case Platform.types.StandaloneWindows:
|
||||
return windows;
|
||||
case Platform.types.StandaloneWindows64:
|
||||
return windows;
|
||||
case Platform.types.StandaloneLinux64: {
|
||||
// Unity versions before 2019.3 do not support il2cpp
|
||||
if (major >= 2020 || (major === 2019 && minor >= 3)) {
|
||||
return linuxIl2cpp;
|
||||
}
|
||||
return linux;
|
||||
}
|
||||
case Platform.types.iOS:
|
||||
return ios;
|
||||
case Platform.types.Android:
|
||||
return android;
|
||||
case Platform.types.WebGL:
|
||||
return webgl;
|
||||
case Platform.types.WSAPlayer:
|
||||
return windows;
|
||||
case Platform.types.PS4:
|
||||
return windows;
|
||||
case Platform.types.XboxOne:
|
||||
return windows;
|
||||
case Platform.types.tvOS:
|
||||
return windows;
|
||||
case Platform.types.Switch:
|
||||
return windows;
|
||||
// Unsupported
|
||||
[Platform.types.Lumin]: windows,
|
||||
[Platform.types.BJM]: windows,
|
||||
[Platform.types.Stadia]: windows,
|
||||
[Platform.types.Facebook]: facebook,
|
||||
[Platform.types.NoTarget]: generic,
|
||||
case Platform.types.Lumin:
|
||||
return windows;
|
||||
case Platform.types.BJM:
|
||||
return windows;
|
||||
case Platform.types.Stadia:
|
||||
return windows;
|
||||
case Platform.types.Facebook:
|
||||
return facebook;
|
||||
case Platform.types.NoTarget:
|
||||
return generic;
|
||||
|
||||
// Test specific
|
||||
[Platform.types.Test]: generic,
|
||||
};
|
||||
case Platform.types.Test:
|
||||
return generic;
|
||||
default:
|
||||
throw new Error(`
|
||||
Platform must be one of the ones described in the documentation.
|
||||
"${platform}" is currently not supported.`);
|
||||
}
|
||||
}
|
||||
|
||||
get tag() {
|
||||
|
Loading…
Reference in New Issue
Block a user