Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
Thomvis opened this Issue · 4 comments

5 participants

Thomas Visser Fabio Pelosin Ernesto Rivera CocoaPods Bot Kyle Fuller
Thomas Visser

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'
Fabio Pelosin

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.

Thomas Visser

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

Ernesto Rivera

Related to #1690.

Kyle Fuller kylef added the Resources label
CocoaPods Bot
Collaborator

Closed for duplicating CocoaPods/CocoaPods#1690 by @segiddins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.