feat(visionos): Vision Pro support (#10392)

This commit is contained in:
Nathan Walker
2023-09-28 17:55:40 -07:00
committed by GitHub
parent ff66b1bb8e
commit bbede5d795
98 changed files with 5545 additions and 470 deletions

View File

@ -7,6 +7,7 @@ import { env } from '../';
import AndroidPlatform from '../platforms/android';
import iOSPlatform from '../platforms/ios';
import visionOSPlatform from '../platforms/visionos';
export interface INativeScriptPlatform {
getEntryPath?(): string;
@ -21,6 +22,7 @@ const platforms: {
} = {
android: AndroidPlatform,
ios: iOSPlatform,
visionos: visionOSPlatform,
};
/**
@ -60,6 +62,10 @@ export function getPlatformName(): Platform {
return 'ios';
}
if (env?.visionos) {
return 'visionos';
}
// support custom platforms
if (env?.platform) {
if (platforms[env.platform]) {
@ -80,7 +86,7 @@ export function getPlatformName(): Platform {
Available platforms: ${Object.keys(platforms).join(', ')}
Use --env.platform=<platform> or --env.android, --env.ios to specify the target platform.
Use --env.platform=<platform> or --env.android, --env.ios, --env.visionos to specify the target platform.
Defaulting to "ios".
`