Cocoapods pod repo push git - PullRequest
       27

Cocoapods pod repo push git

1 голос
/ 26 апреля 2019

Я пытаюсь подтолкнуть мой модуль к локальному репо. До этого я проверил 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 git@git.url.com: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 git@git.url.com: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' => 'ankit.thakur@url.com' }
  spec.source           = { :git => 'git@git.url.com: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' => 'ankit.thakur@promobitech.com' }
  spec.source           = { :git => 'git@git.promobitech.com: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

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

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

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

1 Ответ

0 голосов
/ 26 апреля 2019

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

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

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

Так что вы должны исправить свой source_files, как показано ниже

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

(сюда войдут все файлы Swift в папке "FOLDERNAME")

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

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

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...