美文网首页
组件化3-创建远程索引库和私有库

组件化3-创建远程索引库和私有库

作者: AlanGe | 来源:发表于2020-11-14 08:58 被阅读0次

一、在码云上创建远程私有索引库

1、新建创库

2、填写相关信息

3、打开终端,将远程私有库关联到本地

pod repo add + 索引库名称 + 远程索引库地址
pod repo add alangeitSpec https://gitee.com/alangeit/alangeit-spec.git

如果没有权限,请配置码云的ssh公钥

4、查看是否成功关联到本地

或者终端输入:pod repo


二、创建本地私有库

1、在本地创建一个文件夹:AlanGeLib

2、打开终端,cd到AlanGeLib:

cd /Users/alange/Desktop/AlanGeLib

3、利用模板库创建私有库

pod lib create AlanGeLib

4、删除 ReplaceMe.m,将自己需要的功能添加到这里

5、cd到测试工程目录,安装添加进来的内容

cd /Users/alange/Desktop/AlanGeLib/AlanGeLib/Example

pod install

这个只是创建了本地索引库

三、 创建远程代码库

1、新建一个远程AlanGeLib库

2、填写信息,并选择“导入已有创库”,点击创建

3、将本地私有库推送到远程私有库

cd到AlanGeLib(Example工程的上一层目录)

cd /Users/alange/Desktop/AlanGeLib/AlanGeLib
git add .
git commit --m "创建测试工程"

// 推送代码到远程仓库
git remote add origin git@gitee.com:alangeit/alan-ge-lib.git

git push -u origin master

// 打tag 
git tag '0.1.0'
git push --tags

提交成功,刷新码云创库

4、配置.podspec文件

 // 创库地址,没有“ /ge-categoryi-os.git”这后一段
s.homepage        = 'https://gitee.com/alangeit’     
//  完整代码下载地址
s.source          = { :git => 'https://gitee.com/alangeit/ge-categoryi-os.git', :tag => s.version.to_s }   

5、检查配置是否成功

检查本地:pod lib lint

 -> AlanGeLib (0.1.0)

    - NOTE  | xcodebuild:  note: Using new build system

    - NOTE  | xcodebuild:  note: Building targets in parallel

    - NOTE  | xcodebuild:  note: Using codesigning identity override: -

    - NOTE  | [iOS] xcodebuild:  note: Planning build

    - NOTE  | [iOS] xcodebuild:  note: Constructing build description

    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99\. (in target 'Pods-App' from project 'Pods')

    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99\. (in target 'App' from project 'App')

    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')

    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99\. (in target 'AlanGeLib' from project 'Pods')

AlanGeLib passed validation.

AlanGeLib passed validation. 表示成功

远程:pod spec lint

 -> AlanGeLib (0.1.0)

    - NOTE  | xcodebuild:  note: Using new build system

    - NOTE  | xcodebuild:  note: Building targets in parallel

    - NOTE  | xcodebuild:  note: Using codesigning identity override: -

    - NOTE  | [iOS] xcodebuild:  note: Planning build

    - NOTE  | [iOS] xcodebuild:  note: Constructing build description

    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99\. (in target 'App' from project 'App')

    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')

    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99\. (in target 'Pods-App' from project 'Pods')

    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99\. (in target 'AlanGeLib' from project 'Pods')

Analyzed 1 podspec.

AlanGeLib.podspec passed validation.

AlanGeLib.podspec passed validation. 表示成功

6、把本地索引库提交到远程索引库

cd到库的测试工程目录(Example的上一层):

cd /Users/alange/Desktop/AlanGeLib/AlanGeLib

将AlanGeLib.podspec索引库推送到远程:

pod repo push alangeitSpec AlanGeLib.podspec
Validating spec

 -> AlanGeLib (0.1.0)

    - NOTE  | xcodebuild:  note: Using new build system

    - NOTE  | xcodebuild:  note: Building targets in parallel

    - NOTE  | xcodebuild:  note: Using codesigning identity override: -

    - NOTE  | [iOS] xcodebuild:  note: Planning build

    - NOTE  | [iOS] xcodebuild:  note: Constructing build description

    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99\. (in target 'AlanGeLib' from project 'Pods')

    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99\. (in target 'Pods-App' from project 'Pods')

    - NOTE  | [iOS] xcodebuild:  warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99\. (in target 'App' from project 'App')

    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')

Updating the `alangeitSpec' repo

Adding the spec to the `alangeitSpec' repo

 - [Add] AlanGeLib (0.1.0)

Pushing the `alangeitSpec' repo

如上表示成功

7、检查库是否制作成功

pod search AlanGeLib
-> AlanGeLib (0.1.0)

   AlanGeLib

   pod 'AlanGeLib', '~> 0.1.0'

   - Homepage: [https://gitee.com/alangeit](https://gitee.com/alangeit)

   - Source:   [https://gitee.com/alangeit/alan-ge-lib.git](https://gitee.com/alangeit/alan-ge-lib.git)

   - Versions: 0.1.0 [alangeitSpec repo]

四、测试

1、打开测试工程:Example的Podfile文件,

1.1、添加索引库源地址:

source 'https://gitee.com/alangeit/alangeit-spec.git'

注意:是alangeitSpec这个索引库的地址

1.2、把

pod 'AlanGeLib', :path => '../‘

改为

pod ‘AlanGeLib'

2、cd到Example目录进行安装

pod install
alange@Alan16 Example % pod install

Analyzing dependencies

Downloading dependencies

Installing AlanGeLib (0.1.0)

Generating Pods project

Integrating client project

Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

安装成功

相关文章

  • 组件化之创建私有远程库

    一.创建私有远程索引库 创建一个私有远程仓库主要的步骤如下: 创建远程索引库和私有组件库仓库 将远程索引库添加到本...

  • HCMediator组件化详解

    组件化创建流程库 组件化需要创建私有spec库(索引库)、HCMediator库(App中介库)、其他组件库 私有...

  • CocoaPod 私有库的使用方式

    创建及配置方式 到远程仓库创建工程 查看本地索引库 添加私有索引库 创建组件库 使用组件库模板创建 添加组件内容 ...

  • 组件化开发操作流程

    一、远程私有索引库创建(WeyanSpec) 1、创建远程私有索引库WeyanSpec(和创建远程工程一样),复制...

  • iOS创建私有库

    iOS创建私有库 创建本地私有库索引和远程私有库索引关联 pod repo addSGSpecshttp://12...

  • iOS组件化1 之 创建远程私有仓库

    一、创建私有索引库 二、本地添加私有索引库 三、创建组件库 四、上传组件代码 五、提交podspec到私有索引库 ...

  • 用pods管理组件(远程私有库)

    远程私有库 1. 对组件进行git管理 2. 创建自己的远程私有库的远程索引库 3. 上传代码到远程库中。 3.1...

  • iOS组件化----- 创建私有组件库

    一、远程私有索引库创建(远程仓库都是基于码云) 1、创建远程私有索引库MyLib(和创建远程工程一样),复制仓库地...

  • ios 组件化整理(在码云上操作)

    一、远程私有索引库创建 1、创建远程私有索引库(和创建远程工程一样),复制仓库地址(点击克隆/下载) 2、打开终端...

  • 组件化3-创建远程索引库和私有库

    一、在码云上创建远程私有索引库 1、新建创库 2、填写相关信息 3、打开终端,将远程私有库关联到本地 如果没有权限...

网友评论

      本文标题:组件化3-创建远程索引库和私有库

      本文链接:https://www.haomeiwen.com/subject/jtpibktx.html