mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
feat(visionos): Vision Pro support (#10392)
This commit is contained in:
@ -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".
|
||||
`
|
||||
|
Reference in New Issue
Block a user