iOS submits .podspec file to spec Repo

1. Create a new git repository and select License


 

2. Submit the source code to the newly created repository

1. Make sure your source code has been pushed to Github. If you haven't pushed the source code, you can use Terminal cd to the root directory of the local source code and execute: 

git add -A
git commit -m "first commit for version 1.0.0"
git push origin master
 

2. Make sure that the code you push has been marked with "version tag", that is, the source code is marked with a version number:

git tag '1.0.0'
git push --tags

 3. Make a podspec file

pod spec create GWUUIDManger //Replace the name of the podspec file with your own

 After the command is executed, the file GWUUIDManger.podspec will be generated in the current directory, and the content is roughly as follows:

Pod::Spec.new do |s|
  s.name = "PodTestLibrary" #Name
  s.version = "0.1.0" #version number
  s.summary = "Just Testing." #A brief introduction, the following is a detailed introduction
  s.description      = <<-DESC
                       Testing Private Podspec.
 
                       * Markdown format.
                       * Don't worry about the indent, we strip it!
                       DESC
  s.homepage = "https://coding.net/u/wtlucky/p/podTestLibrary" #Homepage, fill in the accessible address here, otherwise the verification will fail
  # s.screenshots     = "www.example.com/screenshots_1", "www.example.com/screenshots_2"           #截图
  s.license = 'MIT' #Open source license
  s.author = { "wtlucky" => "[email protected]" } #author information
  s.source = { :git => "https://coding.net/wtlucky/podTestLibrary.git", :tag => "0.1.0" } #Project address, the ssh address is not supported here, the verification fails, Only supports HTTP and HTTPS, preferably HTTPS
  # s.social_media_url = 'https://twitter.com/<twitter_username>' #Multimedia introduction address
 
  s.platform = :ios, '7.0' #Supported platforms and versions
  s.requires_arc = true #Whether to use ARC, if a specific file is specified, the specific problem uses ARC
 
  s.source_files = 'Pod/Classes/**/*' #code source file address, **/* represents all files in the Classes directory and its subdirectories, if there are multiple directories, separate them with commas, if you need to add files in the project In the group display, the corresponding settings should also be made here.
  s.resource_bundles = {
    'PodTestLibrary' => ['Pod/Assets/*.png']
  } #Resource file address
 
  s.public_header_files = 'Pod/Classes/**/*.h' #public header file address
  s.frameworks = 'UIKit' #Required frameworks, separated by commas
  s.dependency 'AFNetworking', '~> 2.3' #Dependency, other libraries that the project depends on, if there are more than one, you need to fill in multiple s.dependency
end

 Excuting an order:

pod lib lint

 After the verification is passed, it can be uploaded to the spec Repo for review.

4. Upload

First, after updating the trunk, CocoaPods needs version 0.33 or higher. Use pod --version to check. If the version is low, it needs to be updated. The update method was introduced before. 

Next step to register trunk

pod trunk register [email protected] 'zhangsan' --description='macbook air'

 After the execution is completed, you will receive an email to activate it in your registered email address.

 

then execute the code

pod trunk push your.podspec

 Uploading, the first time requires a long process. After the upload is complete, execute:

pod setup

This is another long process, after which execute:

pod search

 can be found.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326642501&siteId=291194637