cocoapods-bb-PodAssistant 0.1.8 → 0.1.9.2
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 +4 -4
- data/README.md +14 -2
- data/lib/cocoapods-bb-PodAssistant/babybus/business/babybus_install_environment.rb +9 -1
- data/lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb +12 -4
- data/lib/cocoapods-bb-PodAssistant/babybus/installer/post_install_hooks.rb +27 -17
- data/lib/cocoapods-bb-PodAssistant/config/cache_path.rb +3 -1
- data/lib/cocoapods-bb-PodAssistant/config/source_manager.rb +1 -1
- data/lib/cocoapods-bb-PodAssistant/gem_version.rb +1 -1
- data/lib/cocoapods-bb-PodAssistant/helpers/pod_utils.rb +14 -7
- data/lib/cocoapods-bb-PodAssistant/helpers/stable_env_helper.rb +2 -2
- data/lib/cocoapods-bb-PodAssistant/helpers/stable_manager_helper.rb +25 -12
- data/lib/cocoapods-bb-PodAssistant/podfile.rb +11 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32ae7a754051168b335839ef24e3241e10ae8c1ce9772b65ae1add131a591744
|
4
|
+
data.tar.gz: fabd94ec00e74cd9b40dcbbf176baca21d88e54d640ddaf82b3c085520649807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3945a8e16d272daa2b8a13e6fa412127bd055b1f85f97b6dbee51c56df0465dce8a8403d913139bb669239e1c7926341e6f8e5a7a60f619b49f614983cb1f387
|
7
|
+
data.tar.gz: 1d27d7075c0fae3e206182a07b2c061f2d1f67907083ff938084ed34d4bc4d872d19d6a55a1e09abfaaf3879b99ec47ec3fd2c101ff10e1eb617c9598ff23509
|
data/README.md
CHANGED
@@ -15,14 +15,26 @@ pod stable --help
|
|
15
15
|
|
16
16
|
* 初始化本地lock文件
|
17
17
|
```
|
18
|
-
pod stable
|
18
|
+
pod stable init
|
19
19
|
```
|
20
20
|
|
21
21
|
* 同步lock文件
|
22
22
|
```
|
23
|
-
pod stable
|
23
|
+
pod stable sync
|
24
24
|
```
|
25
25
|
|
26
|
+
* pod install
|
27
|
+
```
|
28
|
+
pod stable install
|
29
|
+
```
|
30
|
+
|
31
|
+
* pod update
|
32
|
+
```
|
33
|
+
pod stable update [组件名称] --sync
|
34
|
+
```
|
35
|
+
> `--sync`选项可选,会自动同步远端标签,不带默认不更新远端版本
|
36
|
+
更多用法,参照:pod stable update --help
|
37
|
+
|
26
38
|
## linkline使用
|
27
39
|
支持动态/静态库
|
28
40
|
|
@@ -13,12 +13,16 @@ class BabybusInstallEnv
|
|
13
13
|
rootPath = getProjectRootPath
|
14
14
|
bundleIdentifier = getProjectBundleIdentifier
|
15
15
|
path = File.join(rootPath, "Configs", "#{bundleIdentifier}/BBPlistMacro.h")
|
16
|
+
puts "查找PlistMacro文件1:#{path}"
|
16
17
|
if !File.file?(path)
|
17
18
|
path = File.join(rootPath, "Configs/PlistMacro", "#{bundleIdentifier}/BBPlistMacro.h")
|
19
|
+
puts "查找PlistMacro文件2:#{path}"
|
18
20
|
if !File.file?(path)
|
19
21
|
path = File.join(rootPath, "Configs/PlistMacro", "#{bundleIdentifier}_BBPlistMacro.h")
|
22
|
+
puts "查找PlistMacro文件3:#{path}"
|
20
23
|
if !File.file?(path)
|
21
24
|
path = File.join(rootPath, "Configs/PlistMacro", "BBPlistMacro.h")
|
25
|
+
puts "查找PlistMacro文件4:#{path}"
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
@@ -51,12 +55,16 @@ class BabybusInstallEnv
|
|
51
55
|
rootPath = getProjectRootPath
|
52
56
|
bundleIdentifier = getProjectBundleIdentifier
|
53
57
|
path = File.join(rootPath, "Configs", "#{bundleIdentifier}/UnityFramework.framework")
|
58
|
+
puts "查找UnityFramework产物1:#{path}"
|
54
59
|
if !File.file?(path)
|
55
60
|
path = File.join(rootPath, "Configs/UnityFramework", "#{bundleIdentifier}/UnityFramework.framework")
|
61
|
+
puts "查找UnityFramework产物2:#{path}"
|
56
62
|
if !File.directory?(path)
|
57
63
|
path = File.join(rootPath, "Configs/UnityFramework", "#{bundleIdentifier}_UnityFramework.framework")
|
64
|
+
puts "查找UnityFramework产物3:#{path}"
|
58
65
|
if !File.directory?(path)
|
59
66
|
path = File.join(rootPath, "Configs/UnityFramework", "UnityFramework.framework")
|
67
|
+
puts "查找UnityFramework产物4:#{path}"
|
60
68
|
end
|
61
69
|
end
|
62
70
|
end
|
@@ -78,7 +86,7 @@ class BabybusInstallEnv
|
|
78
86
|
system "rm -rf #{replaceFilePath}; cp -af #{path} #{replaceFilePath}"
|
79
87
|
puts "替换UnityFramework文件成功".yellow
|
80
88
|
else
|
81
|
-
puts "找不到UnityFramework
|
89
|
+
puts "找不到UnityFramework产物文件,替换失败".red
|
82
90
|
end
|
83
91
|
end
|
84
92
|
# 2D母包替换
|
@@ -24,12 +24,20 @@ def forceAddDebugTool
|
|
24
24
|
forceAddDebugTool = BB::PodUtils.getValueFromInfoPlist("ForceAddDebugTool")
|
25
25
|
return forceAddDebugTool === "true"
|
26
26
|
end
|
27
|
-
# 是否3d产品
|
27
|
+
# 是否3d产品(968开始切新版unity2022引擎)
|
28
28
|
def isUnity3DApp
|
29
|
-
|
30
|
-
|
29
|
+
if isUnityApp
|
30
|
+
# 1=>Cocos2D; 2=>Unity2D; 3=>普通 Unity3D; 4=>新版 Unity 3D; 5=>2D融合 打包机负责写入
|
31
|
+
value = BB::PodUtils.getValueFromInfoPlist("packer_engines_id")
|
32
|
+
return value === "4"
|
33
|
+
end
|
34
|
+
return false
|
35
|
+
end
|
36
|
+
# 是否unity产品,包含2d/3d
|
37
|
+
def isUnityApp
|
38
|
+
value = BB::PodUtils.getValueFromInfoPlist("Unity3D")
|
39
|
+
return value === "true"
|
31
40
|
end
|
32
|
-
|
33
41
|
# 是否需要第三方支付sdk
|
34
42
|
def isThirdPaySdk
|
35
43
|
value = BB::PodUtils.getValueFromInfoPlist("Third_Purcharse")
|
@@ -7,36 +7,46 @@ require 'cocoapods-bb-PodAssistant/babybus/business/babybus_install_environment'
|
|
7
7
|
require 'cocoapods-bb-PodAssistant/helpers/pod_utils'
|
8
8
|
|
9
9
|
class PodPostInstaller
|
10
|
-
def initialize(lib, deployment_target=
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
def initialize(lib, deployment_target=nil)
|
11
|
+
@lib = lib
|
12
|
+
puts "====isUnity3DApp:#{isUnity3DApp}".red
|
13
|
+
if deployment_target.nil?
|
14
|
+
@deployment_target = isUnity3DApp ? "12.0" : "11.0" # Unity2022引擎最低支持iOS12.0
|
15
|
+
else
|
16
|
+
@deployment_target = deployment_target
|
17
|
+
end
|
14
18
|
end
|
15
19
|
def run
|
16
20
|
env = BabybusInstallEnv.new()
|
17
21
|
is_xcode15 = BB::PodUtils.compare_xcode_15_version
|
18
22
|
# 是否Untify项目
|
19
|
-
isUnityProject =
|
20
|
-
|
23
|
+
isUnityProject = isUnityApp
|
21
24
|
# Untify项目需要移除cocos项目res/src目录
|
22
25
|
if (isUnityProject) then
|
23
26
|
env.createCocosResource
|
24
27
|
end
|
25
|
-
ios_deployment_target =
|
26
|
-
puts "当前工程最低支持iOS
|
28
|
+
ios_deployment_target = @deployment_target
|
29
|
+
puts "当前工程最低支持iOS系统 ===> #{ios_deployment_target.to_s.send(:red)}".green
|
27
30
|
@lib.aggregate_targets.first.user_project.save # 解决Xcode13 pod update操作出现failed to save pods.xcodeproj问题 by hm 21/11/8
|
28
31
|
project = Xcodeproj::Project.open(BB::PodUtils.getXcodeprojPath)
|
29
32
|
project.targets.each do |target|
|
30
33
|
target.build_configurations.each do |config|
|
31
|
-
if
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
if !target.name.include? '_test' # 过滤target test 工程
|
35
|
+
if config.name.include? 'Debug' # 只有debug环境才进行替换操作,其它环境交由打包机处理
|
36
|
+
puts "[#{target.name}/#{config.name}] 开发者debug环境环境替换[PlistMacro/cocos/unity]文件操作,其它环境交由打包机处理".red
|
37
|
+
env.copyPlistMacro # 开发自行打开不能提交到版本控制,避免test包出现配置不正确情况 by hm 22/5/17
|
38
|
+
if (isUnityProject) then
|
39
|
+
env.copyUnityFramework
|
40
|
+
else
|
41
|
+
env.copyCocosPackage
|
42
|
+
end
|
43
|
+
end
|
44
|
+
# iOS17适配添加ld64
|
45
|
+
if (is_xcode15 == true) then
|
46
|
+
config.build_settings['OTHER_LDFLAGS'] = "$(inherited) -lxml2 -lz -ObjC -lstdc++ -ld64"
|
47
|
+
else
|
48
|
+
config.build_settings['OTHER_LDFLAGS'] = "$(inherited) -lxml2 -lz -ObjC -lstdc++"
|
49
|
+
end
|
40
50
|
end
|
41
51
|
end
|
42
52
|
end
|
@@ -8,7 +8,9 @@ module BB
|
|
8
8
|
stable_source = StableSource.stable_default_source
|
9
9
|
end
|
10
10
|
@stable_source = stable_source
|
11
|
-
|
11
|
+
if File.exist?(File.join(Pathname.pwd, "Podfile"))
|
12
|
+
@bundleId = BB::PodUtils.getProjectBundleIdentifier
|
13
|
+
end
|
12
14
|
if @bundleId.nil?
|
13
15
|
@bundleId = 'stable'
|
14
16
|
end
|
@@ -73,17 +73,24 @@ module BB
|
|
73
73
|
# 获取info配置文件路径
|
74
74
|
def self.getInfoPlistPath
|
75
75
|
path = File.join(getProjectPath, "bbframework/Resources/Info.plist")
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
if File.exist?(path)
|
77
|
+
return path
|
78
|
+
end
|
79
|
+
puts "无法找打工程Info.plist配置文件,工程目录:#{getProjectPath}".yellow
|
80
|
+
return nil
|
81
|
+
# raise Informative, "#{path} File no exist, please check" unless File.exist?(path)
|
82
|
+
# return path
|
79
83
|
end
|
80
84
|
# 获取info配置key对应的值
|
81
85
|
def self.getValueFromInfoPlist(key)
|
82
86
|
plistPath = getInfoPlistPath
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
+
if !plistPath.nil?
|
88
|
+
value = `/usr/libexec/PlistBuddy -c "Print #{key}" #{plistPath}`
|
89
|
+
value = value.rstrip()
|
90
|
+
puts "#{key} => #{value}"
|
91
|
+
return value
|
92
|
+
end
|
93
|
+
return ""
|
87
94
|
end
|
88
95
|
# 获取Xcode版本
|
89
96
|
def self.xcode_version
|
@@ -49,7 +49,7 @@ module BB
|
|
49
49
|
if verify_branch_exists
|
50
50
|
if stable_tag || stable_branch
|
51
51
|
if stable_branch
|
52
|
-
system "cd #{cachePath}; git checkout #{stable_branch}; git reset --hard origin/#{stable_branch}"
|
52
|
+
system "cd #{cachePath}; git checkout #{stable_branch}; git reset --hard origin/#{stable_branch}; git pull --all"
|
53
53
|
end
|
54
54
|
if stable_tag
|
55
55
|
system "cd #{cachePath}; git checkout #{stable_tag};"
|
@@ -57,7 +57,7 @@ module BB
|
|
57
57
|
else
|
58
58
|
result =`git symbolic-ref refs/remotes/origin/HEAD`
|
59
59
|
protechBranch = result.split("/").last.strip || default_branch
|
60
|
-
system "cd #{cachePath}; git checkout #{protechBranch}; git reset --hard origin/#{protechBranch}"
|
60
|
+
system "cd #{cachePath}; git checkout #{protechBranch}; git reset --hard origin/#{protechBranch}; git pull --all"
|
61
61
|
end
|
62
62
|
else
|
63
63
|
puts "❌ stable配置无效分支信息source:#{@stable_source} branch:#{stable_branch}".red
|
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'cocoapods-bb-PodAssistant/config/stable_specs'
|
2
2
|
require 'cocoapods-bb-PodAssistant/helpers'
|
3
|
+
require 'cocoapods-bb-PodAssistant/helpers/stable_env_helper'
|
3
4
|
|
4
5
|
module BB
|
5
6
|
class StableManager
|
6
|
-
def initialize()
|
7
|
+
def initialize(env = nil)
|
8
|
+
@env = env
|
7
9
|
end
|
8
10
|
|
9
11
|
# podfile 更新配置文件使用(通用)
|
@@ -11,8 +13,16 @@ module BB
|
|
11
13
|
update_stable_lock(public_stable_yaml, pod_targets)
|
12
14
|
end
|
13
15
|
# podfile 更新配置文件使用(业务线)
|
14
|
-
def update_business_stable_lock(
|
15
|
-
|
16
|
+
def update_business_stable_lock(pod_targets)
|
17
|
+
if @env.nil?
|
18
|
+
@env = BB::StableEnv.new()
|
19
|
+
end
|
20
|
+
businessSpecName = @env.business_stable
|
21
|
+
if !businessSpecName.nil?
|
22
|
+
update_stable_lock(business_stable_yaml(businessSpecName), pod_targets)
|
23
|
+
else
|
24
|
+
puts "没有配置业务线公共源,请确认!!!".yellow
|
25
|
+
end
|
16
26
|
end
|
17
27
|
# podfile 更新配置文件使用(项目)
|
18
28
|
def update_product_stable_lock(pod_targets)
|
@@ -65,21 +75,24 @@ module BB
|
|
65
75
|
stableMgr.update_common_stable_lock(pod_targets)
|
66
76
|
end
|
67
77
|
# podfile 更新配置文件使用(业务线)
|
68
|
-
def self.updateBusinessStableLock(
|
78
|
+
def self.updateBusinessStableLock(pod_targets)
|
69
79
|
stableMgr = StableManager.new()
|
70
|
-
stableMgr.
|
80
|
+
stableMgr.update_business_stable_lock(pod_targets)
|
71
81
|
end
|
72
82
|
# 更新产品lock
|
73
83
|
def self.updateProductStableLock(pod_targets)
|
74
84
|
stableMgr = StableManager.new()
|
75
85
|
stableMgr.update_product_stable_lock(pod_targets)
|
76
86
|
end
|
87
|
+
# pod助手ruby文件路径
|
88
|
+
def self.pod_assistant_path()
|
89
|
+
stableMgr = StableManager.new()
|
90
|
+
return File.join(stableMgr.cachePath, "PodAssistant/PodAssistant.rb") #名称固定
|
91
|
+
end
|
92
|
+
# pod助手机器人ruby文件路径
|
93
|
+
def self.pod_assistant_robot_path()
|
94
|
+
stableMgr = StableManager.new()
|
95
|
+
return File.join(stableMgr.cachePath, "PodAssistant/robot.rb") #名称固定
|
96
|
+
end
|
77
97
|
end
|
78
|
-
|
79
|
-
# class << self
|
80
|
-
# def updateCommonStableLock(pod_targets)
|
81
|
-
# stableMgr = StableManager.new()
|
82
|
-
# stableMgr.update_common_stable_lock(pod_targets)
|
83
|
-
# end
|
84
|
-
# end
|
85
98
|
end
|
@@ -82,8 +82,17 @@ module Pod
|
|
82
82
|
BB::StableManager.updateCommonStableLock(installer.pod_targets)
|
83
83
|
end
|
84
84
|
# 更新业务公共lock
|
85
|
-
def update_business_stable_lock(
|
86
|
-
BB::StableManager.updateBusinessStableLock(
|
85
|
+
def update_business_stable_lock(installer)
|
86
|
+
BB::StableManager.updateBusinessStableLock(installer.pod_targets)
|
87
|
+
end
|
88
|
+
|
89
|
+
# pod助手ruby文件路径
|
90
|
+
def pod_assistant_path()
|
91
|
+
return BB::StableManager.pod_assistant_path
|
92
|
+
end
|
93
|
+
# pod助手机器人ruby文件路径
|
94
|
+
def pod_assistant_robot_path()
|
95
|
+
return BB::StableManager.pod_assistant_robot_path
|
87
96
|
end
|
88
97
|
|
89
98
|
# 从列表中搜索得到对应配置
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-bb-PodAssistant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- humin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods-core
|