cocoapods-mPaaS 1.0.0

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.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/lib/cocoapods-mPaaS/baselineTools.rb +493 -0
  3. data/lib/cocoapods-mPaaS/checkUpdateTools.rb +42 -0
  4. data/lib/cocoapods-mPaaS/cocoapods_hook.rb +929 -0
  5. data/lib/cocoapods-mPaaS/command/mPaaS.rb +44 -0
  6. data/lib/cocoapods-mPaaS/command/mpaas/dev.rb +17 -0
  7. data/lib/cocoapods-mPaaS/command/mpaas/info.rb +170 -0
  8. data/lib/cocoapods-mPaaS/command/mpaas/init.rb +112 -0
  9. data/lib/cocoapods-mPaaS/command/mpaas/local_command.rb +49 -0
  10. data/lib/cocoapods-mPaaS/command/mpaas/open.rb +17 -0
  11. data/lib/cocoapods-mPaaS/command/mpaas/update.rb +223 -0
  12. data/lib/cocoapods-mPaaS/command/mpaas/version.rb +32 -0
  13. data/lib/cocoapods-mPaaS/command.rb +1 -0
  14. data/lib/cocoapods-mPaaS/dsl.rb +498 -0
  15. data/lib/cocoapods-mPaaS/gem_version.rb +5 -0
  16. data/lib/cocoapods-mPaaS/installNew.rb +303 -0
  17. data/lib/cocoapods-mPaaS/locales/en.yml +140 -0
  18. data/lib/cocoapods-mPaaS/locales/zh-Hans.yml +144 -0
  19. data/lib/cocoapods-mPaaS/localization.rb +238 -0
  20. data/lib/cocoapods-mPaaS/logTools.rb +67 -0
  21. data/lib/cocoapods-mPaaS/mPaaSPodfile.rb +117 -0
  22. data/lib/cocoapods-mPaaS/module_config.rb +298 -0
  23. data/lib/cocoapods-mPaaS/podfileTools.rb +48 -0
  24. data/lib/cocoapods-mPaaS/post_install_hook_processor.rb +61 -0
  25. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/DemoViewController.h +13 -0
  26. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/DemoViewController.m +43 -0
  27. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/Contents.json +6 -0
  28. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Discovery.imageset/Contents.json +22 -0
  29. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Discovery.imageset/TabBar_Discovery@2x.png +0 -0
  30. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Discovery.imageset/TabBar_Discovery@3x.png +0 -0
  31. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Discovery_Sel.imageset/Contents.json +22 -0
  32. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Discovery_Sel.imageset/TabBar_Discovery_Sel@2x.png +0 -0
  33. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Discovery_Sel.imageset/TabBar_Discovery_Sel@3x.png +0 -0
  34. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Friends.imageset/Contents.json +22 -0
  35. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Friends.imageset/TabBar_Friends@2x.png +0 -0
  36. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Friends.imageset/TabBar_Friends@3x.png +0 -0
  37. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Friends_Sel.imageset/Contents.json +22 -0
  38. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Friends_Sel.imageset/TabBar_Friends_Sel@2x.png +0 -0
  39. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_Friends_Sel.imageset/TabBar_Friends_Sel@3x.png +0 -0
  40. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_HomeBar.imageset/Contents.json +22 -0
  41. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_HomeBar.imageset/icon30-line@2x.png +0 -0
  42. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_HomeBar.imageset/icon30-line@3x.png +0 -0
  43. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_HomeBar_Sel.imageset/Contents.json +22 -0
  44. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_HomeBar_Sel.imageset/icon30@2x.png +0 -0
  45. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_HomeBar_Sel.imageset/icon30@3x.png +0 -0
  46. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_PublicService.imageset/Contents.json +22 -0
  47. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_PublicService.imageset/TabBar_PublicService@2x.png +0 -0
  48. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_PublicService.imageset/TabBar_PublicService@3x.png +0 -0
  49. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_PublicService_Sel.imageset/Contents.json +22 -0
  50. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_PublicService_Sel.imageset/TabBar_PublicService_Sel@2x.png +0 -0
  51. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/Images_mPaaS.xcassets/TabBar_PublicService_Sel.imageset/TabBar_PublicService_Sel@3x.png +0 -0
  52. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPAppDelegate.h +10 -0
  53. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPAppDelegate.m +43 -0
  54. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPDrawerController.h +8 -0
  55. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPDrawerController.m +135 -0
  56. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPDrawerLauncherAppDelegate.h +10 -0
  57. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPDrawerLauncherAppDelegate.m +43 -0
  58. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPDrawerLeftView.h +16 -0
  59. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPDrawerLeftView.m +86 -0
  60. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPDrawerMainViewController.h +21 -0
  61. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPDrawerMainViewController.m +104 -0
  62. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPLauncherAppDelegate.h +10 -0
  63. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPLauncherAppDelegate.m +91 -0
  64. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPNavigationController.h +8 -0
  65. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPNavigationController.m +25 -0
  66. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPNavigationLauncherAppDelegate.h +10 -0
  67. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPNavigationLauncherAppDelegate.m +43 -0
  68. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPTabBarController.h +8 -0
  69. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPTabBarController.m +27 -0
  70. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPViewController.h +8 -0
  71. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MPViewController.m +19 -0
  72. data/lib/cocoapods-mPaaS/templates/APMobileFramework/AutoConfig/MobileRuntime.plist +26 -0
  73. data/lib/cocoapods-mPaaS/write_info_list_mPaaSApp.rb +125 -0
  74. data/lib/cocoapods-mPaaS/xcode_helper.rb +334 -0
  75. data/lib/cocoapods-mPaaS.rb +41 -0
  76. data/lib/cocoapods_plugin.rb +15 -0
  77. metadata +160 -0
@@ -0,0 +1,303 @@
1
+ require "fileutils"
2
+ require "json"
3
+ # 判断 mPaaS repo 是否已经存在
4
+ def mPaaS_repo_exist?
5
+ repo_name = `pod repo list | awk '{print $1}' | grep -w #{CocoapodsmPaaS::MPAAS_REPO_NAME}`
6
+ repo_name.include?(CocoapodsmPaaS::MPAAS_REPO_NAME)
7
+ end
8
+
9
+ def add_mPaaS_repo
10
+ system "pod repo add #{CocoapodsmPaaS::MPAAS_REPO_NAME} #{CocoapodsmPaaS::MPAAS_REPO_URL}"
11
+ end
12
+
13
+ def add_mPaaS_repo_with(repo_name, repo_url)
14
+ system "pod repo add #{repo_name} #{repo_url}"
15
+ end
16
+
17
+ def mPaaS_repo_exist_by_name?(repo_name)
18
+ result = `pod repo list | awk '{print $1}' | grep -w #{repo_name}`
19
+ result.include?(repo_name)
20
+ end
21
+
22
+ def repo_name_from_url(url)
23
+ uri = url.gsub(/\.git$/, '')
24
+ parts = uri.split(/[\/:]/).last(2)
25
+ parts.join("-").downcase
26
+ end
27
+
28
+ # todo 改读取基线文件判断
29
+ def get_mPaaS_lib_names
30
+ names = ["APLog", "APRemoteLogging", "MPAnalysis", "MPDataCenter", "mPaas", "MPPushSDK", "APMobileNetwork", "APProtocolBuffers", "APOpenSSL", "SecurityGuardSDK", "APSecurityUtility", "AutoTracker", "MPPerformance", "TianYan", "APCrashReporter"]
31
+ return names
32
+ end
33
+
34
+ # 判断是否存在,并返回path
35
+ def safe_create_directory_tt(path)
36
+ if !File::exist?(path)
37
+ LogTools.p "Create directory '#{path}'."
38
+ FileUtils::mkdir_p(path)
39
+ end
40
+ return path
41
+ end
42
+
43
+ def safe_delete_directory_tt(path)
44
+ if File::exist?(path)
45
+ LogTools.p "Delete directory '#{path}'."
46
+ FileUtils::rm_r(path)
47
+ end
48
+ return path
49
+ end
50
+
51
+ # 判断是否存在,并返回path
52
+ def safe_create_file(path)
53
+ if !File::exist?(path)
54
+ LogTools.p "Create file '#{path}'."
55
+ File.new(path, "w")
56
+ end
57
+ return path
58
+ end
59
+
60
+ def find_config_file(project_dir)
61
+ meta_file_path = ""
62
+ Dir::foreach(project_dir) do |file_name|
63
+ # 693B055141932-default-iOS.config
64
+ # tempArray = file_name.split(".")
65
+ # 改为字符串正则匹配
66
+ # if tempArray.size > 0 && tempArray[1] == "config"
67
+ if (file_name.include?(".config") && file_name.downcase.include?("-ios")) || file_name == "meta.config" # 兼容下多target的情况
68
+ meta_file_name = file_name
69
+ meta_file_path = File.join(project_dir, file_name)
70
+ break
71
+ end
72
+ end
73
+ return meta_file_path
74
+ end
75
+
76
+ # 从'Module:1.0.0'这种数组,解析出需要的模块的版本,放在字典中
77
+ def get_module_versions_from_colon_array(modules)
78
+ pretty = Hash[]
79
+ modules.each do |m|
80
+ if m =~ /\w+:.+/
81
+ name = m.sub(/:.+/, "")
82
+ version = m.sub(/\w+:/, "")
83
+ pretty[name] = version
84
+ end
85
+ end
86
+ return pretty
87
+ end
88
+
89
+ def add_mpaas_references_to_target_headers(header_file_path, modules, terget_modules_ignore)
90
+ ignored_modules = Array["SecurityGuardSDK", "UTDID", "MPTianYan", "MPSyncService", "APProtocolBuffers", "APOpenSSL", "APSecurityUtility", "MPPerformance", "MPDataCenter", "MPDiagnosis", "AntLog", "mPaas", "MPPipeLine", "NebulaSDKPlugins"]
91
+ LogTools.p "Add MPaaS framework headers terget_modules_ignore '#{terget_modules_ignore}'."
92
+ LogTools.p "Add MPaaS framework headers to '#{header_file_path}'."
93
+ trim_end_multiple_nextline(header_file_path)
94
+ # s = File::open(header_file_path).read
95
+ override = File.new(header_file_path, "w")
96
+ baseline_matched = BaselineTools.getBaselineMatched(File.join(Dir::pwd, "Podfile"))
97
+ # override.puts s
98
+ override.puts "\n// MPAAS BEGIN\n// This part is maintained by MPaaS plugin automatically. Please don't modify.\n#ifdef __OBJC__\n\n"
99
+ override.puts "#import <UIKit/UIKit.h>\n"
100
+ hasNebulaBiz = false
101
+ hasNebulaLogging = false
102
+ hasAliUpgradeUI = false
103
+ hasAliUpgradeCheckService = false
104
+ hasAlipaySDK = false
105
+ hasNebulaHeader = false
106
+ modules.each do |m, v|
107
+ if ignored_modules.include?(m)
108
+ next
109
+ end
110
+ if MPaaSCocoapodShare.instance.igenore_headers.include?(m)
111
+ next
112
+ end
113
+
114
+ if terget_modules_ignore.include?(m)
115
+ next
116
+ end
117
+
118
+ if m == "APCrashReporter"
119
+ override.puts "#import <#{m}/DFCrashReport.h>"
120
+ elsif m == "APConfig"
121
+ override.puts "#import <#{m}/APConfigService.h>"
122
+ elsif m == "NebulamPaaSBiz"
123
+ hasNebulaBiz = true
124
+ elsif m == "NebulaLogging"
125
+ hasNebulaLogging = true
126
+ elsif m == "AliUpgradeUI"
127
+ hasAliUpgradeUI = true
128
+ elsif m == "AliUpgradeCheckService"
129
+ hasAliUpgradeCheckService = true
130
+ elsif m == "NebulaHeader"
131
+ #不在添加NebulaHeader头文件
132
+ hasNebulaHeader = (baseline_matched != "cp_change_15200851")
133
+ elsif m == "MPNebulaAdapter"
134
+ override.puts "#import <#{m}/MPNebulaAdapterInterface.h>"
135
+ elsif m == "MPMgsAdapter"
136
+ override.puts "#import <#{m}/MPRpcInterface.h>"
137
+ elsif m == "MPConfigAdapter"
138
+ override.puts "#import <MPConfigAdapter/MPConfigInterface.h>"
139
+ elsif m == "MPDynamicAdapter"
140
+ override.puts "#import <#{m}/MPDynamicInterface.h>"
141
+ elsif m == "MPMssAdapter"
142
+ override.puts "#import <#{m}/MPSyncInterface.h>"
143
+ elsif m == "MPUTDIDAdapter"
144
+ override.puts "#import <#{m}/MPUtdidInterface.h>"
145
+ elsif m == "AliUpgradeCheckService_32"
146
+ override.puts "#import <AliUpgradeCheckService/UpgradeCheckService.h>"
147
+ override.puts "#import <AliUpgradeCheckService/MPCheckUpgradeInterface.h>"
148
+ elsif m == "MPTinyAppAdapterInterface_60"
149
+ override.puts "#import <MPNebulaAdapter/MPTinyAppAdapterInterface.h>"
150
+ else
151
+ override.puts "#import <#{m}/#{m}.h>"
152
+ # 这里先恶心的适配下
153
+ if m == "AlipaySDK"
154
+ hasAlipaySDK = true
155
+ end
156
+ end
157
+ end
158
+
159
+ if hasNebulaBiz
160
+ override.puts "#import <NebulamPaaSBiz/NebulamPaaSBiz.h>"
161
+ end
162
+
163
+ if hasNebulaLogging
164
+ override.puts "#import <NebulaLogging/NebulaLogging.h>"
165
+ end
166
+
167
+ if hasAliUpgradeUI
168
+ override.puts "#import <AliUpgradeUI/ASUpdateAlertManager.h>"
169
+ end
170
+
171
+ if hasAliUpgradeCheckService
172
+ override.puts "#import <AliUpgradeCheckService/UpgradeCheckService.h>"
173
+ end
174
+
175
+ if hasAlipaySDK
176
+ override.puts "#import <AlipaySDK/APayAuthInfo.h>"
177
+ end
178
+
179
+ # 为了放在最后
180
+ if hasNebulaHeader
181
+ override.puts "#import <NebulaHeader/NebulaHeader.h>"
182
+ end
183
+
184
+ override.puts "\n#endif\n// MPAAS END"
185
+ override.close
186
+ end
187
+
188
+ def trim_end_multiple_nextline(path)
189
+ s = File::open(path).read
190
+ while s[s.length - 1] == "\n"
191
+ s.chop!
192
+ end
193
+ override = File.new(path, "w")
194
+ override.puts s
195
+ override.close
196
+ end
197
+
198
+ def add_mpaas_references_headers_to_pch(pch_path, header_file_name)
199
+ LogTools.p "Add MPaaS framework headers to '#{pch_path}'."
200
+ trim_end_multiple_nextline(pch_path)
201
+ io = File::open(pch_path).readlines
202
+ override = File.new(pch_path, "w")
203
+ hasIncludeOldHeader = false
204
+ io.each do |line|
205
+ #line.chomp!
206
+ #判断是不是已经有了一个header
207
+ if line.include?("mPaaS-Headers.h")
208
+ hasIncludeOldHeader = true
209
+ override.puts "#import \"#{header_file_name}\""
210
+ else
211
+ override.puts line
212
+ end
213
+ end
214
+ #说明是第一次
215
+ if !hasIncludeOldHeader
216
+ override.puts "\n// MPAAS HEADERS BEGIN\n// This part is maintained by MPaaS plugin automatically. \n#ifdef __OBJC__\n\n"
217
+ override.puts "#import \"#{header_file_name}\""
218
+ override.puts "\n#endif\n// MPAAS HEADERS END"
219
+ end
220
+ override.close
221
+ end
222
+
223
+ def mPaaS_lib_has_adapter?(pods_path, libName)
224
+ # 这里的几个判断直接返回 true 了,不兼容32以下老基线了
225
+ if libName == "APRemoteLogging"
226
+ return true
227
+ # return Dir.entries(pods_path).include?("MPMasAdapter")
228
+ elsif libName == "MPAnalysis"
229
+ return true
230
+ # return Dir.entries(pods_path).include?("MPMasAdapter")
231
+ elsif libName == "APMobileNetwork"
232
+ return true
233
+ # return Dir.entries(pods_path).include?("MPMgsAdapter")
234
+ elsif libName == "APLongLinkService"
235
+ return true
236
+ # return Dir.entries(pods_path).include?("MPMssAdapter")
237
+ elsif libName == "MPDiagnosis"
238
+ return true
239
+ # 因为诊断是强依赖 sync 的,所以这里偷懒用 MPMssAdapter 来判断,todo 判断版本号
240
+ # return Dir.entries(pods_path).include?("MPMssAdapter")
241
+ elsif libName == "MPHotpatchSDK"
242
+ return true
243
+ # return Dir.entries(pods_path).include?("MPDynamicAdapter")
244
+ elsif libName == "NebulaHeader"
245
+ return Dir.entries(pods_path).include?("Nebula") # Nebula NBInsideAccountAdaptor
246
+ else
247
+ return false
248
+ end
249
+ end
250
+
251
+ # todo 配置化
252
+ def mPaaS_pod_deprecated(name, *version)
253
+ LogTools.v "mPaaS_pod : #{name} / #{version}"
254
+
255
+ if name.casecmp("mPaaS_Log") == 0
256
+ if version && !version.empty?
257
+ if version[0] == "1.0.0"
258
+ pod "APLog", "3.0.2.181018154912"
259
+ pod "APRemoteLogging", "1.0.0.181024160529"
260
+ pod "MPAnalysis", "1.1.0.20170806"
261
+ pod "MPDataCenter", "10.1.12.1.20181226"
262
+ pod "mPaas", "10.1.25.20180822"
263
+ end
264
+ end
265
+ elsif name.casecmp("mPaaS_Push") == 0
266
+ if version && !version.empty?
267
+ if version[0] == "1.0.0"
268
+ pod "MPPushSDK", "1.0.0.20180304"
269
+ pod "APMobileNetwork", "10.1.18.20180302"
270
+ pod "APProtocolBuffers", "3.0.0.20170628"
271
+ pod "APOpenSSL", "10.1.18.20180227"
272
+ pod "SecurityGuardSDK", "6.3.85.20170814"
273
+ pod "APSecurityUtility", "1.2.0.20170320"
274
+ pod "APRemoteLogging", "1.0.0.181024160529"
275
+ pod "APLog", "3.0.2.181018154912"
276
+ pod "MPAnalysis", "1.1.0.20170806"
277
+ pod "MPDataCenter", "10.1.12.1.20181226"
278
+ pod "mPaas", "10.1.25.20180822"
279
+ end
280
+ end
281
+ elsif name.casecmp("mPaaS_AutoTracker") == 0
282
+ if version && !version.empty?
283
+ if version[0] == "1.0.0"
284
+ pod "AutoTracker", "3.0.0.20170628"
285
+ end
286
+ end
287
+ elsif name.casecmp("mPaaS_Performance") == 0
288
+ if version && !version.empty?
289
+ if version[0] == "1.0.0"
290
+ pod "MPPerformance", "3.0.4.20171205"
291
+ pod "TianYan", "3.0.2.20171113"
292
+ end
293
+ end
294
+ elsif name.casecmp("mPaaS_Crash") == 0
295
+ if version && !version.empty?
296
+ if version[0] == "1.0.0"
297
+ pod "APCrashReporter", "10.1.18.20180228"
298
+ end
299
+ end
300
+ else
301
+ LogTools.p_red "No mPaaS_pod found !!! Check name in Podfile"
302
+ end
303
+ end
@@ -0,0 +1,140 @@
1
+ en:
2
+ mpaas:
3
+ common:
4
+ success: "Operation completed successfully."
5
+ error: "An error occurred: %{message}"
6
+ warning: "Warning: %{message}"
7
+ commands:
8
+ set_lang:
9
+ language_code_required: "A language code (e.g., en, zh-Hans) is required."
10
+ success_message: "MPAAS plugin output language set to '%{lang_code}'."
11
+ restart_note: "This setting will be used for all subsequent MPAAS commands and hook outputs."
12
+ unsupported_language: "Unsupported language code '%{lang_code}'. Please choose from supported languages."
13
+ hooks: # 新增钩子相关翻译
14
+ post_install:
15
+ start: "MPAAS post-install hook initiated."
16
+ processing: "Processing MPAAS configurations for project '%{project_name}'..."
17
+ finished: "MPAAS post-install configuration complete."
18
+ pre_install:
19
+ preparing: "MPAAS pre-install hook: Preparing for installation."
20
+ check_repo_exists: "Checking if mPaaS repo exists..."
21
+ add_repo: "Adding mPaaS repo"
22
+ mp_nebula_conflict: "MPNebulaSDKPlugins and NebulaSDKPlugins exist simultaneously! Please remove MPNebulaSDKPlugins!"
23
+ not_found_in_baseline: "%{name} : %{version} not found in %{baseline_to_be_checked}"
24
+ start_processing_target: "Starting to process %{target_name}"
25
+ no_config_file_found: "No config file found !!! Please check if a configuration file exists in the project root directory, format xxxxx-xxxxx-iOS.config"
26
+ resource_add_note: "Resource needs to be added." # 这句话出现两次
27
+ pch_file_not_in_support: "PCH file is not under support." #注释,但为了安全先放这里
28
+ no_framework_modules_added: "No framework modules added, for testing!"
29
+ report_buried_points: "Reporting logging"
30
+ # 从 lib/cocoapods-mPaaS/installNew.rb
31
+ install_new:
32
+ meta_config_note: "Compatible with multi-target scenarios for .config files and meta.config."
33
+
34
+ # 从 lib/cocoapods-mPaaS/localization.rb
35
+ localization:
36
+ file_utils_desc: "Used for creating directories."
37
+ default_fallback_lang: "Default fallback language."
38
+ ensure_dir_exists: "Ensure directory exists."
39
+ enter_t_method: "--- Entering t method ---"
40
+ key_received: "Key received: '%{key}'"
41
+ options_received: "Options received: %{options}"
42
+ path_elements_from_key: "Path elements from key: %{path_elements}"
43
+ actual_current_lang_determined: "Actual current language determined: '%{lang}'"
44
+ translations_not_loaded_try_fallback: "'%{lang}' translations not directly available. Trying fallback."
45
+ initial_lookup_hash_set_to_content: "Initial lookup hash set to content of '%{lang}' key: %{hash_preview}..."
46
+ initial_lookup_hash_set_to_fallback_content: "Initial lookup hash set to content of fallback '%{lang}' key: %{hash_preview}..."
47
+ error_no_valid_root_lang_key: "!!! ERROR: No valid root language key found in loaded translations for '%{lang}' or fallback."
48
+ warn_no_valid_root_lang_key: "No valid root language key found for '%{key}' in loaded translations."
49
+ level_looking_for_element: "Level %{level}: Looking for element '%{element}'"
50
+ element_found_current_hash: "Element '%{element}' found. Current hash/value: %{hash_preview}..."
51
+ error_key_element_not_found: "!!! ERROR: Key element '%{element}' NOT found at this level."
52
+ current_hash_lookup_failed: "!!! Current hash where lookup failed: %{hash}"
53
+ full_key_lookup_path: "!!! Full key lookup path: '%{key}'"
54
+ warn_missing_translation_key_for_lang: "Missing translation key '%{key}' for language '%{lang}'."
55
+ final_value_found: "Final value found for key '%{key}': %{value}"
56
+ successfully_interpolated_string: "Successfully interpolated string: '%{result}'"
57
+ error_sprintf_interpolation_failed: "!!! ERROR: sprintf interpolation failed for key '%{key}'. Error: %{error_message}"
58
+ warn_interpolation_failed: "Interpolation failed for translation '%{key}'. Error: %{error_message}"
59
+ error_translation_not_string: "!!! ERROR: Translation for '%{key}' is NOT a string. Type: %{type}"
60
+ warn_translation_not_string: "Translation for '%{key}' is not a string."
61
+ exit_t_method: "--- Exiting t method ---"
62
+ # 从 lib/cocoapods-mPaaS/mPaaSPodfile.rb
63
+ podfile:
64
+ execute_error: "Error executing Podfile: %{message}"
65
+ error_stack_trace: "Error stack trace:\n%{backtrace}"
66
+
67
+ # 从 lib/cocoapods-mPaaS/checkUpdateTools.rb
68
+ update_check:
69
+ start_check: "Starting update check..."
70
+ check_finished: "Update check finished."
71
+
72
+ # 从 lib/cocoapods-mPaaS/module_config.rb
73
+ module_config:
74
+ comment_out_original: "Comment out the original and write to file." # 注释
75
+
76
+ # 从 lib/cocoapods-mPaaS/baselineTools.rb
77
+ baseline_tools:
78
+ supplement_version_code: "Supplement version_code." # 注释
79
+
80
+ # 从 lib/cocoapods-mPaaS/command/mpaas/init.rb
81
+ init_command:
82
+ all_targets_desc: "Configure mPaaS for all targets."
83
+ check_config_file_exists: "Checking if config file exists..."
84
+ check_process_podfile: "Checking and processing Podfile..."
85
+ replace_baseline_note: "#Please replace x.x.x with the actual baseline version."
86
+ configuration_complete: "Configuration complete."
87
+
88
+ # 从 lib/cocoapods-mPaaS/command/mpaas/local_command.rb
89
+ local_command:
90
+ require_localization: "Ensure localization module is included." # 注释
91
+ abstract_command_note: "This is an abstract command and cannot be run directly."
92
+ set_lang_class_note: "Note: This inherits from MPAAS, not directly from Command."
93
+ get_arg_lang_code: "Get the first non-option argument as the language code."
94
+ call_super_initialize: "Call parent's initialize."
95
+
96
+ # 从 lib/cocoapods-mPaaS/command/mpaas/update.rb
97
+ update_command:
98
+ update_all_desc: "Update all (baseline list, mPaaS repo, and plugin itself)."
99
+ execute_plugin_install_script: "1. Execute CocoaPods-mPaaS plugin installation script."
100
+ update_mpaas_repo: "2. Update mPaaS repo"
101
+ update_local_baseline: "3. Update mPaaS local baseline"
102
+ update_mpaas_repo_second: "1. Update mPaaS repo" # 重复
103
+ update_local_baseline_second: "2. Update mPaaS local baseline" # 重复
104
+
105
+ # 从 lib/cocoapods-mPaaS/xcode_helper.rb
106
+ xcode_helper:
107
+ flags_may_be_string: "May be a string."
108
+ delete_existing_flag: "Delete existing."
109
+
110
+ # 从 lib/cocoapods-mPaaS/dsl.rb
111
+ dsl:
112
+ replace_baseline_version_note: "Please replace 'x.x.x' with the actual baseline version, e.g., '10.1.60'."
113
+ use_global_default_baseline: "Please use the global default identifier mPaaS_baseline."
114
+ mpaas_pod_deprecated_warning: "mPaaS_pod '%{name}', '%{version}' syntax is deprecated! (Please use mPaaS_pod '%{name}' directly, no need to specify version number separately, please remove the version number at the end)"
115
+ specify_global_default_baseline_warning: "Please specify the global default baseline (version number) mPaaS_baseline. If not found, you can add it using the 'pod mpaas init' command. For more information, please refer to the documentation (https://tech.antfin.com/docs/2/106682)"
116
+ version_not_found_for_pod: "Current %{name} : %{current_version} version not found! Please specify the version after mPaaS_pod, or use the global default identifier mPaaS_baseline."
117
+ sorry_version_not_found: "Sorry, version for %{pod_name} not found !!! Please contact mPaaS support personnel."
118
+ repo_manager:
119
+ checking_repo: "Checking CocoaPods private repo '%{repo_name}'..."
120
+ pod_repo_list_failed: "❌ Error: Failed to execute 'pod repo list'. Please ensure CocoaPods is installed and in your PATH."
121
+ error_details: "Details: %{message}"
122
+ pod_repo_list_warning: "⚠️ Warning: 'pod repo list' command returned the following information:\n%{message}"
123
+ repo_exists_updating: "✅ CocoaPods private repo '%{repo_name}' already exists. Updating..."
124
+ repo_update_success: "🎉 Repo '%{repo_name}' updated successfully."
125
+ validating_repo: "Validating repo '%{repo_name}' validity (pod repo lint)..."
126
+ repo_validation_success: "✅ Repo '%{repo_name}' validated successfully."
127
+ repo_validation_failed: "⚠️ Warning: Repo '%{repo_name}' validation failed. There might be Podspec or Git repo issues."
128
+ lint_details: "Details:\n%{message}"
129
+ repo_update_failed: "❌ Error: Failed to update repo '%{repo_name}'. Please check logs for network or repo issues."
130
+ repo_not_exists_adding: "➕ CocoaPods private repo '%{repo_name}' does not exist. Adding..."
131
+ repo_add_success: "🎉 Repo '%{repo_name}' added successfully."
132
+ validating_new_repo: "Validating newly added repo '%{repo_name}' validity (pod repo lint)..."
133
+ new_repo_validation_success: "✅ New repo '%{repo_name}' validated successfully."
134
+ new_repo_validation_failed: "⚠️ Warning: Newly added repo '%{repo_name}' validation failed. Please check Git URL or repo content."
135
+ lint_details_new_repo: "Details:\n%{message}" # 可以与 lint_details 合并,如果内容完全一致
136
+ repo_add_failed: "❌ Error: Failed to add repo '%{repo_name}'."
137
+ add_failure_reasons: "Please check: 1. Is the Git URL correct (%{repo_url})? 2. Is your network connection stable? 3. Are there Git authentication issues?"
138
+ pod_command_not_found: "❌ Error: 'pod' command not found. Please ensure CocoaPods is installed and its executable is in your system PATH."
139
+ unknown_error: "❌ An unknown error occurred: %{message}"
140
+ stack_trace: "Stack trace:\n%{trace}"
@@ -0,0 +1,144 @@
1
+ zh-Hans:
2
+ mpaas:
3
+ common:
4
+ success: "操作成功完成。"
5
+ error: "发生错误:%<message>s"
6
+ warning: "警告:%<message>s"
7
+ commands:
8
+ set_lang:
9
+ language_code_required: "需要一个语言代码(例如:en, zh-Hans)。"
10
+ success_message: "MPAAS 插件的输出语言已设置为“%<lang_code>s”。"
11
+ restart_note: "此设置将应用于所有后续的 MPAAS 命令和钩子输出。"
12
+ unsupported_language: "不支持的语言代码“%<lang_code>s”。请从支持的语言中选择。"
13
+ set_lang:
14
+ language_code_required: "需要一个语言代码(例如:en, zh-Hans)。"
15
+ success_message: "MPAAS 插件的输出语言已设置为“%<lang_code>s”。"
16
+ restart_note: "此设置将应用于所有后续的 MPAAS 命令和钩子输出。"
17
+ unsupported_language: "不支持的语言代码“%<lang_code>s”。请从支持的语言中选择。"
18
+ hooks: # 新增钩子相关翻译
19
+ check_repo_exists: "检查 mPaaS repo 是否存在 ..."
20
+ add_repo: "添加 mPaaS repo"
21
+ mp_nebula_conflict: "MPNebulaSDKPlugins 和 NebulaSDKPlugins 同时存在!请去除 MPNebulaSDKPlugins!"
22
+ not_found_in_baseline: "%{name} : %{version} 没有在 %{baseline_to_be_checked} 里发现"
23
+ start_processing_target: "开始处理 %{target_name}"
24
+ no_config_file_found: "No config file found !!! ,请检查工程根目录下是否存在配置文件, 格式 xxxxx-xxxxx-iOS.config"
25
+ resource_add_note: "resource 要加一下" # 出现两次,只写一个键
26
+ pch_file_not_in_support: "pch文件并不在support下面"
27
+ no_framework_modules_added: "不添加框架模块了,测试用!"
28
+ report_buried_points: "上报埋点"
29
+ post_install:
30
+ start: "MPAAS 后置安装钩子已启动。"
31
+ processing: "正在为项目“%<project_name>s”处理 MPAAS 配置..."
32
+ finished: "MPAAS 后置安装配置完成。"
33
+ pre_install:
34
+ preparing: "MPAAS 前置安装钩子:正在准备安装。"
35
+ install_new:
36
+ meta_config_note: "兼容下多target的情况"
37
+ # 从 lib/cocoapods-mPaaS/localization.rb
38
+ localization:
39
+ file_utils_desc: "用于创建目录。"
40
+ default_fallback_lang: "默认回退语言。"
41
+ ensure_dir_exists: "确保目录存在。"
42
+ enter_t_method: "--- 进入 t 方法 ---"
43
+ key_received: "接收到的键 (key): '%{key}'"
44
+ options_received: "接收到的选项 (options): %{options}"
45
+ path_elements_from_key: "从键中解析出的路径元素: %{path_elements}"
46
+ actual_current_lang_determined: "确定的实际当前语言: '%{lang}'"
47
+ translations_not_loaded_try_fallback: "'%{lang}' 的翻译未直接加载。尝试回退语言。"
48
+ initial_lookup_hash_set_to_content: "初始查找哈希设置为 '%{lang}' 键的内容: %{hash_preview}..."
49
+ initial_lookup_hash_set_to_fallback_content: "初始查找哈希设置为回退语言 '%{lang}' 键的内容: %{hash_preview}..."
50
+ error_no_valid_root_lang_key: "!!! 错误: 在加载的翻译中,找不到 '%{lang}' 或回退语言的有效根语言键。"
51
+ warn_no_valid_root_lang_key: "在加载的翻译中,找不到 '%{key}' 的有效根语言键。"
52
+ level_looking_for_element: "级别 %{level}: 查找元素 '%{element}'"
53
+ element_found_current_hash: "找到元素 '%{element}'。当前哈希/值: %{hash_preview}..."
54
+ error_key_element_not_found: "!!! 错误: 在此级别未找到键元素 '%{element}'。"
55
+ current_hash_lookup_failed: "!!! 查找失败时的当前哈希: %{hash}"
56
+ full_key_lookup_path: "!!! 完整的键查找路径: '%{key}'"
57
+ warn_missing_translation_key_for_lang: "语言 '%{lang}' 缺少翻译键 '#{key}'。"
58
+ final_value_found: "为键 '%{key}' 找到的最终值: %{value}"
59
+ successfully_interpolated_string: "成功插值字符串: '%{result}'"
60
+ error_sprintf_interpolation_failed: "!!! 错误: 键 '%{key}' 的 sprintf 插值失败。错误: %{error_message}"
61
+ warn_interpolation_failed: "翻译 '%{key}' 的插值失败。错误: %{error_message}"
62
+ error_translation_not_string: "!!! 错误: 键 '#{key}' 的翻译不是字符串。类型: %{type}"
63
+ warn_translation_not_string: "翻译 '#{key}' 不是字符串。"
64
+ exit_t_method: "--- 退出 t 方法 ---"
65
+
66
+ # 从 lib/cocoapods-mPaaS/mPaaSPodfile.rb
67
+ podfile:
68
+ execute_error: "执行 Podfile 时出现错误:%{message}"
69
+ error_stack_trace: "错误堆栈追踪:\n%{backtrace}"
70
+
71
+ # 从 lib/cocoapods-mPaaS/checkUpdateTools.rb
72
+ update_check:
73
+ start_check: "开始检查更新 ..."
74
+ check_finished: "检查更新结束"
75
+
76
+ # 从 lib/cocoapods-mPaaS/module_config.rb
77
+ module_config:
78
+ comment_out_original: "把原来的注释掉并写入文件"
79
+
80
+ # 从 lib/cocoapods-mPaaS/baselineTools.rb
81
+ baseline_tools:
82
+ supplement_version_code: "补充 version_code"
83
+
84
+ # 从 lib/cocoapods-mPaaS/command/mpaas/init.rb
85
+ init_command:
86
+ all_targets_desc: "为所有 target 都判断添加 mPaaS 的配置"
87
+ check_config_file_exists: "检查 config 文件是否存在 ..."
88
+ check_process_podfile: "检查处理 Podfile ..."
89
+ replace_baseline_note: "#请将 x.x.x 替换成真实基线版本"
90
+ configuration_complete: "配置完成"
91
+
92
+ # 从 lib/cocoapods-mPaaS/command/mpaas/local_command.rb
93
+ local_command:
94
+ require_localization: "确保引入了本地化模块"
95
+ abstract_command_note: "这是一个抽象命令,不能直接运行"
96
+ set_lang_class_note: "注意这里是继承自 MPAAS,而不是直接继承 Command"
97
+ get_arg_lang_code: "获取第一个非选项参数作为语言代码"
98
+ call_super_initialize: "调用父类的 initialize"
99
+
100
+ # 从 lib/cocoapods-mPaaS/command/mpaas/update.rb
101
+ update_command:
102
+ update_all_desc: "更新所有 (baseline list、mPaaS repo 和插件本身)"
103
+ execute_plugin_install_script: "1. 执行 CocoaPods-mPaaS 插件安装脚本"
104
+ update_mpaas_repo: "2. 更新 mPaaS repo"
105
+ update_local_baseline: "3. 更新 mPaaS 本地基线"
106
+ update_mpaas_repo_second: "1. 更新 mPaaS repo" # 重复
107
+ update_local_baseline_second: "2. 更新 mPaaS 本地基线" # 重复
108
+
109
+ # 从 lib/cocoapods-mPaaS/xcode_helper.rb
110
+ xcode_helper:
111
+ flags_may_be_string: "有可能是string"
112
+ delete_existing_flag: "已经有的删除"
113
+
114
+ # 从 lib/cocoapods-mPaaS/dsl.rb
115
+ dsl:
116
+ replace_baseline_version_note: "请将 'x.x.x' 替换成真实基线版本, 比如 '10.1.60'"
117
+ use_global_default_baseline: "请使用全局默认标识 mPaaS_baseline"
118
+ mpaas_pod_deprecated_warning: "mPaaS_pod '%{name}', '%{version}' 写法即将废弃! (请直接使用 mPaaS_pod '%{name}',无需单独指定版本号,请删除后面版本号)"
119
+ specify_global_default_baseline_warning: "请指定全局默认基线(版本号) mPaaS_baseline, 如果未找到,可通过 'pod mpaas init' 命令添加,更多信息可参考文档 (https://tech.antfin.com/docs/2/106682)"
120
+ version_not_found_for_pod: "当前 %{name} : %{current_version} 找不到版本 ! 请在 mPaaS_pod 后指定版本,或者使用全局默认标识 mPaaS_baseline"
121
+ sorry_version_not_found: "Sorry, 没有找到 %{pod_name} 的版本 !!!请联系 mPaaS 支持人员处理"
122
+ repo_manager:
123
+ checking_repo: "正在检查 CocoaPods 私有仓库 '%{repo_name}'..."
124
+ pod_repo_list_failed: "❌ 错误:执行 'pod repo list' 失败。请确保 CocoaPods 已正确安装并在 PATH 中。"
125
+ error_details: "详细错误信息:\n%{message}"
126
+ pod_repo_list_warning: "⚠️ 警告:'pod repo list' 命令返回了以下信息:\n%{message}"
127
+ repo_exists_updating: "✅ CocoaPods 私有仓库 '%{repo_name}' 已经存在。正在更新..."
128
+ repo_update_success: "🎉 仓库 '%{repo_name}' 更新成功。"
129
+ validating_repo: "正在验证仓库 '%{repo_name}' 的有效性 (pod repo lint)..."
130
+ repo_validation_success: "✅ 仓库 '%{repo_name}' 验证通过。"
131
+ repo_validation_failed: "⚠️ 警告:仓库 '%{repo_name}' 验证失败。可能存在 Podspec 或 Git 仓库问题。"
132
+ lint_details: "详细 Lint 信息:\n%{message}"
133
+ repo_update_failed: "❌ 错误:更新仓库 '%{repo_name}' 失败。请检查日志,可能是网络问题或仓库本身有问题。"
134
+ repo_not_exists_adding: "➕ CocoaPods 私有仓库 '%{repo_name}' 不存在。正在添加..."
135
+ repo_add_success: "🎉 仓库 '%{repo_name}' 添加成功。"
136
+ validating_new_repo: "正在验证新添加仓库 '%{repo_name}' 的有效性 (pod repo lint)..."
137
+ new_repo_validation_success: "✅ 新仓库 '%{repo_name}' 验证通过。"
138
+ new_repo_validation_failed: "⚠️ 警告:新添加仓库 '%{repo_name}' 验证失败。请检查 Git URL 或仓库内容。"
139
+ lint_details_new_repo: "详细 Lint 信息:\n%{message}"
140
+ repo_add_failed: "❌ 错误:添加仓库 '%{repo_name}' 失败。"
141
+ add_failure_reasons: "请检查:1. Git URL 是否正确 (%{repo_url})。 2. 网络连接是否正常。 3. 是否有 Git 认证问题。"
142
+ pod_command_not_found: "❌ 错误:无法找到 'pod' 命令。请确保 CocoaPods 已安装,并且其可执行文件在您的系统 PATH 中。"
143
+ unknown_error: "❌ 发生未知错误:%{message}"
144
+ stack_trace: "堆栈信息:\n%{trace}"