Skip to content

Commit 8ec652e

Browse files
Copilotfarfromrefug
andcommitted
Remove workspaceTarget, revert lock files, add framework dependencies
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
1 parent c004cd5 commit 8ec652e

1 file changed

Lines changed: 9 additions & 64 deletions

File tree

lib/services/ios-watch-app-service.ts

Lines changed: 9 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -507,20 +507,6 @@ export class IOSWatchAppService implements IIOSWatchAppService {
507507
);
508508
}
509509
}
510-
511-
// Handle existing workspace target references
512-
if (config.workspaceTarget) {
513-
this.$logger.trace(
514-
`Configuring workspace target reference: ${config.workspaceTarget} for ${targetName}`
515-
);
516-
this.linkWorkspaceTarget(
517-
config.workspaceTarget,
518-
targetName,
519-
target,
520-
project,
521-
platformData
522-
);
523-
}
524510
}
525511

526512
/**
@@ -716,6 +702,15 @@ export class IOSWatchAppService implements IIOSWatchAppService {
716702
this.$logger.warn(`Unknown module type for: ${modulePath}`);
717703
}
718704

705+
// Add system framework dependencies if specified
706+
if (moduleDef.frameworks && Array.isArray(moduleDef.frameworks)) {
707+
this.$logger.trace(`Adding ${moduleDef.frameworks.length} framework(s) for module ${moduleName}`);
708+
for (const framework of moduleDef.frameworks) {
709+
project.addFramework(framework, { target: target.uuid });
710+
this.$logger.trace(`Added framework dependency: ${framework}`);
711+
}
712+
}
713+
719714
// Add header search paths for module (works for both types)
720715
if (moduleDef.headerSearchPaths && Array.isArray(moduleDef.headerSearchPaths)) {
721716
for (const headerPath of moduleDef.headerSearchPaths) {
@@ -879,56 +874,6 @@ export class IOSWatchAppService implements IIOSWatchAppService {
879874
return null;
880875
}
881876

882-
/**
883-
* Link existing workspace target to watch app
884-
*/
885-
private linkWorkspaceTarget(
886-
workspaceTargetName: string,
887-
targetName: string,
888-
target: IXcode.target,
889-
project: IXcode.project,
890-
platformData: IPlatformData
891-
): void {
892-
this.$logger.trace(
893-
`Linking workspace target ${workspaceTargetName} to ${targetName}`
894-
);
895-
896-
// Find the existing target in the project
897-
const projectHash = (project as any).hash;
898-
if (!projectHash) {
899-
this.$logger.warn("Could not access project hash");
900-
return;
901-
}
902-
903-
const targets = projectHash.project.objects.PBXNativeTarget;
904-
let existingTargetUuid: string = null;
905-
906-
for (const uuid in targets) {
907-
if (targets[uuid] && targets[uuid].name === workspaceTargetName) {
908-
existingTargetUuid = uuid;
909-
break;
910-
}
911-
}
912-
913-
if (existingTargetUuid) {
914-
// Add target dependency using the xcode project method
915-
try {
916-
(project as any).addTargetDependency(target.uuid, [existingTargetUuid]);
917-
this.$logger.trace(
918-
`Successfully linked workspace target ${workspaceTargetName}`
919-
);
920-
} catch (err) {
921-
this.$logger.warn(
922-
`Error linking workspace target ${workspaceTargetName}: ${err.message}`
923-
);
924-
}
925-
} else {
926-
this.$logger.warn(
927-
`Could not find workspace target: ${workspaceTargetName}`
928-
);
929-
}
930-
}
931-
932877
/**
933878
* Apply SPM packages to watch app targets
934879
*/

0 commit comments

Comments
 (0)