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';
|
import Platform from './platform';
|
||||||
|
|
||||||
class ImageTag {
|
class ImageTag {
|
||||||
@ -15,15 +15,7 @@ class ImageTag {
|
|||||||
throw new Error(`Invalid version "${version}".`);
|
throw new Error(`Invalid version "${version}".`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!has(ImageTag.targetPlatformToImageSuffixMap, platform)) {
|
const builderPlatform = ImageTag.getTargetPlatformToImageSuffixMap(platform, version);
|
||||||
throw new Error(`Platform "${platform}" is currently not supported.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const builderPlatform = get(
|
|
||||||
ImageTag.targetPlatformToImageSuffixMap,
|
|
||||||
platform,
|
|
||||||
ImageTag.imageSuffixes.generic,
|
|
||||||
);
|
|
||||||
|
|
||||||
Object.assign(this, { repository, name, version, platform, builderPlatform, customImage });
|
Object.assign(this, { repository, name, version, platform, builderPlatform, customImage });
|
||||||
}
|
}
|
||||||
@ -39,38 +31,78 @@ class ImageTag {
|
|||||||
mac: 'mac-mono',
|
mac: 'mac-mono',
|
||||||
windows: 'windows-mono',
|
windows: 'windows-mono',
|
||||||
linux: 'base',
|
linux: 'base',
|
||||||
|
linuxIl2cpp: 'linux-il2cpp',
|
||||||
android: 'android',
|
android: 'android',
|
||||||
ios: 'ios',
|
ios: 'ios',
|
||||||
facebook: 'facebook',
|
facebook: 'facebook',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static get targetPlatformToImageSuffixMap() {
|
static getTargetPlatformToImageSuffixMap(platform, version) {
|
||||||
const { generic, webgl, mac, windows, linux, android, ios, facebook } = ImageTag.imageSuffixes;
|
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
|
// @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html
|
||||||
return {
|
switch (platform) {
|
||||||
[Platform.types.StandaloneOSX]: mac,
|
case Platform.types.StandaloneOSX:
|
||||||
[Platform.types.StandaloneWindows]: windows,
|
return mac;
|
||||||
[Platform.types.StandaloneWindows64]: windows,
|
case Platform.types.StandaloneWindows:
|
||||||
[Platform.types.StandaloneLinux64]: linux,
|
return windows;
|
||||||
[Platform.types.iOS]: ios,
|
case Platform.types.StandaloneWindows64:
|
||||||
[Platform.types.Android]: android,
|
return windows;
|
||||||
[Platform.types.WebGL]: webgl,
|
case Platform.types.StandaloneLinux64: {
|
||||||
[Platform.types.WSAPlayer]: windows,
|
// Unity versions before 2019.3 do not support il2cpp
|
||||||
[Platform.types.PS4]: windows,
|
if (major >= 2020 || (major === 2019 && minor >= 3)) {
|
||||||
[Platform.types.XboxOne]: windows,
|
return linuxIl2cpp;
|
||||||
[Platform.types.tvOS]: windows,
|
}
|
||||||
[Platform.types.Switch]: windows,
|
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
|
// Unsupported
|
||||||
[Platform.types.Lumin]: windows,
|
case Platform.types.Lumin:
|
||||||
[Platform.types.BJM]: windows,
|
return windows;
|
||||||
[Platform.types.Stadia]: windows,
|
case Platform.types.BJM:
|
||||||
[Platform.types.Facebook]: facebook,
|
return windows;
|
||||||
[Platform.types.NoTarget]: generic,
|
case Platform.types.Stadia:
|
||||||
|
return windows;
|
||||||
|
case Platform.types.Facebook:
|
||||||
|
return facebook;
|
||||||
|
case Platform.types.NoTarget:
|
||||||
|
return generic;
|
||||||
|
|
||||||
// Test specific
|
// 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() {
|
get tag() {
|
||||||
|
Loading…
Reference in New Issue
Block a user