IOS component development – release private library

Time:2020-3-2

Remote index library

Associate remote index library add to local

Pod repo view local associated warehouse source
Pod repo add local index library name remote index library warehouse address
Pod repo update index library name
Pod repo remove local index library name

Execute the command to add a remote index library ‘ktpodspecs’ and clone it to the local

Remote library

New frame project ktuikit

Using template to generate private library project automatically

Pod lib create framework name pod lib create ktuikit

Generated engineering dependencies

The path of the podfile configuration spec of the sample project of ktuikit is relative to the path of the local podfile

Write podspec

Relying on third-party libraries

Framework wirks: dynamic libraries that depend on the system, such as uikitvended_framework: dynamic libraries that depend on the non system, such as Tencent openapi.framework libraries: static libraries that depend on the system, such as libstdc + +. Defended_libraries: static libraries that depend on the non system, such as libweibosdk.adependency of sina Weibo: pod Libraries that depend on the system

Upload framework to remote warehouse

New remote warehouse

Enter the local ktuikit directory and execute the GIT command to establish an association with the remote ktuikit

Git remote add origin https://github.com/coderketao/ktuikit.git gitgit branch -- set upstream to = origin / Master Master local branch remote branch establishment track

 

After the association is established, the local ktuikitPush to remote warehouseNote: the pods and podfile.lock files must be ignored during the push process, otherwise the pod install and pod repo push will be slow

Remote master branch add tag execute command

Git tag '0.1.0' added
git push --tags
Git tag - D 0.1.0 delete
git push origin :0.1.0

Private library Publishing

Send podspec file to remote index library and execute command to verify whether ‘ktuikit. Podspec’ is legal

Pod lib lint ktuikit.podspec — allow warnings — use libraries verify local

Issue podspec to remote index warehouse by executing command

pod repo push KTPodSpecs KTUIKit.podspec --allow-warnings --use-libraries 

When building a component, if it references another library

s.dependendy 'SDWebImage'
s.dependendy 'AFNetWorking'

Add the source of pod to the validation and push remote index library

pod lib lint KTUIKit.podspec --sources='http://47.93.191.194:9002/hongketao/QXComponentSpecs.git,https://github.com/CocoaPods/Specs.git' --allow-warnings --use-libraries 

pod repo push KTPodSpecs KTUIKit.podspec --sources='http://47.93.191.194:9002/hongketao/QXComponentSpecs.git,https://github.com/CocoaPods/Specs.git' --allow-warnings --use-libraries 

 

Private library use

New project, apply private library

The writing method of podspec

~>1.2.0 requires that version [1.2.0, 2.0.0) < 1.2.0 is less than or equal to 1.2.0 and will not be updated after exceeding 1.2.0

Specifies the writing method of the local path of the three-party Library (for testing before submission)

pod ‘AFNetworking’, :path => ‘~/Desktop/AFNetworking’

Specify git writing

pod ‘AFNetworking’, :git => ‘https://github.com/AFNetworking/AFNetworking.git’

pod ‘AFNetworking’, :git => ‘https://github.com/AFNetworking/AFNetworking.git’, :branch => ‘dev’

pod ‘AFNetworking’, :git => ‘https://github.com/AFNetworking/AFNetworking.git’, :tag => ‘3.1.1’

pod ‘AFNetworking’, :git => ‘https://github.com/AFNetworking/AFNetworking.git’, :commit => ‘0f506b1c45’

Specifying how to write podspec

pod ‘AFNetworking’, :podspec => ‘~/Desktop/AFNetworking/AFNetworking.podspec’

Specifies how subspecs are written (another use of subspecs

pod ‘MyThirdparty’, ‘~> 0.0.1’, :subspecs => [‘Sparta’, ‘GotyeSDK’, ‘TalkingData’, ‘Tingyun’, ‘BaiduPanorama’]

 
 

,

Remote index library

Associate remote index library add to local

Pod repo view local associated warehouse source
Pod repo add local index library name remote index library warehouse address
Pod repo update index library name
Pod repo remove local index library name

Execute the command to add a remote index library ‘ktpodspecs’ and clone it to the local

Remote library

New frame project ktuikit

Using template to generate private library project automatically

Pod lib create framework name pod lib create ktuikit

Generated engineering dependencies

The path of the podfile configuration spec of the sample project of ktuikit is relative to the path of the local podfile

Write podspec

Relying on third-party libraries

Framework wirks: dynamic libraries that depend on the system, such as uikitvended_framework: dynamic libraries that depend on the non system, such as Tencent openapi.framework libraries: static libraries that depend on the system, such as libstdc + +. Defended_libraries: static libraries that depend on the non system, such as libweibosdk.adependency of sina Weibo: pod Libraries that depend on the system

Upload framework to remote warehouse

New remote warehouse

Enter the local ktuikit directory and execute the GIT command to establish an association with the remote ktuikit

Git remote add origin https://github.com/coderketao/ktuikit.git gitgit branch -- set upstream to = origin / Master Master local branch remote branch establishment track

 

After the association is established, the local ktuikitPush to remote warehouseNote: the pods and podfile.lock files must be ignored during the push process, otherwise the pod install and pod repo push will be slow

Remote master branch add tag execute command

Git tag '0.1.0' added
git push --tags
Git tag - D 0.1.0 delete
git push origin :0.1.0

Private library Publishing

Send podspec file to remote index library and execute command to verify whether ‘ktuikit. Podspec’ is legal

Pod lib lint ktuikit.podspec — allow warnings — use libraries verify local

Issue podspec to remote index warehouse by executing command

pod repo push KTPodSpecs KTUIKit.podspec --allow-warnings --use-libraries 

When building a component, if it references another library

s.dependendy 'SDWebImage'
s.dependendy 'AFNetWorking'

Add the source of pod to the validation and push remote index library

pod lib lint KTUIKit.podspec --sources='http://47.93.191.194:9002/hongketao/QXComponentSpecs.git,https://github.com/CocoaPods/Specs.git' --allow-warnings --use-libraries 

pod repo push KTPodSpecs KTUIKit.podspec --sources='http://47.93.191.194:9002/hongketao/QXComponentSpecs.git,https://github.com/CocoaPods/Specs.git' --allow-warnings --use-libraries 

 

Private library use

New project, apply private library

The writing method of podspec

~>1.2.0 requires that version [1.2.0, 2.0.0) < 1.2.0 is less than or equal to 1.2.0 and will not be updated after exceeding 1.2.0

Specifies the writing method of the local path of the three-party Library (for testing before submission)

pod ‘AFNetworking’, :path => ‘~/Desktop/AFNetworking’

Specify git writing

pod ‘AFNetworking’, :git => ‘https://github.com/AFNetworking/AFNetworking.git’

pod ‘AFNetworking’, :git => ‘https://github.com/AFNetworking/AFNetworking.git’, :branch => ‘dev’

pod ‘AFNetworking’, :git => ‘https://github.com/AFNetworking/AFNetworking.git’, :tag => ‘3.1.1’

pod ‘AFNetworking’, :git => ‘https://github.com/AFNetworking/AFNetworking.git’, :commit => ‘0f506b1c45’

Specifying how to write podspec

pod ‘AFNetworking’, :podspec => ‘~/Desktop/AFNetworking/AFNetworking.podspec’

Specifies how subspecs are written (another use of subspecs

pod ‘MyThirdparty’, ‘~> 0.0.1’, :subspecs => [‘Sparta’, ‘GotyeSDK’, ‘TalkingData’, ‘Tingyun’, ‘BaiduPanorama’]

Recommended Today

Analysis of super comprehensive MySQL statement locking (Part 1)

A series of articles: Analysis of super comprehensive MySQL statement locking (Part 1) Analysis of super comprehensive MySQL statement locking (Part 2) Analysis of super comprehensive MySQL statement locking (Part 2) Preparation in advance Build a system to store heroes of the Three KingdomsheroTable: CREATE TABLE hero ( number INT, name VARCHAR(100), country varchar(100), PRIMARY […]