Flutter混合⼯程CI⾃动化使⽤流程

接上一篇CI配置好后,怎样使用CI和Flutter模块引入iOS工程。

⼀、新建Flutter编译产物仓库地址
用于flutter编译好的framework上传地址

⼆、修改脚本⽂件
PROJECT_NAME:项⽬中⽂名
FLTTER_MODULE_PATH:flutter源码⽂件夹名
SPEC_NAME:SPEC⽂件名和步骤⼀中project名称⼀致

三、上传脚本⽂件
flutter源码仓库上传脚本⽂件

四、flutter代码仓库CI配置
1、打开lutter项⽬源码地址⾸⻚,点击Set up CI会⽣成gitlab-ci.yml⽂件,
2、编辑CI⽂件
3、提交⾃动执⾏CI

五、主⼯程引⼊
podfile引⼊flutter模块,只需要修改FLUTTER_FRAMEWORK_SPEC为对应的spec名,每次更新需要commitId修改
⼀下。
FLUTTER_FRAMEWORK_SPEC : 对应的spec名
FLUTTER_FRAMEWORK_COMMITID : 提交记录commitId
FLUTTER_FRAMEWORK_URL: flutter产物地址

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
inhibit_all_warnings!
use_frameworks! :linkage => :static
use_modular_headers!
#flutter编译产物的spec名称
FLUTTER_FRAMEWORK_SPEC = 'xxxx'
#flutter编译产物 commitId
FLUTTER_FRAMEWORK_COMMITID = 'xxxx'
FLUTTER_FRAMEWORK_URL = 'xxx'
def flutterModulePod(evnir)
 pod 'Flutter', :git => FLUTTER_FRAMEWORK_URL,:commit => FLUTTER_FRAMEWORK_COMMITID
 pod FLUTTER_FRAMEWORK_SPEC, :git => FLUTTER_FRAMEWORK_URL,:commit =>
FLUTTER_FRAMEWORK_COMMITID,:subspecs => [evnir]
end
target "TestCI" do
 flutterModulePod("Release")
end
posted @ 2022-11-29 16:37  JustToGo  阅读(51)  评论(0编辑  收藏  举报