美文网首页
ios模块组件化-壳工程创建

ios模块组件化-壳工程创建

作者: 投资小白 | 来源:发表于2021-05-06 16:51 被阅读0次

第一步:github或者gitlab创建壳工程仓库

第二步:本地创建ios工程

1.cd 目录

2.pod init 

3.pod install

4.生成忽略配置

touch .gitignore

5.打开.gitignore

vim .gitignore

6.黏贴下面保存

# Xcode

#

# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings

xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)

*.xcscmblueprint

*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)

build/

DerivedData/

*.moved-aside

*.pbxuser

!default.pbxuser

*.mode1v3

!default.mode1v3

*.mode2v3

!default.mode2v3

*.perspectivev3

!default.perspectivev3

## Obj-C/Swift specific

*.hmap

## App packaging

*.ipa

*.dSYM.zip

*.dSYM

## Playgrounds

timeline.xctimeline

playground.xcworkspace

# Swift Package Manager

#

# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.

# Packages/

# Package.pins

# Package.resolved

# *.xcodeproj

#

# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata

# hence it is not needed unless you have added a package configuration file to your project

# .swiftpm

.build/

# CocoaPods

#

# We recommend against adding the Pods directory to your .gitignore. However

# you should judge for yourself, the pros and cons are mentioned at:

# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control

#

Pods/

#

# Add this line if you want to avoid checking in source code from the Xcode workspace

# *.xcworkspace

# Carthage

#

# Add this line if you want to avoid checking in source code from Carthage dependencies.

# Carthage/Checkouts

Carthage/Build/

# Accio dependency management

Dependencies/

.accio/

# fastlane

#

# It is recommended to not store the screenshots in the git repo.

# Instead, use fastlane to re-generate the screenshots whenever they are needed.

# For more information about the recommended setup visit:

# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml

fastlane/Preview.html

fastlane/screenshots/**/*.png

fastlane/test_output

# Code Injection

#

# After new code Injection tools there's a generated folder /iOSInjectionProject

# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

7.配置 README.MD

touch README.MD

8.打开README.MD

vim README.MD

添加以下保存

```bash

git clone --recursive 壳工程仓库git地址

cd 目录

pod install

```

### 添加 submodule 方法

#### 手动导入

1. 执行 `git submodule add [submodule url] submodules/[submodule dir name]` , >其中的`[submodule url]`不能为空的项目

2. 在 `Podfile` 中添加新的 submodule 的依赖

3. `pod install`

#### 脚本导入

1. 在 `ProjConfig.json` 文件中按照之前格式添加子模块

2. 在 `Podfile` 中添加新的 submodule 的依赖

3. 安装脚本工具`xyscript`,并执行在工程路径下执行拉取子模块命令`xyscript pullsubmodule`

// 子模块配置文件

touch ProjConfig.json

打开 ProjConfig.json 文件添加

[

  {

    "module":"子模块本地路径",

    "branch":"子模块分支名"

  }

]

9.git init 

10.git remote add origin 壳工程仓库 git 地址 

11.git add . 

12.git commit -m "Initial commit" 

13.git push -u origin master(远程分支名)

第三步:拉取壳工程

```bash

git clone --recursive  壳工程仓库 git 地址 

cd 目录

pod install

```

### 添加 submodule 方法

#### 手动导入

1. 执行 `git submodule add [submodule url] submodules/[submodule dir name]` , 其中的`[submodule url]`不能为空的项目

2. 在 `Podfile` 中添加新的 submodule 的依赖

3. `pod install`

#### 脚本导入

1. 在 `ProjConfig.json` 文件中按照之前格式添加子模块

2. 在 `Podfile` 中添加新的 submodule 的依赖

3. 安装脚本工具`xyscript`,并执行在工程路径下执行拉取子模块命令`xyscript pullsubmodule`

//子模块配置文件 touch ProjConfig.json

打开 ProjConfig.json 文件添加 [

{

"module":" 子模块本地路径", 

"branch":"子模块分支名"

}

]

相关文章

  • 组件化

    组件化 1.如何实现组件化1)首先创建壳工程。2)在壳工程内集成不同的功能模块以及业务模块。3)使用cocoapo...

  • ios模块组件化-壳工程创建

    第一步:github或者gitlab创建壳工程仓库 第二步:本地创建ios工程 1.cd目录 2.pod init...

  • iOS组件化--壳工程

    新建工程LZDemo作为壳工程 1、添加Podfile文件cd到你刚创建的工程目录下,执行以下语句 然后会发现你的...

  • iOS组件化储备

    资料 组件化/模块化 蜂鸟商家版 iOS 组件化 / 模块化实践总结 模块化与解耦 浅析 iOS 应用组件化设计 ...

  • 【Android组件化】app壳工程

    组件化中需要一个app壳工程,这个壳工程中不处理任何业务,就只是一个空壳,由它将所需要的各个组件模块组合起来,构成...

  • 蜂鸟商家版 iOS 组件化 / 模块化实践总结

    蜂鸟商家版 iOS 组件化 / 模块化实践总结 蜂鸟商家版 iOS 组件化 / 模块化实践总结

  • WorkSpace创建

    Xcode创建子工程以及工程依赖iOS 使用.xcworkspace文件管理代码和工程依赖(实现项目模块化)

  • 掌上链家iOS组件化(总结)

    掌上链家iOS组件化 组件化目标 我们组件化的目标就是每一个组件都是一个私有的仓库,都是一个pod,壳工程用的时候...

  • iOS组件化

    参考iOS组件化[https://www.jianshu.com/p/c91f8214ecc8] 一、新建壳工程 ...

  • iOS 组件化 - 工程创建

    引言 大家都知道,一个普通的工程创建 打开xcode commod + shift + N 快捷键。 创建一个co...

网友评论

      本文标题:ios模块组件化-壳工程创建

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