Code Monkey home page Code Monkey logo

cocoapods-playgrounds's People

Contributors

asmallteapot avatar krausefx avatar neonichu avatar readmecritic avatar ronanrodrigo avatar segiddins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cocoapods-playgrounds's Issues

Doesn't seem to work on macOS Sierra

pod playgrounds Alamofire
warning: failed to load toolchain 'swift': Could not find toolchain: swift[!] /usr/local/bin/pod install --no-repo-update

Analyzing dependencies
[!] Unable to find host target for Pods-AlamofirePlayground. Please add the host targets for the embedded targets to the Podfile.

Automatically take code snippet from README?

Most Pods will have a simple usage example in their README. We could take the first MD code block with Swift syntax from the Pod's README and add it to the Playground's Contents.swift for an even quicker start πŸš€

Support for CocoaPods subspecs

I'm trying to 'pod playgrounds RxSwift,RxCocoa,ChameleonFramework/Swift' and getting an "unable to find specification for 'Swift'" error. It has no problem grabbing the objective-C cocoapod at 'ChameleonFramework', but trying to grab the subspec fails.

OSX support

I see that the playground CLI tool supports specifying the --platform, but not when using pod playgrounds. Can you add this? :)

Module not found when defining `module_name`

For Mapper I have defined module_name to be Mapper since I had to push it to CocoaPods as ModelMapper. It seems like when defining this key, importing either ModelMapper or Mapper in the generated playground ends up with a No such module error.

broken with CocoaPods 1.0.0

After upgrading to CP 1.0.0 the playground produced by the plugin can't find it's pods, like so:

pod playground RealmSwift ->

image

Preserve code in playground on update

This is rather a feature request.
Whenever I have big changes to the pod, such as new files or new dependency added, I need to update the playground.
However, at this time pod playgrounds runs in "generate" mode and wipes all my code in old playground.

It would be helpful to have an "update" option to preserve playground code and pages, or make "update" a default operation mode.

Needed to manually add pod framework to get linked in

Just installed cocoapods-playgrounds-1.2.0.
Then ran:
pod playgrounds DateTools
After opening the workspace in Xcode 7.3.1, I built the DateToolsPlayground schema.
If I then open the playground, the line import DateTools has a compiler error "No such module 'DateTools'".

It was easily fixed by dragging the Frameworks/DateTools.framework to the DateToolsPlayground target's 'Linked frameworks and libraries'. It would be great if you could add this last step so no manual intervention was required.

(Aside, thanks for the handy tool!)

configure `SWIFT_VERSION` from requested specs

SWIFT_VERSION is hard-coded to 4.0 in #56, which works for many common cases. In the future, we should instead pick a version based on the requested spec(s) to be installed, a command-line option, and/or any other appropriate means.

pod playgrounds command installation incomplete

When I try, for example, the README's suggestion of pod playgrounds Alamofire, I get the following in Terminal (with my own answers added where requested by the CocoaPods team). I haven't seen this with any other CocoaPods command, so I'm checking here first. Will bugger off if it's not your bug. ;)

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

/usr/local/bin/pod playgrounds Alamofire

### Report

* What did you do?
  * Navigated in Terminal to an empty folder
  * `gem install cocoapods-playgrounds`
  * `pod playgrounds Alamofire`
* What did you expect to happen?
  * Expected a playground to be created with Alamofire embedded
* What happened instead?
  * Got a directory named `AlamofirePlayground` with a `Podfile` and an empty `Alamofire.xcodeproj`

### Stack

   CocoaPods : 0.38.2
        Ruby : ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
    RubyGems : 2.4.5.1
        Host : Mac OS X 10.11.3 (15D21)
       Xcode : 7.2 (7C68)
         Git : git version 2.5.4 (Apple Git-61)
Ruby lib dir : /usr/local/Cellar/ruby/2.2.3/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 611c523efb20ce5da94b0db9ef5d31f336a84d69

### Plugins

cocoapods-deintegrate : 0.2.1
cocoapods-playgrounds : 0.0.3
cocoapods-plugins     : 0.4.2
cocoapods-stats       : 0.5.3
cocoapods-trunk       : 0.6.4
cocoapods-try         : 0.4.5

### Error

ArgumentError - wrong number of arguments (2 for 3)
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/lib/cocoapods/executable.rb:50:in `execute_command'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-playgrounds-0.0.3/lib/cocoapods-playgrounds/workspace.rb:15:in `block in generate'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-playgrounds-0.0.3/lib/cocoapods-playgrounds/workspace.rb:13:in `chdir'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-playgrounds-0.0.3/lib/cocoapods-playgrounds/workspace.rb:13:in `generate'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-playgrounds-0.0.3/lib/cocoapods-playgrounds/command/playgrounds.rb:26:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/lib/cocoapods/command.rb:48:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/cocoapods-0.38.2/bin/pod:44:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

Support for specifying versions

This came up while attempting to install Siesta, which has no stable release, but does have a functional '1.0-beta.6' tag. Installable and functional via a Podfile entry like:

'Siesta', '>= 1.0-beta.6'

But the comma throws a wrench in the works. It attempts to pick up the version specification as another framework.

As a side note, when attempting things like:

pod playgrounds --verbose 'Siesta, ~> 1.0-beta.6'

Relatedly I appear to have managed to get passed through (perhaps by way of workspace.rb's @cwd = Pathname.getpwd) a rm -fr ~. I can't say if it was that precise version of the commands I tried, but there were many. Suddenly (and embarrassingly) I was missing a large number of files in my home directory. I hesitate to submit this precise thing as a bug in part because I've yet to replicate it...and that's because I've yet to attempt to replicate it. Hopefully you can understand why I might be hesitant to do so.

Added source files cannot import pod modules

I like to separate my playground code into many files. In a regular playground, I place swift files in the Sources folder under the playground and I can use their public classes and functions in the playground code.

In a playground with pods, it seems only the main playground code is able to import modules coming from pods. I tried adding swift files to the Sources folder under the playground and adding swift files to the project main folder as a sibling to the playground, in both cases I cannot import the pod modules.

Please let me know if I'm missing something. If not, it would be great if you could fix this.

Investigate building Playgrounds for Carthage-enabled libs

I'm thinking this should work fairly easy:

  • Build using carthage
  • Add binary frameworks to the generated project
  • Make the generated target depend on them

When building the generated target, the dependent frameworks should end up in the Playground's framework search path.

Allow for multiple pods

Sometimes you need more than one pod when you want to try something in a playground. E.g. you very often need both RxSwift and RxCocoa (and sometimes the data sources pod).

I think it'd be great if you allow for a comma separated list when specifying the pods, eg something like this:

  1. if pod name command line parameter contains ","
  2. split name parameter by ","
  3. add a "pod podname" line for each of the pods specified

Ta -daaa πŸŽ‰

For RxSwift 3.0 with Carthage support

I run the command:

carthage-play ReactiveX/RxSwift

The project and playground files are created. But got the following error message:

The file /Users/myname/Projects/Swift/ReactiveXPlayground/ReactiveXPlayground/ReactiveX.xcodeproj does not exist.

And got error in playground file too:

No such module RxSwift

What's wrong with it? Thanks

Carthage play failing

carthage-play acquia/waterwheel-swift 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.0.rc.2/lib/cocoapods/executable.rb:69:in `execute_command': [!] /usr/local/bin/carthage update --platform ios (Pod::Informative)

*** Fetching waterwheel-swift
*** Fetching SwiftyJSON
*** Fetching ObjectMapper
*** Fetching SwiftyUserDefaults
*** Fetching Alamofire
*** Checking out Alamofire at "4.0.1"
*** Checking out ObjectMapper at "2.0.0"
*** Downloading SwiftyJSON.framework binary at "3.1.0"
*** Checking out SwiftyUserDefaults at "3.0.0"
*** Checking out waterwheel-swift at "4.3.1"
A shell task (/usr/bin/env git checkout --quiet c0462747a546575665f57fceeb560b5d2830b36b) failed with exit code 128:
fatal: reference is not a tree: c0462747a546575665f57fceeb560b5d2830b36b


    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:40:in `setup_project'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:24:in `block in generate'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:23:in `chdir'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:23:in `generate'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-playgrounds-1.2.2/bin/carthage-play:42:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-playgrounds-1.2.2/bin/carthage-play:46:in `<top (required)>'
    from /usr/local/bin/carthage-play:23:in `load'
    from /usr/local/bin/carthage-play:23:in `<main>'

I think it may have to do with the fact that SwiftyJSON is downloading a binary and not checking out?

hi! i run 'pod playgrounds Alamofire', but i got a error

when i run 'pod playgrounds Alamofire'
A error said '[!] Unable to find host target for Pods-AlamofirePlayground. Please add the host targets for the embedded targets to the Podfile.'

And i add 'target 'Pods-AlamofirePlayground' do ... end ' or ' abstract_target 'Pods-AlamofirePlayground' do' to my profile.But none did work. i got the same error words what like above.
How can i fix it?

my Xcode is 7.3.1, pods is 1.1.0.beta.1

thank you.

Xcode 9 support

Current version doesn't work with Xcode 9.

It fails with:

Errno::ENOENT - No such file or directory - /Applications/Xcode-beta.app/Contents/Developer/Library/Xcode/Templates/File Templates/Source/Playground with Platform Choice.xctemplate

Looks like Xcode 9 comes with a different Playground templates.

Module compiled with Swift 4.1.2 cannot be imported with the Swift 4.2 compiler

Playground execution failed:

error: Empty.playground:6:8: error: module compiled with Swift 4.1.2 cannot be imported by the Swift 4.2 compiler: /Users/ellen/Library/Developer/Xcode/DerivedData/Empty-aiojmrqftycfwvbtpmkzvlsjvgjl/Build/Products/Debug-iphonesimulator/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule
import Result
       ^

Cannot load underlying module for 'RxCocoa'

Thought I'd post this here, even though it may be a CocoaPods issue at heart, because this exact error came up for me when first attempting the README's example command: pod playgrounds RxSwift,RxCocoa.

After building the project, a red exclamation (!) appears next to the TCBUBYP-generated playground's import RxCocoa with this error:

Cannot load underlying module for 'RxCocoa'

Cannot reference framework from files under Sources

This works beautiful for referencing framework from Playground file! Following example just imports 'Realm' framework that I incorporated using this CocoPod plugin.
screen shot 2016-05-08 at 12 43 41 pm

However, if I do the same from files under Sources, it cannot reference the same framework.
screen shot 2016-05-08 at 12 43 25 pm

Is it a known issue? If it is, is there a workaround?

Use with Cocoapods 0.39.0

gem install cocoapods-playgrounds seems to install Cocoapods 1.0.1 (latest).

I need to stay on Cocoapods 0.39.0.

Is there quick fix for this, like specifying the version?

Better Title

Title barely tells about how awesome the library is. Maybe something like PodPlaygrouds?

Fails to import pod in plaground

I downloaded your project and followed the instructions. The playground gives the module not found err on any pod included.

What am I missing?

No such module

I ran pod playgrounds ReactiveCocoa and after it opens I went to the playground file.

I've touched nothing and it says No such module 'ReactiveCocoa'

[bug] Playground build can't link to frameworks

$ pod playgrounds Alamofire,Fuzi

when opening and running i get the following warnings / errors:

ld: warning: directory not found for option '-F/Users/luis/Library/Developer/Xcode/DerivedData/Alamofire-gkuowffwjdhhqfcudpkzfivwlpwi/Build/Products/Debug-iphonesimulator/Alamofire'
ld: warning: directory not found for option '-F/Users/luis/Library/Developer/Xcode/DerivedData/Alamofire-gkuowffwjdhhqfcudpkzfivwlpwi/Build/Products/Debug-iphonesimulator/Fuzi'

On /Users/luis/Library/Developer/Xcode/DerivedData/Alamofire-gkuowffwjdhhqfcudpkzfivwlpwi/Build/Products/Debug-iphonesimulator/ there are the following after building:

Alamofire.framework
AlamofirePlayground.framework
Fuzi.framework
Pods_AlamofirePlayground.framework

The content of the playground is:

//: Please build the scheme 'AlamofirePlayground' first
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true

import Alamofire
import Fuzi

print(AlamofireVersionNumber)

Where if it worked fine, we would see in the output: "1.1\n"

Of notice, if one just imports one framework, it works fine.

Limit local podspec feature to paths which are actually valid podspecs

 % pod playgrounds AsyncDisplayKit                                                                               ~/Documents MacBook-Pro
[!] /usr/local/bin/pod install --no-repo-update

Analyzing dependencies
Fetching podspec for `AsyncDisplayKit` from `/Users/nicholasvelloff/Documents`
[!] No podspec found for `AsyncDisplayKit` in `/Users/nicholasvelloff/Documents`

Point to local Pod

Hey!

This library is absolutely fantastic. I've been trying to use ReactiveCocoa on a playground since playgrounds came out, and today was the first time I finally managed to do it :)

Question: is there a syntax that will create this pointing to a Pod in the local system? Thanks!

Not working in Xcode 8.2

pod playground 'RxSwift, RxCocoa' Does generate a Playground RxSwift but it says no module RxSwift and convert to Swift 3 and once we cover it to Swift 3 it is not working

Xcode 8.2, Sierra, Swift 3. Please Fix ASAP.

'No such module' when trying to import framework in playground

I am trying to create playground with Alamofire. I am doing everything according to the instructions (including building the scheme), but the framework can't seem to be imported in the playground:
screen shot 2016-02-19 at 18 27 48

My Xcode version is 7.2.1 (7C1002), CocoaPods version is 1.0.0.beta.3 (tried 0.39.0 as well).

Am I missing something?

Error with Xcode 9.4 (9F1027a)

I ran pod playgrounds Alamofire and I have the same problem as here: #52

It doesn't work with others pods eg: Moya, RxSwift.

I know it was fixed 2 days ago but maybe not for version 9.4?

Anyone else have this problem?

Error

Errno::ENOENT - No such file or directory @ dir_initialize - /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/Source/Playground with Platform Choice.xctemplate
/Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/generate.rb:43:in `open'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/generate.rb:43:in `foreach'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/generate.rb:43:in `dir_for_platform'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/generate.rb:10:in `initialize'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:26:in `new'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:26:in `block in generate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:23:in `chdir'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/workspace.rb:23:in `generate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-playgrounds-1.2.2/lib/cocoapods-playgrounds/command/playgrounds.rb:46:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

Stack

   CocoaPods : 1.5.3
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin17]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.13.6 (17G65)
       Xcode : 9.4 (9F1027a)
         Git : git version 2.16.2
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ b8a53d010801cce2087b0563d0e39c14058aeedb

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-playgrounds : 1.2.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

platform :ios, '9.0'
use_frameworks!

target 'transport-parents' do

  # Pods for XX
  pod 'Fabric'
  pod 'Crashlytics'
  pod 'Alamofire'
  pod 'Moya'
  pod 'SnapKit'
  pod 'PromisesSwift'
  pod 'PromiseKit'
  pod 'PromiseKit/Alamofire'
  pod 'RxSwift'
  pod 'RxCocoa'

  target 'XXTests' do
    inherit! :search_paths
  end

  target 'XXUITests' do
    inherit! :search_paths
  end

end

.xcworkspace does not exist.

When running pod playgrounds all the files are created but they claim the .xcworkspace does not exist, even though it does. When opening the playground the error no such module is shown. I am using version 1.2.2 and Cocoapods-1.1.0.rc.2.

Not working with CocoaPods 1.0.0 beta

I'm trying to use this gem with CocoaPods version 1.0.0.beta6 and it doesn't work.
The pod command just doesn't find playgrounds sub-command.

At the same time it works with 0.39.0.

Is it possible to use playgrounds with pre-release CocoaPods?

Importing Framework in the Sources directory doesn't work

As the title says, if you try to import one of Podspecs that you want to Play Withβ„’, the import fails

Could this be because the Sources are compiled as a different Module and the xcconfig doesn't take this into account when linking the frameworks to the modules where they are required?

Any way I help you with this?

PS: Thanks for this plugin, loving it!

No support for private pods

This playgrounds sub-command is lacking support for private pods. If my pod depends on another private pod, the pod install --no-repo-update will fail to fetch private pods.

I have to specify all of the privates pods directly then:

pod playgrounds MyPod.podspec,/path/to/dependency-a.podspec,/path/to/dependency-b.podspec

It would be great to have support for --sources option for playgrounds too.

unable to run the command `gem install cocoapods-playgrounds`

  • I keep having an error when I want to run the command gem install cocoapods-playgrounds. Here is the error that I get : ERROR: While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.`
  • I also tried to run sudo gem install cocoapods-playgrounds and here is the error that I get:
    ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/carthage-play

Framework imports don't work in source swift file

This is not a issue but an unsupported feature.

"pod playgrounds Alamofire" command created a workspace.
"import Alamofire" can be used in main playground file or playground pages. But if I add any swift file in source folder, I can't use any import statements for installed pods.

I am not sure if this is even supported by Apple.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.