Skip to content

Commit ea84aee

Browse files
committed
feat: allow much more complex watchapp projects
1 parent 29e2d3a commit ea84aee

5 files changed

Lines changed: 1089 additions & 52 deletions

File tree

lib/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ export enum IOSNativeTargetTypes {
410410
watchApp = "watch_app",
411411
watchExtension = "watch_extension",
412412
appExtension = "app_extension",
413+
application = 'application',
413414
}
414415

415416
const pathToLoggerAppendersDir = join(

lib/definitions/nativescript-dev-xcode.d.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,27 @@ declare module "nativescript-dev-xcode" {
88
}
99

1010
class project {
11+
hash: any;
12+
filepath: string;
1113
constructor(filename: string);
1214

1315
parse(callback: () => void): void;
1416
parseSync(): void;
1517

18+
generateUuid(): string;
19+
1620
writeSync(options: any): string;
1721

1822
addFramework(filepath: string, options?: Options): void;
1923
removeFramework(filePath: string, options?: Options): void;
2024

25+
26+
getProductFile(watchApptarget: target): any;
27+
addToPbxFrameworksBuildPhase(file);
28+
addToPbxCopyfilesBuildPhase(file, comment: string, targetid: string);
29+
pbxFrameworksBuildPhaseObj(targetid: string): any;
30+
pbxBuildFileSection(): {[k: string] : any};
31+
2132
addPbxGroup(
2233
filePathsArray: any[],
2334
name: string,
@@ -27,17 +38,30 @@ declare module "nativescript-dev-xcode" {
2738

2839
removePbxGroup(groupName: string, path: string): void;
2940

41+
addTargetDependency(target: string, dependencyTargets: string[]);
42+
43+
findTargetKey(name: string);
44+
pbxTargetByName(name: string): target;
45+
pbxNativeTargetSection(): {[key: string]: any};
46+
3047
addToHeaderSearchPaths(options?: Options): void;
3148
removeFromHeaderSearchPaths(options?: Options): void;
3249
updateBuildProperty(key: string, value: any): void;
3350

3451
pbxXCBuildConfigurationSection(): any;
3552

53+
buildPhaseObject(
54+
buildPhaseType: string,
55+
comment: string,
56+
target: tstring
57+
)
58+
3659
addTarget(
3760
targetName: string,
3861
targetType: string,
3962
targetPath?: string,
40-
parentTarget?: string
63+
parentTarget?: string,
64+
productTargetType?: string
4165
): target;
4266
addBuildPhase(
4367
filePathsArray: string[],

lib/definitions/project.d.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,38 @@ interface IRemoveExtensionsOptions {
887887

888888
interface IRemoveWatchAppOptions extends IRemoveExtensionsOptions {}
889889

890+
interface IWatchAppJSONConfigModule {
891+
name?: string;
892+
path: string;
893+
targetType?: string;
894+
embed?: boolean;
895+
frameworks?: Array<string | Record<string, string>>;
896+
dependencies?: string[];
897+
headerSearchPaths?: string[];
898+
resources?: string[];
899+
src?: string[];
900+
linkerFlags?: string[];
901+
buildConfigurationProperties?: Record<string, string>;
902+
SPMPackages?: Array<IOSSPMPackage | string>;
903+
}
904+
interface IWatchAppJSONConfig {
905+
targetType?: string;
906+
forceAddEmbedWatchContent?: boolean;
907+
sharedModulesBuildConfigurationProperties?: Record<string, string>;
908+
basedir?: string;
909+
infoPlistPath?: string;
910+
xcprivacyPath?: string;
911+
importSourcesFromMainFolder?: boolean;
912+
importResourcesFromMainFolder?: boolean;
913+
resources?: string[];
914+
src?: string[];
915+
resourcesExclude?: string[];
916+
srcExclude?: string[];
917+
modules: IWatchAppConfigModule[];
918+
SPMPackages?: Array<IOSSPMPackage>;
919+
}
920+
921+
890922
interface IRubyFunction {
891923
functionName: string;
892924
functionParameters?: string;

lib/services/ios-project-service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
839839
}
840840
}
841841

842-
this.$iOSWatchAppService.removeWatchApp({ pbxProjPath });
843842
const addedWatchApp = await this.$iOSWatchAppService.addWatchAppFromPath({
844843
watchAppFolderPath: path.join(
845844
resourcesDirectoryPath,

0 commit comments

Comments
 (0)