fastlane-plugin-fastci 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8e578e3c451bc288f338c816bf12606c4a2029ff4cdc77c3489950e1bb5e3d5
4
- data.tar.gz: 194ee9f107f474ba5713ac7640929fe981a12cc4f8cbbbbc75018e4afe83fb3e
3
+ metadata.gz: 412038fd44bc6d55aa20d9be09dd4501bef38e2050066ab808e8d88dc60994e7
4
+ data.tar.gz: d6535653192f7f5b4aa0ef9a6126b6df85fb50fb1036daa686920b168f070652
5
5
  SHA512:
6
- metadata.gz: 6eb4857f9e13960b13383e52516045bb6f73db9625e419e56279cbbb0e7be4be384c70bc81378cb4c2f13b9485781074c8e27f301f720675a85e39925c14fc09
7
- data.tar.gz: 490f206f40a2ebaf94b80cab887d1c12d6a229640577c7aa2605c57c4c4969ff2e7e950dd0291e063ecd3968af1d04d34be0f83e35287f5c23b1836883992d7b
6
+ metadata.gz: 3cb86329414a976f10e924e55f1961462e1e2342b904ecaad5a1ac60ea09b3bd285c81689f0babcbab24a0ce82eaad09f65cf4d7b0247ff0f7a1d3648e2f5b43
7
+ data.tar.gz: 0fc6b479c8b969597e8354a3a20360150935a53581668e72cc34db2311567fec50f0ec86e4664bb41e449c6dbcb1599fce34a044d6caf7e32bf5142a69463fee
data/README.md CHANGED
@@ -1,23 +1,118 @@
1
- # fastci plugin
2
1
 
3
- [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-ld)
2
+ # fastlane-plugin-fastci
4
3
 
5
- ## Getting Started
4
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-fastci)
6
5
 
7
- This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-ld`, add it to your project by running:
6
+ 一个集成 iOS CI 与多种自动化操作的 Fastlane 集合插件。
7
+ 简单快速的集成,5 分钟即可上手。
8
+ 配合 Jenkins 实现高度自定义。
8
9
 
9
- ```bash
10
- fastlane add_plugin fastci
10
+ 目前还在 Beta 测试阶段!!!
11
+
12
+ ---
13
+
14
+ ## 安装方法
15
+
16
+ 1、安装 [python3](https://www.python.org/downloads/macos/)
17
+
18
+ 2、安装 [homebrew](https://brew.sh/)
19
+
20
+ 3、安装并初始化 [fastlane](https://docs.fastlane.tools/getting-started/ios/setup/)
21
+
22
+ 4、添加插件 ` fastlane add_plugin fastci `
23
+
24
+ 5、更新插件 ` fastlane update_plugins `
25
+
26
+ ---
27
+
28
+ ## 使用方法
29
+
30
+ 参考 [` Fastfile `](fastlane/Fastfile) 和 [` .env.default `](fastlane/.env.default) 替换项目内 fastlane 文件夹下文件。
31
+ 然后终端进入项目根目录就可以使用 ` fastlane `
32
+
33
+
34
+ ### 使用后会在项目根目录生成文件夹
35
+
36
+ 可以自行在 ` .gitignore ` 中设置忽略等级
37
+
38
+ ```
39
+ fastlane_cache/ # 插件缓存文件夹
40
+ ├── build_logs/ # 编译日志
41
+ ├── html/ # 各种检查报告
42
+ ├── temp/ # 临时文件
43
+ ├── build_cache.txt # build 自动递增缓存
44
+ └── commit_cache.txt # git commit 缓存
45
+ ```
46
+
47
+ ## 支持功能与使用示例
48
+
49
+ ### 1. 自动打包
50
+ 功能:自动编译并导出 ipa 包,支持多种打包方式和集成多项检查。
51
+ 生成完的 ipa 会放在桌面上,非 ` app-store ` 配置了蒲公英参数会自动上传蒲公英,` app-store ` 配置了商店参数会自动上传商店。
52
+
53
+ ` build `: 不指定的话内部有递增逻辑,格式为 ` 20250905.15(日期+当天包的次数) `
54
+
55
+ ` version `: 在 Xcode13 之后创建的项目,不再支持脚本修改。需要兼容请在 ` Build settings ` 中将 ` GENERATE_INFOPLIST_FILE ` 设置为 ` NO `
56
+
57
+ ```ruby
58
+ package(
59
+ configuration: "Debug", # 编译环境 Release/Debug
60
+ export_method: "development", # 打包方式 ad-hoc, enterprise, app-store, development
61
+ version: nil, # 指定 version
62
+ build: nil, # 指定 build 号
63
+ is_analyze_swiftlint: false, # 是否代码分析
64
+ is_detect_duplicity_code: false, # 是否检测重复代码
65
+ is_detect_unused_code: false, # 是否检测未使用代码
66
+ is_detect_unused_image: false # 是否检测未使用图片
67
+ )
68
+ ```
69
+
70
+ ### 2. SwiftLint 静态代码分析
71
+ 功能:依赖 ` SwiftLint ` 对项目代码进行静态分析,生成分析报告。
72
+ 使用前需要参考自定义 [` .swiftlint.yml `](/.swiftlint.yml) 文件,并将该文件放到项目根目录。
73
+
74
+ ` commit_hash `: 上一次提交哈希, 会比较该哈希到最新哈希之间的文件
75
+
76
+ ```ruby
77
+ analyze_swiftlint(
78
+ is_all: true, # 是否检查所有文件,默认 true
79
+ configuration: "Debug", # 构建配置,Debug/Release
80
+ commit_hash: nil # 指定 commit hash,仅检查变更文件
81
+ )
82
+ ```
83
+
84
+ ### 3. 检测重复代码
85
+ 功能:检测项目中的重复代码,生成分析报告。
86
+ 使用前需要参考自定义 [` .periphery.yml `](/.periphery.yml) 文件,并将该文件放到项目根目录。
87
+
88
+ ` commit_hash `: 上一次提交哈希, 会比较该哈希到最新哈希之间的文件
89
+
90
+ ```ruby
91
+ detect_duplicity_code(
92
+ is_all: true, # 是否检查所有文件,默认 true
93
+ commit_hash: nil # 指定 commit hash,仅检查变更文件
94
+ )
11
95
  ```
12
96
 
13
- ## About fastci
97
+ ### 4. 检测未使用代码
98
+ 功能:检测项目中未被使用的代码,生成分析报告。
99
+ 默认只支持 ` Debug `,需要支持 ` Release ` 请在 ` Build settings ` 中将 ` Enable Index-While-Building Functionality ` 设置为 ` Yes `。
100
+
101
+ ```ruby
102
+ detect_unused_code(
103
+ configuration: "Debug" # 构建配置,Debug/Release
104
+ )
105
+ ```
14
106
 
15
- 这个插件集成了打包、上传 appstore、上传蒲公英、钉钉通知、无用图片检测、无用代码检测、重复代码检测、swiftlint 代码检测
107
+ ### 5. 检测未使用图片资源
108
+ 功能:检测项目中未被使用的图片资源,生成分析报告。
16
109
 
17
- ## Example
110
+ ```ruby
111
+ detect_unused_image()
112
+ ```
18
113
 
19
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
114
+ ---
20
115
 
21
- ## About _fastlane_
116
+ ## 贡献与支持
22
117
 
23
- _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
118
+ 如需更多帮助或贡献,请提交 Issue PR。
@@ -8,9 +8,9 @@ module Fastlane
8
8
  def self.run(params)
9
9
  UI.message("*************| 开始安装 p12 证书 |*************")
10
10
 
11
- certificate_paths = Dir.glob("../#{Environment.certificate_folder_name}/*.p12")
11
+ certificate_paths = Dir.glob(File.expand_path("#{Environment.certificate_folder_name}/*.p12"))
12
12
  certificate_paths.each do |path|
13
- import_certificate(
13
+ other_action.import_certificate(
14
14
  certificate_path: File.expand_path(path),
15
15
  certificate_password: "#{Environment.certificate_password}",
16
16
  keychain_name: "login.keychain",
@@ -7,10 +7,10 @@ module Fastlane
7
7
  class InstallProfileAction < Action
8
8
  def self.run(params)
9
9
  UI.message("*************| 开始安装 provisioningProfile |*************")
10
-
11
- provisioning_profile_paths = Dir.glob("../#{Environment.provisioningProfile_folder_name}/*.mobileprovision")
10
+
11
+ provisioning_profile_paths = Dir.glob(File.expand_path("#{Environment.provisioningProfile_folder_name}/*.mobileprovision"))
12
12
  provisioning_profile_paths.each do |path|
13
- install_provisioning_profile(
13
+ other_action.install_provisioning_profile(
14
14
  path: File.expand_path(path)
15
15
  )
16
16
  end
@@ -182,7 +182,7 @@ module Fastlane
182
182
  UI.message("*************| 跳过未使用图片检查 |*************")
183
183
  end
184
184
 
185
- if is_swiftlint ||
185
+ if is_analyze_swiftlint ||
186
186
  is_detect_duplicity_code ||
187
187
  is_detect_unused_code ||
188
188
  is_detect_unused_image
@@ -41,7 +41,7 @@ module Fastlane
41
41
  "fastlane_cache/build_logs"
42
42
  end
43
43
  def self.IPA_OUTPUT_DIR
44
- "fastlane_cache/build_products"
44
+ "fastlane_cache/temp"
45
45
  end
46
46
  end
47
47
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Fastci
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-fastci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - watermelon