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

Copying two times .prefix_header_contents in the .pch. Is it a bug? #1818

Closed
colasbd opened this issue Feb 12, 2014 · 1 comment
Closed

Copying two times .prefix_header_contents in the .pch. Is it a bug? #1818

colasbd opened this issue Feb 12, 2014 · 1 comment

Comments

@colasbd
Copy link

colasbd commented Feb 12, 2014

With the following .podspec, the comment \\hello is included two times in the Pod-MyPod-prefix.pch. Is it normal or is it a bug?

Pod::Spec.new do |s|

  s.name = 'MyPod'
  s.prefix_header_contents = '//hello'

  non_arc_files = 'Classes/FirstNonARCClass.m', 'Classes/SecondNonARCClass.m', 'Classes/ThirdNonARCClass.m'

  s.requires_arc = true
  s.source_files = 'Classes/*.{h,m}'

  s.exclude_files = non_arc_files

  s.subspec 'no-arc' do |sna|
    sna.requires_arc = false
    sna.source_files = non_arc_files
  end

end

I am sorry to post here, but I just want to give my feed back (and possibly help) on your project. I got negative votes when posting similar questions on stack overflow, and IMO, the documentation is unclear. I would like to improve the documentation, but I am a newcomer (coding for 10 month).

I solved this issue by doing this, but I think it's not the natural way the command s.prefix_header_contents should work. Nobody wants the same lines of code two times in a file!

Pod::Spec.new do |s|

  s.name = 'MyPod'
  s.prefix_header_contents = '//hello'

  non_arc_files = 'Classes/FirstNonARCClass.m',
    'Classes/SecondNonARCClass.m',
    'Classes/ThirdNonARCClass.m'

  s.requires_arc = true
  s.source_files = 'Classes/*.{h,m}'

  s.exclude_files = non_arc_files

  s.subspec 'no-arc' do |sna|
    sna.requires_arc = false
    sna.source_files = non_arc_files
    sna.prefix_header_contents = ''
  end

end

See also the discussion here: http://www.fabiancanas.com/entry/per-file-arc-in-cocoapods#comment-1238351398

Thanks for your project !! I hope it will grow !!

@kylef
Copy link
Contributor

kylef commented Mar 11, 2014

Duplicate of #1449.

@kylef kylef closed this as completed Mar 11, 2014
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

No branches or pull requests

2 participants