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

Pod Init Output is inconsistient #5378

Closed
1 task done
edjiang opened this issue May 20, 2016 · 10 comments
Closed
1 task done

Pod Init Output is inconsistient #5378

edjiang opened this issue May 20, 2016 · 10 comments
Assignees
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor

Comments

@edjiang
Copy link

edjiang commented May 20, 2016

Report

On some projects, I run pod init and it gives me:

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

On others, I get:

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

target 'Empty Project' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Empty Project

end

What did you do?

I ran pod init in several empty, new projects.

What did you expected to happen?

I expected the targets to show up in the podfiles.

What happened instead?

The target is missing in new podfiles

CocoaPods Environment

Stack

   CocoaPods : 1.0.0
        Ruby : ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
    RubyGems : 2.4.6
        Host : Mac OS X 10.11.2 (15C50)
       Xcode : 7.3.1 (7D1014)
         Git : git version 2.7.4 (Apple Git-66)
Ruby lib dir : /Users/edjiang/.rvm/rubies/ruby-2.2.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 4efa06ed5a4069e3ad66e7039ae686b89be1ac14

Installation Source

Executable Path: /Users/edjiang/.rvm/gems/ruby-2.2.1/bin/pod

Plugins

cocoapods-deintegrate : 1.0.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.0.0
@orta
Copy link
Member

orta commented May 20, 2016

can you give us some examples zipped up?

@neonichu
Copy link
Member

neonichu commented May 20, 2016

I just noticed the same thing with this project: test12.xcodeproj.zip (which is just a fresh project with one extra target added)

It has two targets:

$ xcodebuild -list
Information about project "test12":
    Targets:
        test12
        Extension

But the generated Podfile only has one:

$ pod init
$ grep target Podfile 
target 'Extension' do

@neonichu neonichu added the s2:confirmed Issues that have been confirmed by a CocoaPods contributor label May 20, 2016
@edjiang
Copy link
Author

edjiang commented May 20, 2016

It's really inconsistent for me; I created a few projects and it seemed to do either way on a consistent basis. But it would do the same thing for each project.

Here's two of the folders I'm working with: https://github.com/edjiang/cocoapods-issue-5378

@segiddins
Copy link
Member

My guess is that's because they have Test in the target name, but I'm unsure.

@edjiang
Copy link
Author

edjiang commented May 20, 2016

Ah, that makes sense. I'm building a pod so have a bunch of random projects named 'XYZ Test" recently. Thought it was potentially a change in 1.0. I thought Cocoapods used to also generate a target for tests though?

@orta
Copy link
Member

orta commented May 20, 2016

It does, but it assumes that "XXX Test" is a test target for "XXX" - so when "XXX" doesn't exist, it doesn't show it. Sounds like a a bug.

@segiddins
Copy link
Member

Agree it's a bug, just was guessing at the cause 😉

@neonichu
Copy link
Member

Oh, it should probably use the product type to determine the identity, not the name :)

@segiddins
Copy link
Member

@neonichu iirc I didn't do that because Xcodeproj##AbstractTarget didn't have a helper for test_target_type?

@edjiang
Copy link
Author

edjiang commented May 31, 2016

Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor
Projects
None yet
Development

No branches or pull requests

4 participants