{"action":"created","issue":{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5373","repository_url":"https://api.github.com/repos/CocoaPods/CocoaPods","labels_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5373/labels{/name}","comments_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5373/comments","events_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5373/events","html_url":"https://github.com/CocoaPods/CocoaPods/issues/5373","id":155841404,"number":5373,"title":"Allow target-type specific podspec definitions","user":{"login":"mrackwitz","id":1389011,"avatar_url":"https://avatars.githubusercontent.com/u/1389011?v=3","gravatar_id":"","url":"https://api.github.com/users/mrackwitz","html_url":"https://github.com/mrackwitz","followers_url":"https://api.github.com/users/mrackwitz/followers","following_url":"https://api.github.com/users/mrackwitz/following{/other_user}","gists_url":"https://api.github.com/users/mrackwitz/gists{/gist_id}","starred_url":"https://api.github.com/users/mrackwitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrackwitz/subscriptions","organizations_url":"https://api.github.com/users/mrackwitz/orgs","repos_url":"https://api.github.com/users/mrackwitz/repos","events_url":"https://api.github.com/users/mrackwitz/events{/privacy}","received_events_url":"https://api.github.com/users/mrackwitz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/labels/t3:discussion","name":"t3:discussion","color":"E10288"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-05-19T21:38:16Z","updated_at":"2016-05-20T12:41:50Z","closed_at":null,"body":"CocoaPods target deduplication can be undesirable in some cases, when pods are used, which offer an extended API for targets, which are not limited to the extension API. In these cases, it would be desirable to use the full podspec in the app and only the limited features in the extension. This can be achieved in podspec with preprocessor conditionals, which require the presence of macros. A post_install hook would be required to define these macros for the pod targets.\r\n\r\nThe following could be a better solution to that: We could allow to specify attributes specific to iOS extensions in podspecs. This could look like that:\r\n```ruby\r\ns.ios.extension.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SV_APP_EXTENSIONS' }\r\n```\r\nThe analyzer could use that relatively easy as indication, that a pod can't be deduplicated across iOS apps and extensions. This could be used as well on tvOS.\r\n\r\nThis was created based on what I proposed in https://github.com/CocoaPods/CocoaPods/issues/5343#issuecomment-220384801.\r\n\r\n/c @segiddins @neonichu @MuscleRumble\r\n"},"comment":{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/comments/220595217","html_url":"https://github.com/CocoaPods/CocoaPods/issues/5373#issuecomment-220595217","issue_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/5373","id":220595217,"user":{"login":"MuscleRumble","id":2924160,"avatar_url":"https://avatars.githubusercontent.com/u/2924160?v=3","gravatar_id":"","url":"https://api.github.com/users/MuscleRumble","html_url":"https://github.com/MuscleRumble","followers_url":"https://api.github.com/users/MuscleRumble/followers","following_url":"https://api.github.com/users/MuscleRumble/following{/other_user}","gists_url":"https://api.github.com/users/MuscleRumble/gists{/gist_id}","starred_url":"https://api.github.com/users/MuscleRumble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MuscleRumble/subscriptions","organizations_url":"https://api.github.com/users/MuscleRumble/orgs","repos_url":"https://api.github.com/users/MuscleRumble/repos","events_url":"https://api.github.com/users/MuscleRumble/events{/privacy}","received_events_url":"https://api.github.com/users/MuscleRumble/received_events","type":"User","site_admin":false},"created_at":"2016-05-20T12:41:50Z","updated_at":"2016-05-20T12:41:50Z","body":"I think I understand now how subspecs can be utilized for my use case. The thing is: There aren't a lot of frameworks/libraries that deal with app extensions properly. That's why I'm so frustrated and I have to fork/patch everything. I'll give subspecs a try, but I have two questions:\r\n\r\n1. How does this even work? Don't I have to \"exclude\" the `AppExtension` subspec for the _main target_? Because I don't want to set the preprocessor macro on the `GTMSessionFetcher` pod. Aren't all subspecs automatically included, when using `pod 'GTMSessionFetcher'`?\r\n\r\n2. Let's take OneDriveSDK as an example: https://github.com/OneDrive/onedrive-sdk-ios/blob/master/OneDriveSDK.podspec\r\n\r\nThere is a subspec `OneDriveSDK/Auth` that has the dependency `ADALiOS`. In my `OneDriveSDK` fork (in which I'm going to create the `OneDriveSDK/AppExtension` subspec) I would like to distinguish between `ADALiOS` for my _main target_ and `ADALiOS/AppExtension` (that doesn't exist yet, I'll have to fork this as well) for my _app extension targets_.\r\n\r\nI'm a little overwhelmed by how to structure the podspecs properly. How do I achieve this?"}}
{"actor":{"display_login":"MuscleRumble"}}