Skip to content

Commit 3bacbba

Browse files
authored
feat(config): ios.NativeSource option (#161)
1 parent e5ae274 commit 3bacbba

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

content/configuration/nativescript.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,63 @@ ios: {
397397
}
398398
```
399399

400+
### ios.NativeSource
401+
402+
::: tip
403+
404+
NativeSource config option is available in `nativescript@8.9.0` or newer.
405+
406+
:::
407+
408+
```ts
409+
ios.NativeSource: Array<{
410+
name: string;
411+
path: string;
412+
}>
413+
```
414+
415+
Include any native source code from anywhere in the project (or workspace). Glob patterns are fully supported.
416+
417+
#### Example
418+
419+
- Include any `.swift` files anywhere within the project `src` directory:
420+
421+
```ts
422+
// ...
423+
ios: {
424+
NativeSource: [
425+
{
426+
name: 'ProjectPlatformSrc',
427+
path: './src/**/*.swift'
428+
}
429+
],
430+
}
431+
```
432+
433+
This will create a file reference folder named `ProjectPlatformSrc` within the generated Xcode project containing any .swift files found anywhere within the project `src` directory.
434+
435+
- Include any `.swift` files anywhere within the project `src` directory, including any (Swift, Obj-C impl/headers, as well as any module.modulemap files) within a workspace `packages` or `libs` dir:
436+
437+
```ts
438+
// ...
439+
ios: {
440+
NativeSource: [
441+
{
442+
name: 'ProjectPlatformSrc',
443+
path: './src/**/*.swift'
444+
},
445+
{
446+
name: 'Auth',
447+
path: '../../packages/**/*.{swift,m,h,modulemap}'
448+
},
449+
{
450+
name: 'Purchasing',
451+
path: '../../libs/**/*.{swift,m,h,modulemap}'
452+
}
453+
],
454+
}
455+
```
456+
400457
## Hooks Configuration Reference
401458

402459
```ts

0 commit comments

Comments
 (0)