CocoaPods / CocoaPods

The Cocoa Dependency Manager.
https://cocoapods.org/
Other
14.55k stars 2.63k forks source link

`pod spec lint` and `pod repo push` replace hyphen with underscore for PRODUCT_NAME #5426

Closed iwill closed 8 years ago

iwill commented 8 years ago

Report

What did you do?

pod spec lint and pod repo push

What did you expected to happen?

The result of validation should be success.

What happened instead?

But it failed. The error is

fatal error: 'NSString-UrlEncode/NSString+URLEncode.h' file not found
#import <NSString-UrlEncode/NSString+URLEncode.h>
        ^

NSString-UrlEncode is a pod framework.

Its PRODUCT_NAME in pod project is NSString-UrlEncode when pod install, so I use

#import <NSString-UrlEncode/NSString+URLEncode.h>

But its PRODUCT_NAME in pod project is NSString_UrlEncode when pod spec lint and pod repo push, I must use

#import <NSString_UrlEncode/NSString+URLEncode.h>

Which is wrong?

CocoaPods Environment

[in /Users/iwill/Developer/ios/M9Dev]

Stack

   CocoaPods : 1.0.0
        Ruby : ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
    RubyGems : 2.4.8
        Host : Mac OS X 10.11.5 (15F34)
       Xcode : 7.3.1 (7D1014)
         Git : git version 2.7.4 (Apple Git-66)
Ruby lib dir : /Users/iwill/.rvm/rubies/ruby-2.2.1/lib
Repositories : artsy - https://github.com/Artsy/Specs.git @ c03632020b0a429fbab35bf0f1c047a68ca05ea2
               baijiahulian-app-specs - http://git.baijiahulian.com/app/specs.git @ 749f182660381bb84f473acd624e4e4882ce420f
               gitcafe-akuandev-specs - https://gitcafe.com/akuandev/Specs.git @ f1f5e0ae99a15b058468b638273000db6da3b9a6
               master - https://github.com/CocoaPods/Specs.git @ 2d941847875a3ca0f86a87f585fa3d5beb0f001f

Installation Source

Executable Path: /Users/iwill/.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

Podfile

# pod install --no-repo-update

# source 'https://github.com/CocoaPods/Specs.git'
source 'https://gitcafe.com/akuandev/Specs.git'

platform :ios, '7.0'
inhibit_all_warnings!

target :M9Dev do
    pod 'JRSwizzle'
    pod 'AFNetworking',         '~> 2.6'
    pod 'Reachability'
    pod 'TMCache'
    pod 'NSString-UrlEncode'
    pod 'YYModel'
    pod 'Masonry'
    pod 'SDWebImage'
    pod 'CocoaLumberjack'
    pod 'FLEX',                 '~> 2.0', :configurations => ['Debug']
end

# Add podspecs as an exclusive dependency for the M9DevTests target
# target :M9DevTests, :exclusive => true do

target :M9DevTests do
    # pod 'Kiwi',     '~> 2.3'
    pod 'Specta',   '~> 1.0'
    pod 'Expecta',  '~> 1.0'
    # pod 'KZPlayground'
end

Project that demonstrates the issue

https://github.com/iwill/M9Dev/releases/tag/0.0.13

orta commented 8 years ago

This is not wrong, the linters are testing your libraries as frameworks, and as frameworks they must be correctly named as clang modules. Clang modules don't support - as a character.

You can skip linting as frameworks, by using --use-libraries but you will end up with something that doesn't work in Swift.

iwill commented 8 years ago

Got it, thank you!