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

Support for the new watchos platform #3681

Merged
merged 12 commits into from
Jun 26, 2015
Merged

Support for the new watchos platform #3681

merged 12 commits into from
Jun 26, 2015

Conversation

neonichu
Copy link
Member

Fixes some issues with the newly added watchos platform. This lays the groundwork for supporting watchOS as a new platform in CocoaPods.

Things yet to be addressed:

  • Specs
  • Changelog
  • Pods integrated into watchapp2 and watchkit2-extension targets should automatically be build for watchOS
  • Add watchOS example (unused for now, because Travis doesn't have Xcode 7)

See also CocoaPods/Core#249 and CocoaPods/Xcodeproj#272

@neonichu neonichu changed the title Fix some issues with the new watchos platform WIP: Fix some issues with the new watchos platform Jun 13, 2015
neonichu added a commit to CocoaPods/cocoapods-integration-specs that referenced this pull request Jun 13, 2015
@neonichu neonichu changed the title WIP: Fix some issues with the new watchos platform WIP: Support for the new watchos platform Jun 13, 2015
@neonichu
Copy link
Member Author

See https://github.com/neonichu/native-watchOS-example for an example on how to try this out.

@@ -82,7 +82,7 @@ def save_as(path)
# @return [String]
#
def generate_platform_import_header
"#import #{platform == :ios ? '<UIKit/UIKit.h>' : '<Cocoa/Cocoa.h>'}\n"
"#import <Foundation/Foundation.h>\n"
Copy link
Member

Choose a reason for hiding this comment

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

This is a backwards incompatible change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly - might be a better idea to only use Foundation for watchos targets.

@mrackwitz
Copy link
Member

Regarding specs:
Once Travis supports Xcode 7, we should definitively add an example for watchOS to ensure that our produced integrations can be actually build on that platform as well. But you could add an example already now, just ensure that it doesn't fail rake examples:build when Xcode 7 is not available, so we can test that at least locally.
Beside that we should cover that also by an integration spec, I think we could update e.g. install_multiple_targets.

@neonichu
Copy link
Member Author

@mrackwitz Will add an example, not sure what the integration spec should actually test, though. Since the changes on this repo are minimal, it seems a bit redundant.

case platform.name
when :ios then "#import <UIKit/UIKit.h>\n"
when :osx then "#import <Cocoa/Cocoa.h>\n"
else "#import <Foundation/Foundation.h>\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should leave this empty for new platforms?

Re: #1746

Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea 👍

Copy link
Member

Choose a reason for hiding this comment

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

Foundation must be imported as long as the FOUNDATION_EXPORT macro is used by the umbrella header.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, shouldn't the umbrella header import Foundation and not the pch file?

@neonichu
Copy link
Member Author

Pods integrated into watchapp2 and watchkit2-extension targets should automatically be build for watchOS

Seems like this is generally not done and it is up to the user to define the correct platform for the watchOS targets inside their Podfile.

@segiddins
Copy link
Member

@neonichu isn't that done via target introspection already?

@neonichu
Copy link
Member Author

@segiddins I think it's supposed to be done, but doesn't actually function.

@neonichu neonichu changed the title WIP: Support for the new watchos platform Support for the new watchos platform Jun 26, 2015
@neonichu
Copy link
Member Author

OK, this should be merge-able now 🎉

@segiddins
Copy link
Member

Should already be done in TargetInspector#compute_platform

@segiddins
Copy link
Member

👍

segiddins added a commit that referenced this pull request Jun 26, 2015
Support for the new `watchos` platform
@segiddins segiddins merged commit c3dac7f into master Jun 26, 2015
@segiddins segiddins deleted the watchapp2 branch June 26, 2015 21:32
@neonichu
Copy link
Member Author

⌚ 🎉

@9JX
Copy link

9JX commented Feb 7, 2017

I would like to move watch target's resource and storyboard as a pod library, but when I
compile error “error: watchOS storyboards do not support target device type "mac””。
I found Pods-JDWatch-resources.sh script TARGET_DEVICE_ARGS not include watch,Is cocoaPods not supported like this?please help me!

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.

5 participants