cocoapods-bb-PodAssistant 0.1.9.1 → 0.1.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6c32b006b3836cba11f001d3ebc24c707f3bd473a35156cfaf3bceae50f4528
4
- data.tar.gz: 447a74c6907306dfdacf90685572eeea587b97e0e20ad61c0ccebf7001f4ca69
3
+ metadata.gz: 32ae7a754051168b335839ef24e3241e10ae8c1ce9772b65ae1add131a591744
4
+ data.tar.gz: fabd94ec00e74cd9b40dcbbf176baca21d88e54d640ddaf82b3c085520649807
5
5
  SHA512:
6
- metadata.gz: b0f45f73957e38a0007348067cbcbc39d65a1a533ffe0ba5a349d82134909f3e51bdc72e062adfcecc7b184ddc3da11df2cc2dd2041740331f6216ebe53a8a27
7
- data.tar.gz: ea3629e578813651181a761037a0d4ec02a25b0003c6e24cca1574de0e1fd3b82a0e0ec0fc4f028b2e5fc91da44019c64e2eff3cecd80bab4cf44a1f7913a073
6
+ metadata.gz: 3945a8e16d272daa2b8a13e6fa412127bd055b1f85f97b6dbee51c56df0465dce8a8403d913139bb669239e1c7926341e6f8e5a7a60f619b49f614983cb1f387
7
+ data.tar.gz: 1d27d7075c0fae3e206182a07b2c061f2d1f67907083ff938084ed34d4bc4d872d19d6a55a1e09abfaaf3879b99ec47ec3fd2c101ff10e1eb617c9598ff23509
@@ -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配置文件,替换失败path:#{path}".red
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
- isU3dValue = BB::PodUtils.getValueFromInfoPlist("Unity3D")
30
- return isU3dValue === "true"
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.0", unity_deployment_target="11.0")
11
- @lib = lib
12
- @deployment_target = deployment_target
13
- @unity_deployment_target = unity_deployment_target
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 = isUnity3DApp
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 = isUnityProject ? @unity_deployment_target : @deployment_target
26
- puts "当前工程最低支持iOS系统===>#{ios_deployment_target.to_s.send(:red)}".green
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 config.name.include? 'Debug' # 只有debug环境才进行替换操作,其它环境交由打包机处理
32
- puts "[#{target.name}/#{config.name}] 环境替换PlistMacro文件操作!!!开发者debug环境自行打开👇替换操作,禁止提交版本控制,谢谢🙏"
33
- env.copyPlistMacro # 开发自行打开不能提交到版本控制,避免test包出现配置不正确情况 by hm 22/5/17
34
- end
35
- # iOS17适配添加ld64
36
- if (is_xcode15 == true) then
37
- config.build_settings['OTHER_LDFLAGS'] = "$(inherited) -lxml2 -lz -ObjC -lstdc++ -ld64"
38
- else
39
- config.build_settings['OTHER_LDFLAGS'] = "$(inherited) -lxml2 -lz -ObjC -lstdc++"
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
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBbPodassistant
2
- VERSION = "0.1.9.1"
2
+ VERSION = "0.1.9.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-PodAssistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9.1
4
+ version: 0.1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin