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

The source_files pattern did not match any file. #9479

Closed
elsh opened this issue Jan 9, 2020 · 6 comments
Closed

The source_files pattern did not match any file. #9479

elsh opened this issue Jan 9, 2020 · 6 comments
Labels
s1:awaiting input Waiting for input from the original author

Comments

@elsh
Copy link

elsh commented Jan 9, 2020

Trying to add source_files per below throws an error. Note that the source is a link to a .zip file.

➜  mockolo git:(master)  pod spec lint

 -> MockoloFramework (1.1.2)
    - ERROR | [OSX] file patterns: The `source_files` pattern did not match any file.
    - WARN  | [OSX] license: Unable to find a license file
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | [OSX] xcodebuild:  note: Planning build
    - NOTE  | [OSX] xcodebuild:  note: Constructing build description

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error and 1 warning.

[!] Unable to read the license file `LICENSE.txt` for the spec `MockoloFramework (1.1.2)`

[!] Unable to read the license file `LICENSE.txt` for the spec `MockoloFramework (1.1.2)`

Here's the spec (also see https://github.com/uber/mockolo/blob/master/MockoloFramework.podspec).

Pod::Spec.new do |s|
  s.name             = 'MockoloFramework'
  s.version          = '1.1.2'
  s.summary          = 'Efficient Mock Generator for Swift'
  s.description      = 'MockoloFramework provides a fast and easy way to autogenerate mock objects that can be tested in your code....'

  s.homepage         = 'https://github.com/uber/mockolo'
  s.license          = { :type => 'Apache 2.0', :file => 'LICENSE.txt' }
  s.author           = { 'name' => 'name@co.com' }
  s.osx.deployment_target = '10.14'
  s.swift_version    = '5.1'
  s.dependency 'SourceKittenFramework', '~>0.26.0'
  s.source         = { :http => "#{s.homepage}/archive/#{s.version}.zip" }
  s.source_files =  'Sources/MockoloFramework/**/*.swift'
end

If I don't specify source_files, I can run 'pod install' successfully in a sample project using it, but importing the module MockoloFramework fails with "No such module 'MockoloFramework''.

Here's pod env:

➜ SomeTest git:(master) pod env

Stack

   CocoaPods : 1.8.4
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14.6 (18G1012)
       Xcode : 11.2.1 (11B500)
         Git : git version 2.19.1
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : cocoapods - git - https://github.com/CocoaPods/Specs.git @ d4caeef25e1847e2d1369caa9f103e2fd8af1b2a
               MockoloFramework - git - https://github.com/uber/mockolo.git @ 7b79b1da183d2f1f49a1bef9c3b01c4f90c7246c
               trunk - CDN - https://cdn.cocoapods.org/
               uber - file system

Installation Source

Executable Path: /usr/local/Cellar/cocoapods/1.8.4/libexec/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.1.0

Podfile

source 'https://github.com/CocoaPods/Specs.git'

workspace 'SomeTest.xcworkspace'
use_frameworks!

target 'SomeTest' do
  platform :osx, '10.14'

  pod 'MockoloFramework'
end
@paulb777
Copy link
Member

paulb777 commented Jan 9, 2020

Probably worth going through the tutorial at https://guides.cocoapods.org/making/using-pod-lib-create and then adapting your project accordingly.

@dnkoutso
Copy link
Contributor

The error clear states that nothing in your glob matches any source files.

@dnkoutso dnkoutso added the s1:awaiting input Waiting for input from the original author label Jan 12, 2020
@stale stale bot removed the s1:awaiting input Waiting for input from the original author label Jan 14, 2020
@elsh
Copy link
Author

elsh commented Jan 14, 2020

This is the file structure of https://github.com/uber/mockolo.git.

I've added :flatten => true to the s.source (since it's a zip file), besides s.source_files = 'Sources/MockoloFramework/**/*.swift', which should be the correct structure, but still getting the same error.

[Root]
MockoloFramework.podspec
Sources
  - Mockolo
     - *.swift
  - MockoloFramework
     - Models
         - *.swift
     - Operations
         - *.swift
     - Templates
         - *.swift
     - Utils
         - *.swift

@dnkoutso
Copy link
Contributor

pod spec lint downloads the zip file from s.source. Unzip the file and then see the content to see if your glob matches.

I am starting to think this is best asked in StackOverflow instead as this does not appear to be a CocoaPods library issue.

@dnkoutso dnkoutso added the s1:awaiting input Waiting for input from the original author label Jan 14, 2020
@dnkoutso
Copy link
Contributor

dnkoutso commented Jan 14, 2020

It's possible you need to set your glob to s.source_files = mockolo-1.1.2/Sources/MockoloFramework/**/*.swift

@stale stale bot removed the s1:awaiting input Waiting for input from the original author label Jan 14, 2020
@dnkoutso dnkoutso added the s1:awaiting input Waiting for input from the original author label Jan 14, 2020
@elsh
Copy link
Author

elsh commented Jan 14, 2020

Actually tried pod spec lint with :flatten again and it seems to be resolved now.

@elsh elsh closed this as completed Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s1:awaiting input Waiting for input from the original author
Projects
None yet
Development

No branches or pull requests

3 participants