CocoaPods 创建私有库管理包
来源:互联网 发布:涂师傅数据恢复能用吗 编辑:程序博客网 时间:2024/04/29 08:34
参考:私有库创建 : http://www.cocoachina.com/ios/20150930/13471.html
1、pod lib create LSLog 创建需要打包成库的项目
此过程会问5个问题:
然后生成如图工作空间目录:
MyLog下的MyLog 是存放地址源文件的,里面有Asset ,Classes两个文件夹。分别存放图片和源码文件。
2、cd LSLog 目录下,添加远程仓库。
git remote add origin http://192.168.2.250:8080/scm/git/MyLog
编辑LSLog.podspec 文件。 格式如下:
Pod::Spec.new do |s|
s.name = "MyLog"
s.version = "0.1.0"
s.summary = " MyLog Log what you input."
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = "http://192.168.2.250:8080/scm/git/MyLog"
s.license = 'MIT'
s.author = { "luosai" => "luosai19910103@163.com" }
s.source = { :git => "http://192.168.2.250:8080/scm/git/MyLog", :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.source_files = 'MyLog/Classes/**/*'
s.resource_bundles = {
'MyLog' => ['MyLog/Assets/*.png']
}
s.public_header_files = 'MyLog/Classes/**/*.h'
end
#import "MyLog.h"
@implementation MyLog
+(void)Log:(NSString *)str{
NSLog(@"恭喜你成功了!!%@",str);
}
@end
5、pod lib lint 检查是否可用
git add .
git commit -m’init'
git push origin master 推送到远程仓库
git tag 0.1.0 打tag .
git push —tags 将tag推送到远程仓库
7、创建本地pod repo 仓库(Mylog)并添加远程仓库
pod repo add Mylog 'http://luosai@192.168.2.250:8080/scm/git/MyLogSpec'
此过程会在~/.cocoaPod/repos/ 下创建一个本地 MyLog 仓库
8 、将本地MyLog.podspec 添加到本地 pod repo 仓库并推送到远程仓库
pod repo push Mylog MyLog.podspec .
9、 创建新项目进行测试
cd 到 项目根目录:pod init
vi Podfile
source 'http://luosai@192.168.2.250:8080/scm/git/MyLogSpec'
target 'TestMyLog'do
pod 'MyLog','~>0.1.0'
end
target 'TestMyLogTests'do
end
target 'TestMyLogUITests'do
end
添加头文件 并使用
#import "MyLog.h"
#import "ViewController.h"
#import "MyLog.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[superviewDidLoad];
[MyLogLog:@"中奖一百万"];
}
@end
运行项目:打印结果
2016-05-09 10:06:50.536 TestMyLog[1779:43808] 恭喜你成功了!!中奖一百万
大功告成。
- CocoaPods 创建私有库管理包
- cocoapods管理私有库
- 创建私有Cocoapods库
- Cocoapods创建私有库
- Cocoapods 创建私有库
- 使用Cocoapods创建私有库
- CocoaPods创建私有库步骤
- CocoaPods私有库创建遇到的问题
- cocoapods创建Swift私有库(笔记)
- CocoaPods 快速创建私有类库指南
- iOS创建本地私有CocoaPods库
- 【iOS】简述CocoaPods私有库创建流程
- CocoaPods创建私有Pod库方法总结
- CocoaPods创建私有podspec
- Cocoapods私有仓库创建
- 创建私有 CocoaPods 仓库
- 使用CocoaPods创建私有Spec Repo管理项目公共组件
- 使用Cocoapods创建私有podspec
- java学习笔记(十三)
- HTML&CSS——琐碎的知识点(2)
- shell脚本自动化部署-如何向expect脚本里面传递参数
- 21.[Leetcode]Merge Two Sorted Lists
- NYOJ 动态规划 36题 最长公共子序列
- CocoaPods 创建私有库管理包
- 判断两个数是否符号相反----位运算
- Android学习之界面篇(八)在项目中使用Action Bar
- 第十周项目二 点-圆-圆柱类族的设计
- 开发中问题解决
- SSH关于公钥认证Permission denied (publickey,gssapi-with-mic的问题
- 关于使用iMAG.js出现的问题及解决方法
- MySQLAdministrator5.0配置文件位置
- 练习打字第三天!