Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically copy XPC Services to correct location #368

Merged
merged 2 commits into from
Aug 16, 2018

Conversation

brentleyjones
Copy link
Collaborator

Fixes #334.

@brentleyjones
Copy link
Collaborator Author

@vgorloff Let me know if this resolves your issue.

@vgorloff
Copy link
Contributor

vgorloff commented Aug 2, 2018

Thank you! Will check it today evening or on weekend.

@@ -40,6 +40,11 @@ public struct TargetSource: Equatable {
case carbonResources

public struct CopyFilesSettings: Equatable, Hashable {
public static let xpcServices = CopyFilesSettings(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. We could add a similar static modulemap property.
Could we move it into XcodeGenKit as an extension though?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main reason I did this one here, is that it shows up in the dropdown for a destination in Xcode, and if you these exact settings Xcode will render it as such.

The modulemap based one is more a convention, and that I would put into an extension in XcodeGenKit.

@vgorloff
Copy link
Contributor

vgorloff commented Aug 2, 2018

Local build from brentleyjones:automatically-copy-xpc fork fixes issue. Thanks!

  macOS-XPCClient:
    type: application
    platform: macOS
    settings:
      INFOPLIST_FILE: Components/macOS/XPCDemo/Client/Info.plist
      PRODUCT_BUNDLE_IDENTIFIER: com.mc.macOS.xpc.Client
      CODE_SIGN_ENTITLEMENTS: Components/macOS/XPCDemo/Client/App.entitlements
      CODE_SIGN_IDENTITY: Mac Developer
      CODE_SIGN_STYLE: Automatic
      DEVELOPMENT_TEAM: JFM85B4M73
    configFiles:
       Debug: ../WL/Shared/Configuration/App-macOS.xcconfig
       Release: ../WL/Shared/Configuration/App-macOS.xcconfig
    sources:
       - Components/macOS/XPCDemo/Common
       - Components/macOS/XPCDemo/Client
    # postbuildScripts:
    #    - script: '[[ -r ~/.bashrc ]] && . ~/.bashrc;
    #    mkdir -p "${BUILT_PRODUCTS_DIR}/${XPCSERVICES_FOLDER_PATH}/";
    #    find "${BUILT_PRODUCTS_DIR}" -depth 1 -type d -name "*.xpc" | xargs -I{} cp -vR "{}" "${BUILT_PRODUCTS_DIR}/${XPCSERVICES_FOLDER_PATH}/"'
    #      name: "Run Script: Embed XPC Service"
    #      shell: /bin/bash
    dependencies:
      - target: macOS-XPCService
        # embed: false
      - target: mcBase-macOS

s180802_1555561

@brentleyjones
Copy link
Collaborator Author

Glad to hear @vgorloff. Hopefully this can make the next release 😄.

@brentleyjones brentleyjones mentioned this pull request Aug 9, 2018
@@ -26,6 +26,8 @@
BF_130062884703 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FR_257516580010 /* Alamofire.framework */; };
BF_138356261076 /* InterfaceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FR_363921640403 /* InterfaceController.swift */; };
BF_144945303317 /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FR_410645050443 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
BF_156251722120 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FR_257516580010 /* Alamofire.framework */; };
"BF_156251722120-1" /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FR_257516580010 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a similar issue to that in #373

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#373 will fix it.

@brentleyjones
Copy link
Collaborator Author

@yonaskolb Good for another look.

@brentleyjones brentleyjones merged commit 43d3b78 into yonaskolb:master Aug 16, 2018
@brentleyjones brentleyjones deleted the automatically-copy-xpc branch August 16, 2018 12:53
@brentleyjones
Copy link
Collaborator Author

@yonaskolb We have a lot of good changes in master. Think we can get a new release?

@yonaskolb
Copy link
Owner

@brentleyjones and @vgorloffdid do you know the answer to the question above? Question is should header files in an xpc target generate build files and be added to a build phase?

@vgorloff
Copy link
Contributor

Seems it is about ObjC version of XPC Target. I will make a sample XPC ObjC project first and will look on it’s structure.

@brentleyjones
Copy link
Collaborator Author

Sorry, I don't know. Thanks @vgorloff for looking into this.

@vgorloff
Copy link
Contributor

vgorloff commented Oct 1, 2018

This is project specs I have for creating ObjC version of XPC Service (XcodeGen version 1.11.2):

name: XPCPingXcodeGen

targets:

  XPCPing:
    type: xpc-service
    platform: macOS
    settings:
      INFOPLIST_FILE: XPCPing/Info.plist
      PRODUCT_BUNDLE_IDENTIFIER: com.example.XPCPing
      CODE_SIGN_IDENTITY: Mac Developer
      CODE_SIGN_STYLE: Automatic
      DEVELOPMENT_TEAM: E27KE6VTF6
    sources:
       - XPCPing
       - Common
       
  XPSClient:
    type: application
    platform: macOS
    settings:
      INFOPLIST_FILE: XPSClient/Info.plist
      PRODUCT_BUNDLE_IDENTIFIER: com.example.XPSClient
      CODE_SIGN_ENTITLEMENTS: XPSClient/XPSClient.entitlements
      CODE_SIGN_IDENTITY: Mac Developer
      CODE_SIGN_STYLE: Automatic
      DEVELOPMENT_TEAM: E27KE6VTF6
    sources:
       - Common
       - XPSClient
    dependencies:
      - target: XPCPing
      
schemes:
   
   XPSClient:
     build:
       targets:
         XPSClient: all

XPCPing.zip

@vgorloff
Copy link
Contributor

vgorloff commented Oct 1, 2018

There could be one or more header files shared between Service and Client.app (like file XPCPingProtocol.h from attached project). Such headers used only to define interface (protocol). Such headers seems not supposed to be part of "Copy Headers" build phase or similar.

@yonaskolb
Copy link
Owner

yonaskolb commented Oct 14, 2018

I ended up just removing build files that didn't belong to any build phases 590128e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants