Top Level Namespace
Defined Under Namespace
Modules: BB, CocoapodsBbPodassistant, Pod Classes: BabybusInstallEnv, Dir, PodPostInstaller
Constant Summary collapse
- DEFAULT =
method
0
- LOCAL =
1
- REMOTE_GIT =
2
- REMOTE_VERSION =
3
- REMOTE_BRANCH =
4
- REMOTE_TAG =
5
- YAML_CONFIG_LIST_KEY =
"list"
- YAML_CONFIG_REMOVE_KEY =
"remove"
- YAML_CONFIG_DEPENDENCIES_KEY =
"dependencies"
Instance Method Summary collapse
-
#addRewardAd ⇒ Object
是否添加激励广告.
-
#childrenApp ⇒ Object
是否儿童应用.
-
#configGitPath(gitPath) ⇒ Object
Git Command ########################################.
-
#forceAddDebugTool ⇒ Object
是否显示调试工具(小白点).
-
#getCaseNumber ⇒ Object
产品备案号.
-
#getProductID ⇒ Object
产品id.
-
#getProjectBundleIdentifier ⇒ Object
获取工程包名.
-
#getProjectPath ⇒ Object
获取工程路径.
-
#getProjectRootPath ⇒ Object
获取工程根目录路径.
- #git_branch_exists?(branch) ⇒ Boolean
-
#git_checkout_and_pull(stable_source, stable_branch = nil, stable_tag = nil) ⇒ Object
git_cmd(‘pull’,‘–all’) #fommate git command.
- #git_clone(source, path) ⇒ Object
- #git_cmd(*args) ⇒ Object
- #git_fetch ⇒ Object
- #git_pull ⇒ Object
- #git_reset ⇒ Object
- #git_tag_exists?(tag) ⇒ Boolean
-
#isABCApp ⇒ Object
是否abc产品.
-
#isCityApp ⇒ Object
是否城市产品.
-
#isCourseApp ⇒ Object
是否科学产品.
-
#isGameWorldApp ⇒ Object
是否创意世界产品.
-
#isHanZiApp ⇒ Object
是否汉字产品.
-
#isMathApp ⇒ Object
是否思维产品.
-
#isMatrixApp ⇒ Object
是否矩阵产品.
-
#isPinyinAppp ⇒ Object
是否拼音产品.
-
#isQMWApp ⇒ Object
是否奇妙屋产品.
-
#isThirdPaySdk ⇒ Object
是否需要第三方支付sdk.
-
#isUnity3DApp ⇒ Object
是否3d产品(968开始切新版unity2022引擎).
-
#isUnityApp ⇒ Object
是否unity产品,包含2d/3d.
-
#multiEngine ⇒ Object
是否支持多引擎.
-
#releaseConfig ⇒ Object
是否重置配置.
-
#usePlugin(key) ⇒ Object
是否使用插件.
Instance Method Details
#addRewardAd ⇒ Object
是否添加激励广告
12 13 14 15 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 12 def addRewardAd flag = BB::PodUtils.getValueFromInfoPlist("AddRewardAd") return flag === "true" end |
#childrenApp ⇒ Object
是否儿童应用
7 8 9 10 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 7 def childrenApp isChildrenValue = BB::PodUtils.getValueFromInfoPlist("Children") return isChildrenValue === "true" end |
#configGitPath(gitPath) ⇒ Object
Git Command ########################################
5 6 7 |
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 5 def configGitPath(gitPath) @gitPath = gitPath end |
#forceAddDebugTool ⇒ Object
是否显示调试工具(小白点)
23 24 25 26 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 23 def forceAddDebugTool forceAddDebugTool = BB::PodUtils.getValueFromInfoPlist("ForceAddDebugTool") return forceAddDebugTool === "true" end |
#getCaseNumber ⇒ Object
产品备案号
63 64 65 66 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 63 def getCaseNumber val = BB::PodUtils.getValueFromInfoPlist("CaseNumber") return val end |
#getProductID ⇒ Object
产品id
68 69 70 71 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 68 def getProductID val = BB::PodUtils.getValueFromInfoPlist("ProductId") return val end |
#getProjectBundleIdentifier ⇒ Object
获取工程包名
74 75 76 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 74 def getProjectBundleIdentifier return BB::PodUtils.getProjectBundleIdentifier end |
#getProjectPath ⇒ Object
获取工程路径
82 83 84 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 82 def getProjectPath return BB::PodUtils.getProjectPath end |
#getProjectRootPath ⇒ Object
获取工程根目录路径
78 79 80 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 78 def getProjectRootPath return BB::PodUtils.getProjectRootPath end |
#git_branch_exists?(branch) ⇒ Boolean
61 62 63 64 65 66 67 |
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 61 def git_branch_exists?(branch) if branch branchs = git_cmd('branch','-a').split("\n") branchs.include?(branch) || branchs.include?(' remotes/origin/' + branch) || branchs.include?('remotes/origin/' + branch) end return true end |
#git_checkout_and_pull(stable_source, stable_branch = nil, stable_tag = nil) ⇒ Object
git_cmd(‘pull’,‘–all’) #fommate git command
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 26 def git_checkout_and_pull(stable_source, stable_branch = nil, stable_tag = nil) # puts "spec source:#{stable_source} branch:#{stable_branch} tag:#{stable_tag}" if stable_branch || stable_tag if stable_branch unless git_branch_exists?(stable_branch) err_msg = "- Error: #{stable_source} did not exit branch #{stable_branch}" Pod::UI.puts "#{err_msg}".send(:red) exit -9006 end git_cmd('checkout',stable_branch) #fommate git command git_cmd('reset','--hard',"origin/#{stable_branch}") #fommate git command end if stable_tag unless git_tag_exists?(stable_tag) err_msg = "- Error: #{stable_source} did not exit tag #{stable_tag}" Pod::UI.puts "#{err_msg}".send(:red) exit -9007 end git_cmd('checkout',stable_tag) #fommate git command end else protechBranch = git_cmd('symbolic-ref','refs/remotes/origin/HEAD').split("/").last.strip || "main" git_cmd('checkout',protechBranch) git_cmd('reset','--hard',"origin/#{protechBranch}") #fommate git command end end |
#git_clone(source, path) ⇒ Object
69 70 71 72 73 74 75 76 77 |
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 69 def git_clone(source, path) puts "git clone source:#{source} path:#{path}".yellow if !File.directory?(path) Dir.mkdir(path) end UI.section("Cloning `#{source}` into `#{path}`.") do Dir.chdir(path) { git! ['clone', source] } #origin git command end end |
#git_cmd(*args) ⇒ Object
9 10 11 12 13 |
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 9 def git_cmd(*args) Dir.chdir(File.join(@gitPath)) { return git! args } end |
#git_fetch ⇒ Object
19 20 21 |
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 19 def git_fetch git_cmd('fetch') #fommate git command end |
#git_pull ⇒ Object
23 24 25 |
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 23 def git_pull # git_cmd('pull','--all') #fommate git command end |
#git_reset ⇒ Object
15 16 17 |
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 15 def git_reset git_cmd('reset','--hard') #fommate git command end |
#git_tag_exists?(tag) ⇒ Boolean
54 55 56 57 58 59 |
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 54 def git_tag_exists?(tag) if tag git_cmd('tag').split("\n").include?(tag) end return true end |
#isABCApp ⇒ Object
是否abc产品
117 118 119 120 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 117 def isABCApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.abc" end |
#isCityApp ⇒ Object
是否城市产品
123 124 125 126 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 123 def isCityApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.city" end |
#isCourseApp ⇒ Object
是否科学产品
105 106 107 108 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 105 def isCourseApp bundleId = getProjectBundleIdentifier() return bundleId === "com.ailiyong.world.course" end |
#isGameWorldApp ⇒ Object
是否创意世界产品
129 130 131 132 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 129 def isGameWorldApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.gameworld" end |
#isHanZiApp ⇒ Object
是否汉字产品
87 88 89 90 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 87 def isHanZiApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.homeland" || getProductID() === "3108" end |
#isMathApp ⇒ Object
是否思维产品
111 112 113 114 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 111 def isMathApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.mathIII" end |
#isMatrixApp ⇒ Object
是否矩阵产品
135 136 137 138 139 140 141 142 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 135 def isMatrixApp bundleId = getProjectBundleIdentifier() puts "###bundleId:#{bundleId}###".red if (isHanZiApp || isQMWApp || || isCourseApp || isMathApp || isABCApp || isCityApp) then return false end return true end |
#isPinyinAppp ⇒ Object
是否拼音产品
99 100 101 102 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 99 def bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.voicerecognition" || bundleId === "com.sinyee.babybus.read.ios" || bundleId === "com.sinyee.babybus.stroke" || getProductID() === "3110" end |
#isQMWApp ⇒ Object
是否奇妙屋产品
93 94 95 96 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 93 def isQMWApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.talk2kiki" || getProductID() === "3132" end |
#isThirdPaySdk ⇒ Object
是否需要第三方支付sdk
42 43 44 45 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 42 def isThirdPaySdk value = BB::PodUtils.getValueFromInfoPlist("Third_Purcharse") return value === "true" end |
#isUnity3DApp ⇒ Object
是否3d产品(968开始切新版unity2022引擎)
28 29 30 31 32 33 34 35 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 28 def isUnity3DApp if isUnityApp # 1=>Cocos2D; 2=>Unity2D; 3=>普通 Unity3D; 4=>新版 Unity 3D; 5=>2D融合 打包机负责写入 value = BB::PodUtils.getValueFromInfoPlist("packer_engines_id") return value === "4" end return false end |
#isUnityApp ⇒ Object
是否unity产品,包含2d/3d
37 38 39 40 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 37 def isUnityApp value = BB::PodUtils.getValueFromInfoPlist("Unity3D") return value === "true" end |
#multiEngine ⇒ Object
是否支持多引擎
47 48 49 50 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 47 def multiEngine val = BB::PodUtils.getValueFromInfoPlist("MultiEngine") return val === "true" end |
#releaseConfig ⇒ Object
是否重置配置
17 18 19 20 21 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 17 def releaseConfig appEnvValue = BB::PodUtils.getValueFromInfoPlist("APP_Environment") adhocValue = BB::PodUtils.getValueFromInfoPlist("ADHOC") return appEnvValue === "1" && adhocValue != "true" end |
#usePlugin(key) ⇒ Object
是否使用插件
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 52 def usePlugin(key) val = BB::PodUtils.getValueFromInfoPlist("Plugins") plugins = val.split("|") plugins.each do |plugin| if plugin.eql?(key) return true end end return false end |