Xcode project

works_for_me
Volker Birk 2 years ago
parent 74540b2b42
commit a714875c1c
  1. 294
      pEpMacOSAdapter.xcodeproj/project.pbxproj
  2. 7
      pEpMacOSAdapter.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  3. 8
      pEpMacOSAdapter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  4. 31
      pEpMacOSAdapter/Info.plist
  5. 50
      pEpMacOSAdapter/main.m
  6. 15
      pEpMacOSAdapter/pEpMacOSAdapter.h
  7. 20
      pEpMacOSAdapter/pEpMacOSAdapter.m
  8. 37
      pEpMacOSAdapter/pEpMacOSAdapterProtocol.h

@ -0,0 +1,294 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
35DC18D8244DA19100FB2002 /* pEpMacOSAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 35DC18D7244DA19100FB2002 /* pEpMacOSAdapter.m */; };
35DC18DA244DA19100FB2002 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 35DC18D9244DA19100FB2002 /* main.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
35DC18D2244DA19100FB2002 /* pEpMacOSAdapter.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = pEpMacOSAdapter.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
35DC18D5244DA19100FB2002 /* pEpMacOSAdapterProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pEpMacOSAdapterProtocol.h; sourceTree = "<group>"; };
35DC18D6244DA19100FB2002 /* pEpMacOSAdapter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pEpMacOSAdapter.h; sourceTree = "<group>"; };
35DC18D7244DA19100FB2002 /* pEpMacOSAdapter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = pEpMacOSAdapter.m; sourceTree = "<group>"; };
35DC18D9244DA19100FB2002 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
35DC18DB244DA19100FB2002 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
35DC18CF244DA19100FB2002 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
35DC18C9244DA19100FB2002 = {
isa = PBXGroup;
children = (
35DC18D4244DA19100FB2002 /* pEpMacOSAdapter */,
35DC18D3244DA19100FB2002 /* Products */,
);
sourceTree = "<group>";
};
35DC18D3244DA19100FB2002 /* Products */ = {
isa = PBXGroup;
children = (
35DC18D2244DA19100FB2002 /* pEpMacOSAdapter.xpc */,
);
name = Products;
sourceTree = "<group>";
};
35DC18D4244DA19100FB2002 /* pEpMacOSAdapter */ = {
isa = PBXGroup;
children = (
35DC18D5244DA19100FB2002 /* pEpMacOSAdapterProtocol.h */,
35DC18D6244DA19100FB2002 /* pEpMacOSAdapter.h */,
35DC18D7244DA19100FB2002 /* pEpMacOSAdapter.m */,
35DC18D9244DA19100FB2002 /* main.m */,
35DC18DB244DA19100FB2002 /* Info.plist */,
);
path = pEpMacOSAdapter;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
35DC18D1244DA19100FB2002 /* pEpMacOSAdapter */ = {
isa = PBXNativeTarget;
buildConfigurationList = 35DC18DE244DA19100FB2002 /* Build configuration list for PBXNativeTarget "pEpMacOSAdapter" */;
buildPhases = (
35DC18CE244DA19100FB2002 /* Sources */,
35DC18CF244DA19100FB2002 /* Frameworks */,
35DC18D0244DA19100FB2002 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = pEpMacOSAdapter;
productName = pEpMacOSAdapter;
productReference = 35DC18D2244DA19100FB2002 /* pEpMacOSAdapter.xpc */;
productType = "com.apple.product-type.xpc-service";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
35DC18CA244DA19100FB2002 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1140;
ORGANIZATIONNAME = "p≡p foundation";
TargetAttributes = {
35DC18D1244DA19100FB2002 = {
CreatedOnToolsVersion = 11.4.1;
};
};
};
buildConfigurationList = 35DC18CD244DA19100FB2002 /* Build configuration list for PBXProject "pEpMacOSAdapter" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 35DC18C9244DA19100FB2002;
productRefGroup = 35DC18D3244DA19100FB2002 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
35DC18D1244DA19100FB2002 /* pEpMacOSAdapter */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
35DC18D0244DA19100FB2002 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
35DC18CE244DA19100FB2002 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
35DC18DA244DA19100FB2002 /* main.m in Sources */,
35DC18D8244DA19100FB2002 /* pEpMacOSAdapter.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
35DC18DC244DA19100FB2002 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
35DC18DD244DA19100FB2002 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
};
name = Release;
};
35DC18DF244DA19100FB2002 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = pEpMacOSAdapter/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = pEp.foundation.pEpMacOSAdapter;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
35DC18E0244DA19100FB2002 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = pEpMacOSAdapter/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = pEp.foundation.pEpMacOSAdapter;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
35DC18CD244DA19100FB2002 /* Build configuration list for PBXProject "pEpMacOSAdapter" */ = {
isa = XCConfigurationList;
buildConfigurations = (
35DC18DC244DA19100FB2002 /* Debug */,
35DC18DD244DA19100FB2002 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
35DC18DE244DA19100FB2002 /* Build configuration list for PBXNativeTarget "pEpMacOSAdapter" */ = {
isa = XCConfigurationList;
buildConfigurations = (
35DC18DF244DA19100FB2002 /* Debug */,
35DC18E0244DA19100FB2002 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 35DC18CA244DA19100FB2002 /* Project object */;
}

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:pEpMacOSAdapter.xcodeproj">
</FileRef>
</Workspace>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>pEpMacOSAdapter</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyleft © 2020 p≡p foundation. All rights reserved.</string>
<key>XPCService</key>
<dict>
<key>ServiceType</key>
<string>Application</string>
</dict>
</dict>
</plist>

@ -0,0 +1,50 @@
//
// main.m
// pEpMacOSAdapter
//
// Created by Volker Birk on 20.04.20.
// Copyleft © 2020 pp foundation.
// This file is under GNU General Public License 3.0
//
#import <Foundation/Foundation.h>
#import "pEpMacOSAdapter.h"
@interface ServiceDelegate : NSObject <NSXPCListenerDelegate>
@end
@implementation ServiceDelegate
- (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection {
// This method is where the NSXPCListener configures, accepts, and resumes a new incoming NSXPCConnection.
// Configure the connection.
// First, set the interface that the exported object implements.
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(pEpMacOSAdapterProtocol)];
// Next, set the object that the connection exports. All messages sent on the connection to this service will be sent to the exported object to handle. The connection retains the exported object.
pEpMacOSAdapter *exportedObject = [pEpMacOSAdapter new];
newConnection.exportedObject = exportedObject;
// Resuming the connection allows the system to deliver more incoming messages.
[newConnection resume];
// Returning YES from this method tells the system that you have accepted this connection. If you want to reject the connection for some reason, call -invalidate on the connection and return NO.
return YES;
}
@end
int main(int argc, const char *argv[])
{
// Create the delegate for the service.
ServiceDelegate *delegate = [ServiceDelegate new];
// Set up the one NSXPCListener for this service. It will handle all incoming connections.
NSXPCListener *listener = [NSXPCListener serviceListener];
listener.delegate = delegate;
// Resuming the serviceListener starts this service. This method does not return.
[listener resume];
return 0;
}

@ -0,0 +1,15 @@
//
// pEpMacOSAdapter.h
// pEpMacOSAdapter
//
// Created by Volker Birk on 20.04.20.
// Copyleft © 2020 p≡p foundation.
// This file is under GNU General Public License 3.0
//
#import <Foundation/Foundation.h>
#import "pEpMacOSAdapterProtocol.h"
// This object implements the protocol which we have defined. It provides the actual behavior for the service. It is 'exported' by the service to make it available to the process hosting the service over an NSXPCConnection.
@interface pEpMacOSAdapter : NSObject <pEpMacOSAdapterProtocol>
@end

@ -0,0 +1,20 @@
//
// pEpMacOSAdapter.m
// pEpMacOSAdapter
//
// Created by Volker Birk on 20.04.20.
// Copyleft © 2020 pp foundation.
// This file is under GNU General Public License 3.0
//
#import "pEpMacOSAdapter.h"
@implementation pEpMacOSAdapter
// This implements the example protocol. Replace the body of this class with the implementation of this service's protocol.
- (void)upperCaseString:(NSString *)aString withReply:(void (^)(NSString *))reply {
NSString *response = [aString uppercaseString];
reply(response);
}
@end

@ -0,0 +1,37 @@
//
// pEpMacOSAdapterProtocol.h
// pEpMacOSAdapter
//
// Created by Volker Birk on 20.04.20.
// Copyleft © 2020 p≡p foundation.
// This file is under GNU General Public License 3.0
//
#import <Foundation/Foundation.h>
// The protocol that this service will vend as its API. This header file will also need to be visible to the process hosting the service.
@protocol pEpMacOSAdapterProtocol
// Replace the API of this protocol with an API appropriate to the service you are vending.
- (void)upperCaseString:(NSString *)aString withReply:(void (^)(NSString *))reply;
@end
/*
To use the service from an application or other process, use NSXPCConnection to establish a connection to the service by doing something like this:
_connectionToService = [[NSXPCConnection alloc] initWithServiceName:@"pEp.foundation.pEpMacOSAdapter"];
_connectionToService.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(pEpMacOSAdapterProtocol)];
[_connectionToService resume];
Once you have a connection to the service, you can use it like this:
[[_connectionToService remoteObjectProxy] upperCaseString:@"hello" withReply:^(NSString *aString) {
// We have received a response. Update our text field, but do it on the main thread.
NSLog(@"Result string was: %@", aString);
}];
And, when you are finished with the service, clean up the connection like this:
[_connectionToService invalidate];
*/
Loading…
Cancel
Save