github 創(chuàng)建倉(cāng)庫(kù)
new 一個(gè) repository
創(chuàng)建倉(cāng)庫(kù)
clone 到本地 并初始化工程
創(chuàng)建.podspec
文件
$pod spec create 工程名
創(chuàng)建.podspec文件
文本編輯打開.podspec
文件
Pod::Spec.new do |s|
s.name = "RJMyPod"
s.version = "0.0.1"
s.summary = "A iOS Fast integration of custom classifications, macro definitions and tool classes"
s.homepage = "https://github.com/Jack424/RJMyPod.git"
s.license = "MIT"
s.author = { "Jack_Gu" => "gu_ruijie@163.com" }
s.platform = :ios, "9.0"
s.source = { :git => "https://github.com/Jack424/RJMyPod.git", :tag => s.version}
s.source_files = "RJMyPod/RJMyPod/MyPod/*.{h,m}"
s.requires_arc = true
s.resources = "RJCategoryTool/RJCategoryTool/RJCategoryTool/Resource/*.{png,xib,nib,bundle,json}"
end
s.dependency 'Masonry'
# s.resources = 'PhotoBrowser/resource/*.{png,xib,nib,bundle}'
# s.frameworks = 'UIKit','Photos','PhotosUI'
# s.dependency 'UMengUShare/Social/ReducedWeChat', '~> 6.4.8.2'
end
s.name :工程名
s.version :版本號(hào)
s.summary :簡(jiǎn)介概述
s.homepage :github項(xiàng)目網(wǎng)頁(yè)
s.license :授權(quán)許可文件
s.author :代碼作者
s.platform :支持最低的版本號(hào)
s.source :git代碼下載地址
s.source_files :胎源!重要 唯欣! 你要傳到cocoapods的文件內(nèi)容
s.resources :資源文件余蟹,沒有可忽略
s.requires_arc :是否是ARC
注意:s.source_files 下層級(jí)目錄一定是podspec所在層級(jí)的文件名開始到你要上傳的文件目錄為止 *.{h,m} 表示匹配所有以.h和.m結(jié)尾的文件 ** 表示匹配所有子目錄 若所上傳文件夾有子級(jí)文件則在文件名后追加 **/*.{h,m}
解決[-Werror,-Wnon-modular-include-in-framework-module]錯(cuò)誤, .h文件中引用第三方庫(kù) #import <Masonry/Masonry.h>,使用尖括號(hào)引用
上傳過程中遇到問題就細(xì)心檢查一下
$ git add --all
$ git commit -m "操作內(nèi)容"
$ git tag "0.0.1"
$ git push --tags
$ git push origin master
驗(yàn)證上傳是否合法
$ pod spec lint --allow-warnings
-> RJMyPod (0.0.1)
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
- NOTE | [iOS] xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
Analyzed 1 podspec.
RJMyPod.podspec passed validation.
出現(xiàn)成功提示后就trunk上傳扁藕,如果沒有沒有注冊(cè)過需要首次注冊(cè)
$ pod trunk register 郵箱 '用戶名' --description='描述一下下'
郵箱及用戶名以你GitHub的為準(zhǔn)
提交指令后需要去郵箱驗(yàn)證,點(diǎn)擊或復(fù)制郵箱郵件內(nèi)的鏈接會(huì)顯示
郵件內(nèi)容
自我驗(yàn)證
$ pod trunk me
- Name: Jack424
- Email: gu_ruijie@163.com
- Since: September 18th, 2017 21:46
- Pods:
- GRJKit
- GRJMITKit
- RJCategoryTool
- Sessions:
- September 18th, 2017 21:46 - January 25th, 2018 01:13. IP: 120.236.169.38
Description: macbook pro
- February 14th, 20:57 - June 23rd, 05:36. IP: 27.115.4.10
Description: 描述一下下
- 報(bào)錯(cuò)及解決
$ pod trunk me
[!] Authentication token is invalid or unverified. Either verify it with the email that was sent or register a new session.
$ pod trunk register 'gu_ruijie@163.com' 'Jack424' --description='mac pro'
// 然后去郵箱操作一下即可
/*
Please confirm your CocoaPods session by clicking the following link:
https://trunk.cocoapods.org/sessions/verify/**************
If you did not request this you do not need to take any further action.
*/
提交
$ pod trunk push --allow-warnings
上傳pod成功
使用一下
pod 'RJMyPod'
$ pod install
試一試
如果報(bào)錯(cuò):- ERROR | [iOS] unknown: Encountered an unknown error (Malformed version number string ) during validation.
$ sudo gem install -n /usr/local/bin cocoapods
Password:
Fetching: cocoapods-core-1.7.1.gem (100%)
Successfully installed cocoapods-core-1.7.1
Fetching: cocoapods-deintegrate-1.0.4.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.4
Fetching: xcodeproj-1.9.0.gem (100%)
Successfully installed xcodeproj-1.9.0
Fetching: fourflusher-2.3.0.gem (100%)
Successfully installed fourflusher-2.3.0
... ...
ZLPhotoBrowser 使用 SDWebImage 報(bào)錯(cuò)
打印錯(cuò)誤信息
pod spec lint RJCategoryTool.podspec --verbose
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
- ERROR | [iOS] xcodebuild: ZLPhotoBrowser/ZLPhotoBrowser/PhotoBrowser/ZLBigImageCell.m:504:77: error: use of undeclared identifier 'SDWebImageProgressiveDownload'; did you mean 'SDWebImageProgressiveLoad'?
- NOTE | [iOS] xcodebuild: SDWebImage/SDWebImage/Core/SDWebImageDefine.h:69:5: note: 'SDWebImageProgressiveLoad' declared here
[!] The spec did not pass validation, due to 2 errors.
ZLPhotoBrowser更新日志
3.0.3: 依賴庫(kù)SDWebImage升級(jí)為5.0.2以上
● 3.0.6: 添加選中圖片顯示index功能; 新增(及修改)部分顏色api摹察,方便修改框架內(nèi)部顏色; 修改框架默認(rèn)風(fēng)格為微信的風(fēng)格; 壓縮圖片資源;
● 3.0.5: 預(yù)覽快速選擇界面文字顏色支持自定義; 編輯界面按鈕增大; 解決錄制視頻超過10s沒有聲音的bug;
● 3.0.4: 添加視頻選擇最大最小個(gè)數(shù)限制; 解決網(wǎng)絡(luò)gif圖片無法播放的bug; fix已知bug;
● 3.0.3: 依賴庫(kù)SDWebImage升級(jí)為5.0.2以上; 解決圖片瀏覽器關(guān)閉時(shí)取消所有sd圖片請(qǐng)求的bug; 支持直接調(diào)用相機(jī);
● 3.0.0: 壓縮bundle內(nèi)圖片; 支持直接選擇iCloud照片豁生,并添加解析圖片超時(shí)時(shí)間屬性;
● 3.0.0: 支持carthage; 去除GPUImage濾鏡;
● 2.7.8: 添加iCloud圖片加載進(jìn)度條,支持iCloud視頻播放;
● 2.7.6: 預(yù)覽大圖界面支持precent情況下的下拉返回;
● 2.7.5: 編輯圖片支持自定義工具類型; bug fixed;
● 2.7.4: 橫滑大圖界面添加下拉返回; 不允許錄制視頻時(shí)候不請(qǐng)求麥克風(fēng)權(quán)限;
● 2.7.1: 支持自定義導(dǎo)航返回按鈕圖片;
● 2.7.0: 圖片資源加上前綴咖楣,解決9.0無法選擇圖片問題;
● 2.6.9: 重構(gòu)編輯圖片功能,添加濾鏡;
● 2.6.7: 優(yōu)化視頻編輯界面芦昔,極大減少進(jìn)入時(shí)的等待時(shí)間;
● 2.6.6: Fix #216; 新增隱藏裁剪圖片界面比例工具條功能;
● 2.6.5: 新增隱藏"已隱藏"照片及相冊(cè)的功能; Fix #221, 優(yōu)化預(yù)覽網(wǎng)絡(luò)圖片/視頻時(shí)根據(jù)url后綴判斷的類型方式;
報(bào)錯(cuò)
[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
$ pod update
Update all pods
Updating local specs repositories
[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
$ pod repo update master --verbose
Updating spec repo `master`
$ /usr/bin/git -C /Users/jintian/.cocoapods/repos/master fetch origin --progress
remote: Enumerating objects: 12756, done.
remote: Counting objects: 100% (12756/12756), done.
remote: Compressing objects: 100% (440/440), done.
remote: Total 33049 (delta 12458), reused 12299 (delta 12299), pack-reused 20293
Receiving objects: 100% (33049/33049), 3.68 MiB | 85.00 KiB/s, done.
Resolving deltas: 100% (22711/22711), completed with 3716 local objects.
From https://github.com/CocoaPods/Specs
279b00360ea..4826f4cad15 master -> origin/master
$ /usr/bin/git -C /Users/jintian/.cocoapods/repos/master rev-parse --abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/jintian/.cocoapods/repos/master reset --hard origin/master
Checking out files: 100% (3441/3441), done.
HEAD is now at 4826f4cad15 [Add] QBRouter 0.0.5
$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing AFNetworking 4.0.1 (was 3.2.1 and source changed to `https://github.com/CocoaPods/Specs.git` from `trunk`)
Installing AlipaySDK-iOS 15.7.4 (was 15.6.8 and source changed to `https://github.com/CocoaPods/Specs.git` from `trunk`)
Installing MBProgressHUD 1.2.0 (was 1.1.0 and source changed to `https://github.com/CocoaPods/Specs.git` from `trunk`)
Installing MJRefresh 3.4.1 (was 3.2.2 and source changed to `https://github.com/CocoaPods/Specs.git` from `trunk`)
Installing WechatOpenSDK 1.8.7.1 (was 1.8.6 and source changed to `https://github.com/CocoaPods/Specs.git` from `trunk`)
Generating Pods project
Integrating client project
Pod installation complete! There are 17 dependencies from the Podfile and 17 total pods installed.
[!] Automatically assigning platform `iOS` with version `10.0` on target `RJCategoryTool` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
[!] CDN: trunk URL couldn't be downloaded:
$ pod search AFNetworking
[!] CDN: trunk Repo update failed - 2 error(s):
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/a/7/5/AFNetworking/4.0.0/AFNetworking.podspec.json Response: Couldn't connect to server
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/a/7/5/AFNetworking/4.0.1/AFNetworking.podspec.json Response: Couldn't connect to server
$ pod repo remove trunk
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use
--verbosefor more information.
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
...
[!] The spec did not pass validation, due to 1 error.
$ pod spec lint RJCategoryTool.podspec --verbose //打印錯(cuò)誤信息
ERROR | [iOS] unknown: Encountered an unknown error (/usr/bin/xcrun simctl list -j devices
$ pod trunk push --allow-warnings
$ pod trunk push --allow-warnings --use-libraries
Updating spec repo `master`
CocoaPods 1.8.0 is available.
To update use: `sudo gem install cocoapods`
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.8.0
Validating podspec
-> RJCategoryTool (0.5.5)
- ERROR | [iOS] unknown: Encountered an unknown error (/usr/bin/xcrun simctl list -j devices
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
) during validation.
[!] The spec did not pass validation, due to 1 error.
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Password:
$ pod trunk push RJCategoryTool.podspec --allow-warnings --use-libraries
Updating spec repo `master`
CocoaPods 1.8.0 is available.
To update use: `sudo gem install cocoapods`
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.8.0
Validating podspec
-> RJCategoryTool (0.5.5)
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
...
...
Updating spec repo `master`
CocoaPods 1.8.0 is available.
To update use: `sudo gem install cocoapods`
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.8.0
--------------------------------------------------------------------------------
?? Congrats
?? RJCategoryTool (0.5.5) successfully published
?? September 27th, 04:59
?? https://cocoapods.org/pods/RJCategoryTool
?? Tell your friends!
--------------------------------------------------------------------------------