Skip to content

Commit f535002

Browse files
committed
feat: visionos helpers
1 parent 29de91f commit f535002

File tree

9 files changed

+101
-6
lines changed

9 files changed

+101
-6
lines changed

packages/nx/src/executors/build/build.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@
7777
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/iOS/{filepath} however you can specify relative path if located elsewhere."
7878
}
7979
},
80+
"visionos": {
81+
"type": "object",
82+
"required": [],
83+
"provision": {
84+
"type": "string",
85+
"description": "(visionOS Only) When building, use this provision profile name."
86+
},
87+
"plistUpdates": {
88+
"type": "object",
89+
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/visionOS/{filepath} however you can specify relative path if located elsewhere."
90+
}
91+
},
8092
"device": {
8193
"type": "string",
8294
"description": "Device identifier to run app on.",

packages/nx/src/executors/build/debug.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@
7777
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/iOS/{filepath} however you can specify relative path if located elsewhere."
7878
}
7979
},
80+
"visionos": {
81+
"type": "object",
82+
"required": [],
83+
"provision": {
84+
"type": "string",
85+
"description": "(visionOS Only) When building, use this provision profile name."
86+
},
87+
"plistUpdates": {
88+
"type": "object",
89+
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/visionOS/{filepath} however you can specify relative path if located elsewhere."
90+
}
91+
},
8092
"device": {
8193
"type": "string",
8294
"description": "Device identifier to run app on.",

packages/nx/src/executors/build/prepare.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@
7777
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/iOS/{filepath} however you can specify relative path if located elsewhere."
7878
}
7979
},
80+
"visionos": {
81+
"type": "object",
82+
"required": [],
83+
"provision": {
84+
"type": "string",
85+
"description": "(visionOS Only) When building, use this provision profile name."
86+
},
87+
"plistUpdates": {
88+
"type": "object",
89+
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/visionOS/{filepath} however you can specify relative path if located elsewhere."
90+
}
91+
},
8092
"device": {
8193
"type": "string",
8294
"description": "Device identifier to run app on.",

packages/nx/src/executors/build/run.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@
7777
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/iOS/{filepath} however you can specify relative path if located elsewhere."
7878
}
7979
},
80+
"visionos": {
81+
"type": "object",
82+
"required": [],
83+
"provision": {
84+
"type": "string",
85+
"description": "(visionOS Only) When building, use this provision profile name."
86+
},
87+
"plistUpdates": {
88+
"type": "object",
89+
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/visionOS/{filepath} however you can specify relative path if located elsewhere."
90+
}
91+
},
8092
"device": {
8193
"type": "string",
8294
"description": "Device identifier to run app on.",

packages/nx/src/executors/build/test.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@
7777
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/iOS/{filepath} however you can specify relative path if located elsewhere."
7878
}
7979
},
80+
"visionos": {
81+
"type": "object",
82+
"required": [],
83+
"provision": {
84+
"type": "string",
85+
"description": "(visionOS Only) When building, use this provision profile name."
86+
},
87+
"plistUpdates": {
88+
"type": "object",
89+
"description": "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/visionOS/{filepath} however you can specify relative path if located elsewhere."
90+
}
91+
},
8092
"device": {
8193
"type": "string",
8294
"description": "Device identifier to run app on.",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { KeysOfProperty } from '../utils/types';
2+
import { IosSchema } from './ios-properties.schema';
3+
4+
export interface visionOSSchema extends IosSchema {
5+
6+
}
7+
8+
export const visionOSSchema = {
9+
$schema: 'http://json-schema.org/schema',
10+
title: 'visionOS Properties',
11+
description: '',
12+
type: 'object',
13+
properties: {
14+
visionos: <KeysOfProperty<visionOSSchema>>{
15+
type: 'object',
16+
required: [],
17+
provision: {
18+
type: 'string',
19+
description: '(visionOS Only) When building, use this provision profile name.',
20+
},
21+
plistUpdates: {
22+
type: 'object',
23+
description: "Update any .plist value. Specify name of any filename with key/value pairs, e.g. { 'Info.plist': { CFBundleDisplayName: 'MyApp' } }. Defaults to look in App_Resources/visionOS/{filepath} however you can specify relative path if located elsewhere.",
24+
},
25+
},
26+
},
27+
};

packages/nx/src/utils/executors.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ export function commonExecutor(options: ExecutorSchema, context: ExecutorContext
114114

115115
function prepareNsOptions(options: ExecutorSchema, projectCwd: string) {
116116
const nsOptions: string[] = [];
117-
nsOptions.push(options.command);
117+
if (options.platform === 'visionos') {
118+
// visionos does not support debug with chrome devtools yet
119+
nsOptions.push('run');
120+
} else {
121+
nsOptions.push(options.command);
122+
}
118123

119124
// early exit for `ns clean`
120125
if (options.command === COMMANDS.CLEAN) return nsOptions;

packages/nx/src/utils/generate-schemas.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { baseSchema } from '../schemas/base.schema';
55
import { buildSchema } from '../schemas/build.schema';
66
import { debugSchema } from '../schemas/debug.schema';
77
import { iosSchema } from '../schemas/ios-properties.schema';
8+
import { visionOSSchema } from '../schemas/visionos-properties.schema';
89
import { prepareSchema } from '../schemas/prepare.schema';
910
import { runSchema } from '../schemas/run.schema';
1011
import { testSchema } from '../schemas/test.schema';
@@ -14,11 +15,11 @@ import { cleanSchema } from '../schemas/clean.schema';
1415
const outputDirectory = join(__dirname, '..', 'executors', 'build');
1516

1617
const outputs = [
17-
{ name: 'build', schemas: [baseSchema, androidSchema, iosSchema, buildSchema] },
18-
{ name: 'debug', schemas: [baseSchema, androidSchema, iosSchema, debugSchema] },
19-
{ name: 'prepare', schemas: [baseSchema, androidSchema, iosSchema, prepareSchema] },
20-
{ name: 'run', schemas: [baseSchema, androidSchema, iosSchema, runSchema] },
21-
{ name: 'test', schemas: [baseSchema, androidSchema, iosSchema, testSchema] },
18+
{ name: 'build', schemas: [baseSchema, androidSchema, iosSchema, visionOSSchema, buildSchema] },
19+
{ name: 'debug', schemas: [baseSchema, androidSchema, iosSchema, visionOSSchema, debugSchema] },
20+
{ name: 'prepare', schemas: [baseSchema, androidSchema, iosSchema, visionOSSchema, prepareSchema] },
21+
{ name: 'run', schemas: [baseSchema, androidSchema, iosSchema, visionOSSchema, runSchema] },
22+
{ name: 'test', schemas: [baseSchema, androidSchema, iosSchema, visionOSSchema, testSchema] },
2223
{ name: 'clean', schemas: [cleanSchema] },
2324
];
2425

packages/nx/src/utils/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { IosSchema } from '../schemas/ios-properties.schema';
66
import { PrepareSchema } from '../schemas/prepare.schema';
77
import { RunSchema } from '../schemas/run.schema';
88
import { TestSchema } from '../schemas/test.schema';
9+
import { visionOSSchema } from '../schemas/visionos-properties.schema';
910

1011
export type KeysOfProperty<T> = {
1112
[P in keyof T]: Property;
@@ -21,4 +22,5 @@ export interface Property {
2122
export interface ExecutorSchema extends BaseSchema, BuildSchema, DebugSchema, PrepareSchema, RunSchema, TestSchema {
2223
android: AndroidSchema;
2324
ios: IosSchema;
25+
visionos: visionOSSchema;
2426
}

0 commit comments

Comments
 (0)