Репозиторий Cocoapods pod push git

Я пытаюсь отправить свой модуль в локальное репо. До этого я проверил pod lib lint в своем репозитории и отлично работал локально.

$ pod lib lint --swift-version=5.0 --allow-warnings
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18/rbconfig.rb:215: warning: Insecure world writable dir /usr/local/sbin in PATH, mode 040777

 -> SFLocationManager (1.0)
    - WARN  | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Planning build
    - NOTE  | xcodebuild:  note: Constructing build description

SFLocationManager passed validation.

После этого я создал теги и отправил их на сервер.

$ git tag
0.1.0
0.1.1
1.0

Затем я попытался протестировать команду pod repo push для локального репо, которая не удалась.

$ pod repo push [email protected]:ankit.thakur/locationmanager.git SFLocationManager.podspec --allow-warnings --swift-version=5.0 --local-only
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18/rbconfig.rb:215: warning: Insecure world writable dir /usr/local/sbin in PATH, mode 040777

Validating spec
 -> SFLocationManager (1.0)
    - WARN  | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
    - ERROR | file patterns: The `source_files` pattern did not match any file.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Planning build
    - NOTE  | xcodebuild:  note: Constructing build description

[!] The `SFLocationManager.podspec` specification does not validate.

Затем я удалил флаг --local-only и снова запустил, но все равно не удалось.

$ pod repo push [email protected]:ankit.thakur/locationmanager.git SFLocationManager.podspec --allow-warnings --swift-version=5.0
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18/rbconfig.rb:215: warning: Insecure world writable dir /usr/local/sbin in PATH, mode 040777

Validating spec
 -> SFLocationManager (1.0)
    - WARN  | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
    - ERROR | file patterns: The `source_files` pattern did not match any file.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Planning build
    - NOTE  | xcodebuild:  note: Constructing build description

[!] The `SFLocationManager.podspec` specification does not validate.

Вот версия подкачки

$ pod --version
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18/rbconfig.rb:215: warning: Insecure world writable dir /usr/local/sbin in PATH, mode 040777
1.6.0

Вот файл подспека:

#
# Be sure to run `pod lib lint SFLocationManager.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |spec|
  spec.name             = 'SFLocationManager'
  spec.version          = '1.0'
  spec.summary          = 'SFLocationManager is location based library for iOS and Mac'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  spec.description      = <<-DESC
 Location library in beta test version to fetch location with scheduled interval.
                       DESC

  spec.homepage         = 'https://git.url.com/ankit.thakur/locationmanager'
  # spec.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  spec.license          = { :type => 'MIT', :file => 'LICENSE' }
  spec.author           = { 'ankitthakur' => '[email protected]' }
  spec.source           = { :git => '[email protected]:ankit.thakur/locationmanager.git', :tag => spec.version.to_s }
  # spec.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  spec.requires_arc = true
  spec.ios.deployment_target  = '10.0'
  spec.osx.deployment_target  = '10.10'

  spec.source_files       = 'SFLocationManager/Sources/Common/**/*.swift'
  # spec.ios.source_files   = 'SFLocationManager/Sources/iOS/**/*.swift'
  # spec.osx.source_files   = 'SFLocationManager/Sources/OSX/**/*.swift'

  # spec.resource_bundles = {
  #   'SFLocationManager' => ['SFLocationManager/Assets/*.png']
  # }

  spec.frameworks = 'CoreLocation'

  # spec.public_header_files = 'Pod/Classes/**/*.h'
  # spec.frameworks = 'UIKit', 'MapKit'
  # spec.dependency 'AFNetworking', '~> 2.3'
end

Ответ spec.source_files:

$ ls -al SFLocationManager/Sources/Common/**/*.swift
-rw-r--r--@ 1 ankitthakur  staff  2710 Apr 25 18:02 SFLocationManager/Sources/Common/GeocoderUtils/Geocoder.swift
-rw-r--r--@ 1 ankitthakur  staff   613 Apr 25 18:21 SFLocationManager/Sources/Common/LocationManager/LocationConfiguration.swift
-rw-r--r--@ 1 ankitthakur  staff   324 Apr 25 18:02 SFLocationManager/Sources/Common/LocationManager/LocationError.swift
-rw-r--r--@ 1 ankitthakur  staff   241 Apr 25 18:02 SFLocationManager/Sources/Common/LocationManager/LocationEventType.swift
-rw-r--r--@ 1 ankitthakur  staff  7144 Apr 25 18:36 SFLocationManager/Sources/Common/LocationManager/LocationManager.swift
-rw-r--r--@ 1 ankitthakur  staff  4649 Apr 25 18:02 SFLocationManager/Sources/Common/Model/Location.swift
-rw-r--r--@ 1 ankitthakur  staff  3939 Apr 25 18:27 SFLocationManager/Sources/Common/Trigger/LocationTriggerManager.swift

Согласно предложениям в предоставленных решениях, мой обновленный Podspec

#
# Be sure to run `pod lib lint SFLocationManager.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |spec|
  spec.name             = 'SFLocationManager'
  spec.version          = '1.0'
  spec.summary          = 'SFLocationManager is location based library for iOS and Mac'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  spec.description      = <<-DESC
 Location library in beta test version to fetch location with scheduled interval.
                       DESC

  spec.homepage         = 'https://git.promobitech.com/ankit.thakur/locationmanager'
  # spec.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  spec.license          = { :type => 'MIT', :file => 'LICENSE' }
  spec.author           = { 'ankitthakur' => '[email protected]' }
  spec.source           = { :git => '[email protected]:ankit.thakur/locationmanager.git', :tag => spec.version.to_s }
  # spec.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  spec.requires_arc = true
  spec.ios.deployment_target  = '10.0'
  spec.osx.deployment_target  = '10.10'

  spec.source_files       = 'SFLocationManager/Sources/Common/GeocoderUtils/*.{swift}',
  'SFLocationManager/Sources/Common/LocationManager/*.{swift}',
  'SFLocationManager/Sources/Common/Model/*.{swift}',
  'SFLocationManager/Sources/Common/Trigger/*.{swift}'
  # spec.ios.source_files   = 'SFLocationManager/Sources/iOS/**/*.{swift}'
  # spec.osx.source_files   = 'SFLocationManager/Sources/OSX/**/*.{swift}'

  # spec.resource_bundles = {
  #   'SFLocationManager' => ['SFLocationManager/Assets/*.png']
  # }

  spec.frameworks = 'CoreLocation'

  # spec.public_header_files = 'Pod/Classes/**/*.h'
  # spec.frameworks = 'UIKit', 'MapKit'
  # spec.dependency 'AFNetworking', '~> 2.3'
end

но он все еще не работает.

Вот мой файл podspec:

Admin:locationmanager ankitthakur$ ls -al
total 40
drwxr-xr-x  10 ankitthakur  staff   320 Apr 25 20:38 .
drwxr-xr-x   9 ankitthakur  staff   288 Apr 25 20:38 ..
-rw-r--r--   1 ankitthakur  staff  6148 Apr 25 20:38 .DS_Store
drwxr-xr-x  14 ankitthakur  staff   448 Apr 26 14:50 .git
drwxr-xr-x  10 ankitthakur  staff   320 Apr 25 20:38 Example
-rw-r--r--   1 ankitthakur  staff  1086 Apr 25 20:38 LICENSE
-rw-r--r--   1 ankitthakur  staff  1029 Apr 25 20:38 README.md
drwxr-xr-x   4 ankitthakur  staff   128 Apr 25 20:51 SFLocationManager
-rw-r--r--   1 ankitthakur  staff  2241 Apr 26 14:49 SFLocationManager.podspec
lrwxr-xr-x   1 ankitthakur  staff    27 Apr 25 20:38 _Pods.xcodeproj -> Example/Pods/Pods.xcodeproj

person Ankit Thakur    schedule 26.04.2019    source источник


Ответы (1)


Ошибка говорит:

file patterns: The `source_files` pattern did not match any file.

Это означает, что вы написали неправильный шаблон.

Итак, вы должны исправить свой source_files следующим образом.

s.source_files = "FOLDERNAME/*.{swift}"

(Это будет включать все файлы Swift в папке «ИМЯ ПАПКИ»)

Если у вас несколько папок, сделайте следующее:

s.source_files = "FOLDERNAME1/*.{swift}" , "FOLDERNAME2/*.{swift}"

person Marwen Doukh    schedule 26.04.2019
comment
Мои файлы здесь: spec.source_files = 'SFLocationManager/Sources/Common/**/*.swift' - person Ankit Thakur; 26.04.2019
comment
Вы должны указать расширение файла между двумя скобками. См. это: guides.cocoapods.org/syntax/podspec.html#source_files - person Marwen Doukh; 26.04.2019
comment
Вы пытались включить каждую подпапку отдельно (как указано в ответе выше)? - person Marwen Doukh; 26.04.2019
comment
да, я сделал, и обновил запрос с обновленными исходными_файлами. Я пробовал их как в многострочном, так и в однострочном режиме. Но без успеха - person Ankit Thakur; 26.04.2019
comment
Не могли бы вы перейти в ту же папку, что и файл podspec, и нажать ls -l? - person Marwen Doukh; 26.04.2019
comment
обновленный вопрос, проверьте мой путь к файлу podspec и исходные_файлы относительно них - person Ankit Thakur; 26.04.2019