Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 90e352d

Browse files
committedJan 23, 2025··
fix xpc target
1 parent 38a9388 commit 90e352d

File tree

9 files changed

+77
-131
lines changed

9 files changed

+77
-131
lines changed
 

‎Coder Desktop/Coder Desktop.xcodeproj/project.pbxproj

Lines changed: 53 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
3B0916612D41B9690064DEA8 /* VPNXPC.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 3B0916552D41B9690064DEA8 /* VPNXPC.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
1110
961679332CFF117300B2B6DF /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 961679322CFF117300B2B6DF /* NetworkExtension.framework */; };
1211
9616793D2CFF117300B2B6DF /* com.coder.Coder-Desktop.VPN.systemextension in Embed System Extensions */ = {isa = PBXBuildFile; fileRef = 961679302CFF117300B2B6DF /* com.coder.Coder-Desktop.VPN.systemextension */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
1312
AA3B3DA92D2D23860099996A /* VPNLib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA3B3DA12D2D23860099996A /* VPNLib.framework */; };
@@ -28,13 +27,6 @@
2827
/* End PBXBuildFile section */
2928

3029
/* Begin PBXContainerItemProxy section */
31-
3B09165F2D41B9690064DEA8 /* PBXContainerItemProxy */ = {
32-
isa = PBXContainerItemProxy;
33-
containerPortal = 961678F42CFF100D00B2B6DF /* Project object */;
34-
proxyType = 1;
35-
remoteGlobalIDString = 3B0916542D41B9690064DEA8;
36-
remoteInfo = VPNXPC;
37-
};
3830
961679102CFF100E00B2B6DF /* PBXContainerItemProxy */ = {
3931
isa = PBXContainerItemProxy;
4032
containerPortal = 961678F42CFF100D00B2B6DF /* Project object */;
@@ -121,11 +113,20 @@
121113
dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices";
122114
dstSubfolderSpec = 16;
123115
files = (
124-
3B0916612D41B9690064DEA8 /* VPNXPC.xpc in Embed XPC Services */,
125116
);
126117
name = "Embed XPC Services";
127118
runOnlyForDeploymentPostprocessing = 0;
128119
};
120+
3B0916872D41C8010064DEA8 /* Embed Frameworks */ = {
121+
isa = PBXCopyFilesBuildPhase;
122+
buildActionMask = 2147483647;
123+
dstPath = "";
124+
dstSubfolderSpec = 10;
125+
files = (
126+
);
127+
name = "Embed Frameworks";
128+
runOnlyForDeploymentPostprocessing = 0;
129+
};
129130
961679422CFF117300B2B6DF /* Embed System Extensions */ = {
130131
isa = PBXCopyFilesBuildPhase;
131132
buildActionMask = 2147483647;
@@ -151,7 +152,7 @@
151152
/* End PBXCopyFilesBuildPhase section */
152153

153154
/* Begin PBXFileReference section */
154-
3B0916552D41B9690064DEA8 /* VPNXPC.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = VPNXPC.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
155+
3B09168F2D41C8380064DEA8 /* libVPNXPC.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libVPNXPC.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
155156
961678FC2CFF100D00B2B6DF /* Coder Desktop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Coder Desktop.app"; sourceTree = BUILT_PRODUCTS_DIR; };
156157
9616790F2CFF100E00B2B6DF /* Coder DesktopTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Coder DesktopTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
157158
961679192CFF100E00B2B6DF /* Coder DesktopUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Coder DesktopUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -164,13 +165,6 @@
164165
/* End PBXFileReference section */
165166

166167
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
167-
3B0916652D41B9690064DEA8 /* Exceptions for "VPNXPC" folder in "VPNXPC" target */ = {
168-
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
169-
membershipExceptions = (
170-
Info.plist,
171-
);
172-
target = 3B0916542D41B9690064DEA8 /* VPNXPC */;
173-
};
174168
AA3B3DB62D2D23860099996A /* Exceptions for "VPNLib" folder in "VPNLib" target */ = {
175169
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
176170
membershipExceptions = (
@@ -198,11 +192,8 @@
198192
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
199193

200194
/* Begin PBXFileSystemSynchronizedRootGroup section */
201-
3B0916562D41B9690064DEA8 /* VPNXPC */ = {
195+
3B0916902D41C8380064DEA8 /* VPNXPC */ = {
202196
isa = PBXFileSystemSynchronizedRootGroup;
203-
exceptions = (
204-
3B0916652D41B9690064DEA8 /* Exceptions for "VPNXPC" folder in "VPNXPC" target */,
205-
);
206197
path = VPNXPC;
207198
sourceTree = "<group>";
208199
};
@@ -258,7 +249,7 @@
258249
/* End PBXFileSystemSynchronizedRootGroup section */
259250

260251
/* Begin PBXFrameworksBuildPhase section */
261-
3B0916522D41B9690064DEA8 /* Frameworks */ = {
252+
3B09168D2D41C8380064DEA8 /* Frameworks */ = {
262253
isa = PBXFrameworksBuildPhase;
263254
buildActionMask = 2147483647;
264255
files = (
@@ -350,7 +341,7 @@
350341
AA3B3DAE2D2D23860099996A /* VPNLibTests */,
351342
AA3B40922D2FC8560099996A /* CoderSDK */,
352343
AA3B409E2D2FC8560099996A /* CoderSDKTests */,
353-
3B0916562D41B9690064DEA8 /* VPNXPC */,
344+
3B0916902D41C8380064DEA8 /* VPNXPC */,
354345
961679312CFF117300B2B6DF /* Frameworks */,
355346
961678FD2CFF100D00B2B6DF /* Products */,
356347
);
@@ -367,7 +358,7 @@
367358
AA3B3DA82D2D23860099996A /* VPNLibTests.xctest */,
368359
AA3B40912D2FC8560099996A /* CoderSDK.framework */,
369360
AA3B40982D2FC8560099996A /* CoderSDKTests.xctest */,
370-
3B0916552D41B9690064DEA8 /* VPNXPC.xpc */,
361+
3B09168F2D41C8380064DEA8 /* libVPNXPC.dylib */,
371362
);
372363
name = Products;
373364
sourceTree = "<group>";
@@ -383,6 +374,13 @@
383374
/* End PBXGroup section */
384375

385376
/* Begin PBXHeadersBuildPhase section */
377+
3B09168B2D41C8380064DEA8 /* Headers */ = {
378+
isa = PBXHeadersBuildPhase;
379+
buildActionMask = 2147483647;
380+
files = (
381+
);
382+
runOnlyForDeploymentPostprocessing = 0;
383+
};
386384
AA3B3D9C2D2D23860099996A /* Headers */ = {
387385
isa = PBXHeadersBuildPhase;
388386
buildActionMask = 2147483647;
@@ -400,27 +398,27 @@
400398
/* End PBXHeadersBuildPhase section */
401399

402400
/* Begin PBXNativeTarget section */
403-
3B0916542D41B9690064DEA8 /* VPNXPC */ = {
401+
3B09168E2D41C8380064DEA8 /* VPNXPC */ = {
404402
isa = PBXNativeTarget;
405-
buildConfigurationList = 3B0916662D41B9690064DEA8 /* Build configuration list for PBXNativeTarget "VPNXPC" */;
403+
buildConfigurationList = 3B0916952D41C8380064DEA8 /* Build configuration list for PBXNativeTarget "VPNXPC" */;
406404
buildPhases = (
407-
3B0916512D41B9690064DEA8 /* Sources */,
408-
3B0916522D41B9690064DEA8 /* Frameworks */,
409-
3B0916532D41B9690064DEA8 /* Resources */,
405+
3B09168B2D41C8380064DEA8 /* Headers */,
406+
3B09168C2D41C8380064DEA8 /* Sources */,
407+
3B09168D2D41C8380064DEA8 /* Frameworks */,
410408
);
411409
buildRules = (
412410
);
413411
dependencies = (
414412
);
415413
fileSystemSynchronizedGroups = (
416-
3B0916562D41B9690064DEA8 /* VPNXPC */,
414+
3B0916902D41C8380064DEA8 /* VPNXPC */,
417415
);
418416
name = VPNXPC;
419417
packageProductDependencies = (
420418
);
421419
productName = VPNXPC;
422-
productReference = 3B0916552D41B9690064DEA8 /* VPNXPC.xpc */;
423-
productType = "com.apple.product-type.xpc-service";
420+
productReference = 3B09168F2D41C8380064DEA8 /* libVPNXPC.dylib */;
421+
productType = "com.apple.product-type.library.dynamic";
424422
};
425423
961678FB2CFF100D00B2B6DF /* Coder Desktop */ = {
426424
isa = PBXNativeTarget;
@@ -431,14 +429,14 @@
431429
961678FA2CFF100D00B2B6DF /* Resources */,
432430
961679422CFF117300B2B6DF /* Embed System Extensions */,
433431
3B0916622D41B9690064DEA8 /* Embed XPC Services */,
432+
3B0916872D41C8010064DEA8 /* Embed Frameworks */,
434433
);
435434
buildRules = (
436435
);
437436
dependencies = (
438437
AA8BC33C2D0060E700E1ABAA /* PBXTargetDependency */,
439438
9616793C2CFF117300B2B6DF /* PBXTargetDependency */,
440439
AA3B40A32D2FC8560099996A /* PBXTargetDependency */,
441-
3B0916602D41B9690064DEA8 /* PBXTargetDependency */,
442440
);
443441
fileSystemSynchronizedGroups = (
444442
961678FE2CFF100D00B2B6DF /* Coder Desktop */,
@@ -634,8 +632,9 @@
634632
LastSwiftUpdateCheck = 1620;
635633
LastUpgradeCheck = 1620;
636634
TargetAttributes = {
637-
3B0916542D41B9690064DEA8 = {
635+
3B09168E2D41C8380064DEA8 = {
638636
CreatedOnToolsVersion = 16.2;
637+
LastSwiftMigration = 1620;
639638
};
640639
961678FB2CFF100D00B2B6DF = {
641640
CreatedOnToolsVersion = 16.1;
@@ -697,19 +696,12 @@
697696
AA3B3DA72D2D23860099996A /* VPNLibTests */,
698697
AA3B40902D2FC8560099996A /* CoderSDK */,
699698
AA3B40972D2FC8560099996A /* CoderSDKTests */,
700-
3B0916542D41B9690064DEA8 /* VPNXPC */,
699+
3B09168E2D41C8380064DEA8 /* VPNXPC */,
701700
);
702701
};
703702
/* End PBXProject section */
704703

705704
/* Begin PBXResourcesBuildPhase section */
706-
3B0916532D41B9690064DEA8 /* Resources */ = {
707-
isa = PBXResourcesBuildPhase;
708-
buildActionMask = 2147483647;
709-
files = (
710-
);
711-
runOnlyForDeploymentPostprocessing = 0;
712-
};
713705
961678FA2CFF100D00B2B6DF /* Resources */ = {
714706
isa = PBXResourcesBuildPhase;
715707
buildActionMask = 2147483647;
@@ -769,7 +761,7 @@
769761
/* End PBXResourcesBuildPhase section */
770762

771763
/* Begin PBXSourcesBuildPhase section */
772-
3B0916512D41B9690064DEA8 /* Sources */ = {
764+
3B09168C2D41C8380064DEA8 /* Sources */ = {
773765
isa = PBXSourcesBuildPhase;
774766
buildActionMask = 2147483647;
775767
files = (
@@ -835,11 +827,6 @@
835827
/* End PBXSourcesBuildPhase section */
836828

837829
/* Begin PBXTargetDependency section */
838-
3B0916602D41B9690064DEA8 /* PBXTargetDependency */ = {
839-
isa = PBXTargetDependency;
840-
target = 3B0916542D41B9690064DEA8 /* VPNXPC */;
841-
targetProxy = 3B09165F2D41B9690064DEA8 /* PBXContainerItemProxy */;
842-
};
843830
961679112CFF100E00B2B6DF /* PBXTargetDependency */ = {
844831
isa = PBXTargetDependency;
845832
target = 961678FB2CFF100D00B2B6DF /* Coder Desktop */;
@@ -902,51 +889,36 @@
902889
/* End PBXTargetDependency section */
903890

904891
/* Begin XCBuildConfiguration section */
905-
3B0916632D41B9690064DEA8 /* Debug */ = {
892+
3B0916962D41C8380064DEA8 /* Debug */ = {
906893
isa = XCBuildConfiguration;
907894
buildSettings = {
908-
CODE_SIGN_ENTITLEMENTS = VPNXPC/VPNXPC.entitlements;
909-
CODE_SIGN_IDENTITY = "Apple Development";
895+
CLANG_ENABLE_MODULES = YES;
910896
CODE_SIGN_STYLE = Automatic;
911-
COMBINE_HIDPI_IMAGES = YES;
912-
CURRENT_PROJECT_VERSION = 1;
913897
DEVELOPMENT_TEAM = 4399GN35BJ;
914-
ENABLE_HARDENED_RUNTIME = YES;
915-
GENERATE_INFOPLIST_FILE = YES;
916-
INFOPLIST_FILE = VPNXPC/Info.plist;
917-
INFOPLIST_KEY_CFBundleDisplayName = VPNXPC;
918-
INFOPLIST_KEY_NSHumanReadableCopyright = "";
919-
MACOSX_DEPLOYMENT_TARGET = 14.6;
920-
MARKETING_VERSION = 1.0;
921-
PRODUCT_BUNDLE_IDENTIFIER = "com.coder.Coder-Desktop.VPNXPC";
898+
DYLIB_COMPATIBILITY_VERSION = 1;
899+
DYLIB_CURRENT_VERSION = 1;
900+
EXECUTABLE_PREFIX = lib;
901+
MACOSX_DEPLOYMENT_TARGET = 15.2;
922902
PRODUCT_NAME = "$(TARGET_NAME)";
923903
SKIP_INSTALL = YES;
924-
SWIFT_EMIT_LOC_STRINGS = YES;
925-
SWIFT_VERSION = 5.0;
904+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
905+
SWIFT_VERSION = 6.0;
926906
};
927907
name = Debug;
928908
};
929-
3B0916642D41B9690064DEA8 /* Release */ = {
909+
3B0916972D41C8380064DEA8 /* Release */ = {
930910
isa = XCBuildConfiguration;
931911
buildSettings = {
932-
CODE_SIGN_ENTITLEMENTS = VPNXPC/VPNXPC.entitlements;
933-
CODE_SIGN_IDENTITY = "Apple Development";
912+
CLANG_ENABLE_MODULES = YES;
934913
CODE_SIGN_STYLE = Automatic;
935-
COMBINE_HIDPI_IMAGES = YES;
936-
CURRENT_PROJECT_VERSION = 1;
937914
DEVELOPMENT_TEAM = 4399GN35BJ;
938-
ENABLE_HARDENED_RUNTIME = YES;
939-
GENERATE_INFOPLIST_FILE = YES;
940-
INFOPLIST_FILE = VPNXPC/Info.plist;
941-
INFOPLIST_KEY_CFBundleDisplayName = VPNXPC;
942-
INFOPLIST_KEY_NSHumanReadableCopyright = "";
943-
MACOSX_DEPLOYMENT_TARGET = 14.6;
944-
MARKETING_VERSION = 1.0;
945-
PRODUCT_BUNDLE_IDENTIFIER = "com.coder.Coder-Desktop.VPNXPC";
915+
DYLIB_COMPATIBILITY_VERSION = 1;
916+
DYLIB_CURRENT_VERSION = 1;
917+
EXECUTABLE_PREFIX = lib;
918+
MACOSX_DEPLOYMENT_TARGET = 15.2;
946919
PRODUCT_NAME = "$(TARGET_NAME)";
947920
SKIP_INSTALL = YES;
948-
SWIFT_EMIT_LOC_STRINGS = YES;
949-
SWIFT_VERSION = 5.0;
921+
SWIFT_VERSION = 6.0;
950922
};
951923
name = Release;
952924
};
@@ -1495,11 +1467,11 @@
14951467
/* End XCBuildConfiguration section */
14961468

14971469
/* Begin XCConfigurationList section */
1498-
3B0916662D41B9690064DEA8 /* Build configuration list for PBXNativeTarget "VPNXPC" */ = {
1470+
3B0916952D41C8380064DEA8 /* Build configuration list for PBXNativeTarget "VPNXPC" */ = {
14991471
isa = XCConfigurationList;
15001472
buildConfigurations = (
1501-
3B0916632D41B9690064DEA8 /* Debug */,
1502-
3B0916642D41B9690064DEA8 /* Release */,
1473+
3B0916962D41C8380064DEA8 /* Debug */,
1474+
3B0916972D41C8380064DEA8 /* Release */,
15031475
);
15041476
defaultConfigurationIsVisible = 0;
15051477
defaultConfigurationName = Release;

‎Coder Desktop/Coder Desktop.xcodeproj/xcshareddata/xcschemes/Coder Desktop.xcscheme

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@
9090
ReferencedContainer = "container:Coder Desktop.xcodeproj">
9191
</BuildableReference>
9292
</TestableReference>
93+
<TestableReference
94+
skipped = "NO"
95+
parallelizable = "YES">
96+
<BuildableReference
97+
BuildableIdentifier = "primary"
98+
BlueprintIdentifier = "3B0916742D41C8010064DEA8"
99+
BuildableName = "VPNXPCTests.xctest"
100+
BlueprintName = "VPNXPCTests"
101+
ReferencedContainer = "container:Coder Desktop.xcodeproj">
102+
</BuildableReference>
103+
</TestableReference>
93104
</Testables>
94105
</TestAction>
95106
<LaunchAction

‎Coder Desktop/VPN/PacketTunnelProvider.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider, @unchecked Sendable {
5353
with: self,
5454
cfg: .init(apiToken: "fake-token", serverUrl: .init(string: "https://dev.coder.com")!)
5555
)
56-
GlobalXPCListenerDelegate.vpnXPCInterface.setManager(manager)
56+
globalXPCListenerDelegate.vpnXPCInterface.setManager(manager)
5757
}
5858
completionHandler(nil)
5959
}
@@ -66,7 +66,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider, @unchecked Sendable {
6666
return
6767
}
6868
manager = nil
69-
GlobalXPCListenerDelegate.vpnXPCInterface.setManager(nil)
69+
globalXPCListenerDelegate.vpnXPCInterface.setManager(nil)
7070
completionHandler()
7171
}
7272

‎Coder Desktop/VPN/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ final class XPCListenerDelegate: NSObject, NSXPCListenerDelegate, Sendable {
1414
}
1515
}
1616

17-
let GlobalXPCListenerDelegate = XPCListenerDelegate()
17+
let globalXPCListenerDelegate = XPCListenerDelegate()
1818
let xpcListener = NSXPCListener(machServiceName: "com.coder.Coder-Desktop.VPNXPC")
19-
xpcListener.delegate = GlobalXPCListenerDelegate
19+
xpcListener.delegate = globalXPCListenerDelegate
2020
xpcListener.resume()
2121

2222
autoreleasepool {

‎Coder Desktop/VPNXPC/Info.plist

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎Coder Desktop/VPNXPC/Protocol.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Foundation
2+
3+
@preconcurrency
4+
@objc public protocol VPNXPCProtocol {
5+
func start(with reply: @escaping (NSError?) -> Void)
6+
func stop(with reply: @escaping (NSError?) -> Void)
7+
}

‎Coder Desktop/VPNXPC/VPNXPC.entitlements

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎Coder Desktop/VPNXPC/VPNXPC.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#import <Foundation/Foundation.h>
2+

‎Coder Desktop/VPNXPC/VPNXPCProtocol.swift

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.