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

Adding additional files to a resource bundle in a subspec does not work #1812

Closed
Thomvis opened this issue Feb 9, 2014 · 4 comments
Closed
Assignees

Comments

@Thomvis
Copy link
Contributor

Thomvis commented Feb 9, 2014

I am working on a podspec where I want the user of that pod to be able to optionally include some assets. The default subspec 'Core' defines a resource bundle named 'Highstreet' and adds some vital files to it. I also define an optional subspec 'Assets' that the user can include if some default assets (e.g. icons) should be included as well. Using CocoaPods version 0.29.0, the assets from the 'Assets' subspec are not included in the resulting resource .bundle.

It seems to me that CocoaPods should be able to add files to an existing bundle and that my set-up should work. Please let me know if you agree.

Observations:

  • The Pods project contains a generated bundle target named 'Highstreet'. In its 'copy bundle resources' build phase, I see all files from the default subspec, not the optional 'Assets' subspec.
  • In 'Pods-resources.sh' I see that it installs the bundle twice:
install_resource "${BUILT_PRODUCTS_DIR}/Highstreet.bundle"
install_resource "${BUILT_PRODUCTS_DIR}/Highstreet.bundle"

I've attached several relevant pieces of information below.

Podspec (excerpts from...)

Pod::Spec.new do |s|
  s.name     = 'Highstreet'

  s.default_subspec = 'Core'

  s.subspec 'Core' do |ss|
    s.source_files = 'Highstreet/Classes/**/*.{h,m}'
    s.resource_bundle = {
      'Highstreet' => [
        'Highstreet/Resources/Highstreet.xcdatamodeld', 
        'Highstreet/Resources/cache.sql', 
        'Highstreet/Classes/Views/**/*.xib',
        'Highstreet/Resources/Web/*.*',
        'Highstreet/Resources/Translations/**/*.strings',
      ]
    }
  end

  # includes the default assets
  s.subspec 'Assets' do |ss|
    ss.resource_bundle = {
      'Highstreet' => [
        'Highstreet/Resources/Assets/**/*.{png,jpg,jpeg}',
      ]
    }  
  end

end

Podfile of client project:

pod 'Highstreet', :path => '../../Development'
pod 'Highstreet/Assets', :path => '../../Development'

pod 'Reveal-iOS-SDK', '~> 1.0.3'
@fabiopelosin
Copy link
Member

This is not a supported behavior. Can you create an another bundle for the optional assets? The intent would be more clear as changing the contents of the bundle in this way could lead to user confusion.

@Thomvis
Copy link
Contributor Author

Thomvis commented Feb 19, 2014

Yes, I could create a second, separate bundle and that is probably what I should do. Thanks for guarding CocoaPods' simplicity.

@rivera-ernesto
Copy link
Contributor

Related to #1690.

@CocoaPodsBot
Copy link

Closed for duplicating #1690 by @segiddins

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

5 participants