A subspec is considered empty if it only adds a resource_bundle #1836

Closed
Thomvis opened this Issue Feb 24, 2014 · 5 comments

5 participants

@Thomvis

I think there is an issue with the podspec linter where it erroneously fails the validation if the podspec contains a subspec that only adds a resource_bundle and prefix_header_contents. The error is as follows:

- ERROR | [iOS] The Highstreet/Assets (1.0.0-beta.1) spec is empty (no source files, resources, preserve paths, , vendored_libraries, vendored_frameworks dependencies or subspecs).

This error does not mention resource_bundle and that makes me think that it is maybe not yet updated to support the resource_bundle property.

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

  s.default_subspec = 'Core'

  s.subspec 'Core' do |ss|
    ss.source_files = 'Highstreet/Classes/**/*.{h,m}'
    ss.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-Assets' => [
        'Highstreet/Resources/Assets/**/*.{png,jpg,jpeg}',
      ]
    }

    ss.prefix_header_contents = "#define HS_ASSETS"    
  end

end

A workaround that I have in place now is to include a dummy file, e.g. an empty .h file, in the subspec. Then the podspec validates fine.

Looking forward to hear what you think. If you need more info, please let me know.

@Kapin
CocoaPods member

This sounds like a bug in the linter to me. I'll wait for others to confirm, but if it is, I'll open an issue in the Core repo to handle it.

@orta
CocoaPods member

I agree, especially as it lists all the things it considers OK to not make it empty, this should be in there.
no source files, resources, preserve paths, , vendored_libraries, vendored_frameworks dependencies or subspecs

@fabiopelosin
CocoaPods member

👍

@Kapin Kapin added the Defect label Feb 27, 2014
@Kapin
CocoaPods member

Created in Core/#63. Keeping this issue open as more people read this repo than the core one.

@CocoaPodsBot

Closed for duplicating CocoaPods/Core#63 by @joelparsons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment