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
是否显示调试工具(小白点).
-
#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
-
#isHanZiApp ⇒ Object
是否汉字产品.
-
#isMatrixApp ⇒ Object
是否矩阵产品.
-
#isPinyinAppp ⇒ Object
是否拼音产品.
-
#isQMWApp ⇒ Object
是否奇妙屋产品.
-
#isThirdPaySdk ⇒ Object
是否需要第三方支付sdk.
-
#isUnity3DApp ⇒ Object
是否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 |
#getProjectBundleIdentifier ⇒ Object
获取工程包名
56 57 58 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 56 def getProjectBundleIdentifier return BB::PodUtils.getProjectBundleIdentifier end |
#getProjectPath ⇒ Object
获取工程路径
64 65 66 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 64 def getProjectPath return BB::PodUtils.getProjectPath end |
#getProjectRootPath ⇒ Object
获取工程根目录路径
60 61 62 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 60 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 |
#isHanZiApp ⇒ Object
是否汉字产品
69 70 71 72 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 69 def isHanZiApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.homeland" end |
#isMatrixApp ⇒ Object
是否矩阵产品
87 88 89 90 91 92 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 87 def isMatrixApp if (isHanZiApp || isQMWApp || ) then return false end return true end |
#isPinyinAppp ⇒ Object
是否拼音产品
81 82 83 84 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 81 def bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.voicerecognition" || bundleId === "com.sinyee.babybus.read.ios" || bundleId === "com.sinyee.babybus.stroke" end |
#isQMWApp ⇒ Object
是否奇妙屋产品
75 76 77 78 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 75 def isQMWApp bundleId = getProjectBundleIdentifier() return bundleId === "com.sinyee.babybus.talk2kiki" end |
#isThirdPaySdk ⇒ Object
是否需要第三方支付sdk
34 35 36 37 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 34 def isThirdPaySdk value = BB::PodUtils.getValueFromInfoPlist("Third_Purcharse") return value === "true" end |
#isUnity3DApp ⇒ Object
是否3d产品
28 29 30 31 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 28 def isUnity3DApp isU3dValue = BB::PodUtils.getValueFromInfoPlist("Unity3D") return isU3dValue === "true" end |
#multiEngine ⇒ Object
是否支持多引擎
39 40 41 42 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 39 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
是否使用插件
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper.rb', line 44 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 |