pindo 4.6.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. data/bin/pindo +35 -0
  3. data/lib/pindo/base/aeshelper.rb +31 -0
  4. data/lib/pindo/base/deviceinfo.rb +90 -0
  5. data/lib/pindo/base/executable.rb +224 -0
  6. data/lib/pindo/base/githelper.rb +489 -0
  7. data/lib/pindo/base/hashhelper.rb +134 -0
  8. data/lib/pindo/base/plaininformative.rb +15 -0
  9. data/lib/pindo/base/plistbuddyexecutable.rb +121 -0
  10. data/lib/pindo/base/standarderror.rb +14 -0
  11. data/lib/pindo/client/applovinclient.rb +156 -0
  12. data/lib/pindo/client/aws3sclient.rb +183 -0
  13. data/lib/pindo/client/bossclient.rb +229 -0
  14. data/lib/pindo/client/bossconfigclient.rb +175 -0
  15. data/lib/pindo/client/giteeclient.rb +65 -0
  16. data/lib/pindo/client/httpclient.rb +40 -0
  17. data/lib/pindo/client/pgyerclient.rb +439 -0
  18. data/lib/pindo/client/tgateclient.rb +103 -0
  19. data/lib/pindo/command.rb +101 -0
  20. data/lib/pindo/config/pindoconfig.rb +439 -0
  21. data/lib/pindo/config/pindouserlocalconfig.rb +81 -0
  22. data/lib/pindo/deploy/Fastfile +233 -0
  23. data/lib/pindo/deploy/build.rb +167 -0
  24. data/lib/pindo/deploy/bundleid.rb +245 -0
  25. data/lib/pindo/deploy/cert.rb +508 -0
  26. data/lib/pindo/deploy/check.rb +79 -0
  27. data/lib/pindo/deploy/configproj.rb +89 -0
  28. data/lib/pindo/deploy/confusecode.rb +248 -0
  29. data/lib/pindo/deploy/confuseproj.rb +112 -0
  30. data/lib/pindo/deploy/fabric.rb +58 -0
  31. data/lib/pindo/deploy/getitcinfo.rb +248 -0
  32. data/lib/pindo/deploy/iap.rb +796 -0
  33. data/lib/pindo/deploy/initconfig.rb +128 -0
  34. data/lib/pindo/deploy/itcapp.rb +147 -0
  35. data/lib/pindo/deploy/itcinfo.rb +369 -0
  36. data/lib/pindo/deploy/pem.rb +55 -0
  37. data/lib/pindo/deploy/pullconfig.rb +46 -0
  38. data/lib/pindo/deploy/pushconfig.rb +83 -0
  39. data/lib/pindo/deploy/quswark.rb +146 -0
  40. data/lib/pindo/deploy/quswauth.rb +67 -0
  41. data/lib/pindo/deploy/reportbug.rb +135 -0
  42. data/lib/pindo/deploy/resign.rb +338 -0
  43. data/lib/pindo/deploy/tag.rb +108 -0
  44. data/lib/pindo/deploy/updateconfig.rb +129 -0
  45. data/lib/pindo/deploy/uploadipa.rb +63 -0
  46. data/lib/pindo/deploy.rb +44 -0
  47. data/lib/pindo/dev/autobuild.rb +204 -0
  48. data/lib/pindo/dev/autoresign.rb +186 -0
  49. data/lib/pindo/dev/confusecode.rb +127 -0
  50. data/lib/pindo/dev/confuseproj.rb +111 -0
  51. data/lib/pindo/dev/createbuild.rb +159 -0
  52. data/lib/pindo/dev/debug.rb +141 -0
  53. data/lib/pindo/dev/pub.rb +171 -0
  54. data/lib/pindo/dev/renewcert.rb +142 -0
  55. data/lib/pindo/dev.rb +23 -0
  56. data/lib/pindo/env/dreamstudio.rb +53 -0
  57. data/lib/pindo/env/flutter.rb +59 -0
  58. data/lib/pindo/env/flutter.sh +116 -0
  59. data/lib/pindo/env/quarkenv.rb +58 -0
  60. data/lib/pindo/env/swarkenv.rb +62 -0
  61. data/lib/pindo/env/workhard.rb +56 -0
  62. data/lib/pindo/env.rb +17 -0
  63. data/lib/pindo/ipa/autoresign.rb +188 -0
  64. data/lib/pindo/ipa/import.rb +261 -0
  65. data/lib/pindo/ipa/output.rb +396 -0
  66. data/lib/pindo/ipa.rb +22 -0
  67. data/lib/pindo/lib/forcepush.rb +159 -0
  68. data/lib/pindo/lib/lint.rb +115 -0
  69. data/lib/pindo/lib/push.rb +143 -0
  70. data/lib/pindo/lib/update.rb +75 -0
  71. data/lib/pindo/lib.rb +18 -0
  72. data/lib/pindo/module/appselect.rb +200 -0
  73. data/lib/pindo/module/appstore_in_app_purchase.rb +1803 -0
  74. data/lib/pindo/module/appstore_metadata_connect_api_helper.rb +12 -0
  75. data/lib/pindo/module/appstore_metadata_fastlane_helper.rb +922 -0
  76. data/lib/pindo/module/buildconfighelper.rb +13 -0
  77. data/lib/pindo/module/buildhelper.rb +76 -0
  78. data/lib/pindo/module/commonconfuseproj.rb +271 -0
  79. data/lib/pindo/module/config_project.sh +143 -0
  80. data/lib/pindo/module/configprojhelper.rb +631 -0
  81. data/lib/pindo/module/iap_tier.json +813 -0
  82. data/lib/pindo/module/icon_contents.json +116 -0
  83. data/lib/pindo/module/imessage_icon.json +91 -0
  84. data/lib/pindo/module/imgset_contents.json +21 -0
  85. data/lib/pindo/module/launchimg_contents.json +21 -0
  86. data/lib/pindo/module/pemcreate.rb +63 -0
  87. data/lib/pindo/module/pgyerhelper.rb +339 -0
  88. data/lib/pindo/module/xcodebuildpre.rb +258 -0
  89. data/lib/pindo/module/xcodehelper.rb +521 -0
  90. data/lib/pindo/options/appconfigoptions.rb +23 -0
  91. data/lib/pindo/options/deployoptions.rb +363 -0
  92. data/lib/pindo/pgyer/apptest.rb +104 -0
  93. data/lib/pindo/pgyer/comment.rb +95 -0
  94. data/lib/pindo/pgyer/download.rb +105 -0
  95. data/lib/pindo/pgyer/login.rb +61 -0
  96. data/lib/pindo/pgyer/upload.rb +234 -0
  97. data/lib/pindo/pgyer.rb +17 -0
  98. data/lib/pindo/repo/clone.rb +78 -0
  99. data/lib/pindo/repo/create.rb +55 -0
  100. data/lib/pindo/repo/login.rb +64 -0
  101. data/lib/pindo/repo/search.rb +60 -0
  102. data/lib/pindo/repo.rb +16 -0
  103. data/lib/pindo/setup.rb +60 -0
  104. data/lib/pindo/upgrade.rb +56 -0
  105. data/lib/pindo/utils/applovin.rb +213 -0
  106. data/lib/pindo/utils/boss.rb +209 -0
  107. data/lib/pindo/utils/clearcert.rb +60 -0
  108. data/lib/pindo/utils/device.rb +279 -0
  109. data/lib/pindo/utils/icon.rb +91 -0
  110. data/lib/pindo/utils/icon.sh +133 -0
  111. data/lib/pindo/utils/podindex.rb +56 -0
  112. data/lib/pindo/utils/podindex.sh +30 -0
  113. data/lib/pindo/utils/renewproj.rb +146 -0
  114. data/lib/pindo/utils/tgate.rb +159 -0
  115. data/lib/pindo/utils/xcassets.rb +46 -0
  116. data/lib/pindo/utils/xcassets.sh +88 -0
  117. data/lib/pindo/utils.rb +29 -0
  118. data/lib/pindo/version.rb +110 -0
  119. data/lib/pindo.rb +34 -0
  120. metadata +364 -0
@@ -0,0 +1,159 @@
1
+ require 'fileutils'
2
+ require 'match'
3
+ require 'pindo/client/giteeclient'
4
+
5
+ module Pindo
6
+ class Command
7
+ class Dev < Command
8
+ class Createbuild < Dev
9
+
10
+ include Appselect
11
+ include Buildconfighelper
12
+
13
+
14
+ self.summary = '创建工程编译选项'
15
+
16
+ self.description = <<-DESC
17
+
18
+ 创建工程编译选项, 用法:pindo dev createbuild,按照提示填写。创建完成之后, 使用pindo dev autobuild编译时可以选择创建好的编译选项
19
+
20
+ DESC
21
+
22
+ self.arguments = [
23
+
24
+ ]
25
+
26
+ def self.options
27
+ [
28
+ ['--deploy', '默认用开发的bundle id,使用--deploy设置使用发布bundle id来重签名, 用法: --deploy'],
29
+ ].concat(super)
30
+ end
31
+
32
+ def initialize(argv)
33
+ @args_deploy_flag = argv.flag?('deploy', false)
34
+ super
35
+ end
36
+
37
+ def validate!
38
+ super
39
+
40
+ @app_type = ask('App的代号(必填): ')
41
+ help! '需要一个唯一的代号' if @app_type.nil? || @app_type.empty?
42
+
43
+ @platform_name = ask('使用的Boss平台名称(必填): ')
44
+ help! '需要指定Boss平台' if @platform_name.nil? || @platform_name.empty?
45
+ @git_repo_name = @platform_name
46
+
47
+ @app_desc = ask('请填写App代号的描述(可不填): ')
48
+
49
+
50
+
51
+ @selected_bundleid= nil
52
+ if @args_deploy_flag
53
+ @selected_bundleid = get_selected_deploy_bundleid()
54
+ else
55
+ @selected_bundleid = get_selected_dev_bundleid()
56
+ end
57
+
58
+ puts "选择使用的bundle id: #{@selected_bundleid}"
59
+
60
+ end
61
+
62
+ def run
63
+
64
+ @gitee_client = GiteeClient.new(access_token:pindo_single_config.gitee_api_key)
65
+ pindo_setting_dir = pindo_single_config.pindo_env_configdir
66
+
67
+ setting_file = 'dev_build_setting.json'
68
+ if @args_deploy_flag
69
+ setting_file = 'deploy_build_setting.json'
70
+ end
71
+
72
+ setting_file_fullname = File.join(pindo_setting_dir, setting_file)
73
+ setting_file_json = JSON.parse(File.read(setting_file_fullname))
74
+ if setting_file_json[@app_type]
75
+ answer = agree("输入的App代号已存,重新创建?(Y/n):")
76
+ unless answer
77
+ raise Informative, "输入的App代号已存在!!!"
78
+ end
79
+ end
80
+
81
+ puts "========================="
82
+ puts "========================="
83
+ puts
84
+ puts
85
+ puts "App的代号: #{@app_type}"
86
+ puts "Boss平台名称: #{@platform_name}"
87
+ puts "App选择的bundle id: #{@selected_bundleid}"
88
+ puts "仓库名称: #{@git_repo_name}"
89
+ puts "App的描述: #{@app_desc}"
90
+ puts
91
+
92
+ answer = agree("请确认上面信息是否正确(Y/n):")
93
+ unless answer
94
+ raise Informative, "重新输入 !!!"
95
+ end
96
+
97
+ args_temp = [@git_repo_name]
98
+ args_temp << "--test"
99
+ Pindo::Command::Deploy::Initconfig::run(args_temp)
100
+
101
+ modify_build_setting
102
+
103
+ modify_build_config_json
104
+
105
+ end
106
+
107
+
108
+
109
+ def modify_build_setting
110
+
111
+ pindo_setting_dir = clone_pindo_env_config_repo(force_delete:false)
112
+ setting_file = 'dev_build_setting.json'
113
+ if @args_deploy_flag
114
+ setting_file = 'deploy_build_setting.json'
115
+ end
116
+ setting_file_fullname = File.join(pindo_setting_dir, setting_file)
117
+ setting_file_json = JSON.parse(File.read(setting_file_fullname))
118
+ setting_file_json[@app_type] = {}
119
+ setting_file_json[@app_type]['git_repo_name'] = @git_repo_name
120
+ setting_file_json[@app_type]['build_desc'] = @app_desc
121
+ setting_file_json = Hash[setting_file_json.sort]
122
+ File.open(setting_file_fullname, "w") do |f|
123
+ f.write(JSON.pretty_generate(setting_file_json))
124
+ end
125
+
126
+ git_addpush_repo(path:pindo_setting_dir, message:"add app_type: #{@app_type}", commit_file_params:[setting_file])
127
+ end
128
+
129
+ def modify_build_config_json
130
+
131
+ pindo_dir = pindo_single_config.pindo_dir
132
+ app_config_dir = File.join(pindo_dir, @git_repo_name)
133
+
134
+ selected_config_dir = clong_buildconfig_repo(repo_name: @selected_bundleid)
135
+ if File.exist?(File.join(selected_config_dir, "config.json"))
136
+ FileUtils.cp_r(File.join(selected_config_dir, "config.json"), app_config_dir)
137
+ end
138
+
139
+ app_config_file = File.join(app_config_dir, "config.json")
140
+ app_config_json = JSON.parse(File.read(app_config_file))
141
+
142
+ app_config_json = app_config_json || {}
143
+ app_config_json["project_info"]["app_type"] = @app_type
144
+ app_config_json["project_info"]["app_desc"] = @app_desc
145
+ app_config_json["app_setting"]["kGUKeyAppPlatform"] = @platform_name
146
+
147
+ File.open(app_config_file, "w") do |f|
148
+ f.write(JSON.pretty_generate(app_config_json))
149
+ end
150
+ git_addpush_repo(path:app_config_dir, message:"更新配置")
151
+ end
152
+
153
+
154
+
155
+ end
156
+ end
157
+ end
158
+ end
159
+
@@ -0,0 +1,141 @@
1
+ require 'fileutils'
2
+
3
+ module Pindo
4
+ class Command
5
+ class Dev < Command
6
+ class Debug < Dev
7
+
8
+ include Appselect
9
+
10
+ include Xcodebuildpre
11
+
12
+ self.summary = '更新证书并使用新证书设置工程'
13
+
14
+ self.description = <<-DESC
15
+
16
+ 更新证书并使用新证书设置工程,如果在工程目录下执行,会自动给工程设置对应的证书。用法:pindo dev debug 默认使用开发bundle id, 使用dev证书。
17
+ 使用发布相关bundle id 或者adhoc证书,用法如下:pindo dev debug --deploy --adhoc
18
+
19
+ DESC
20
+
21
+ self.arguments = [
22
+
23
+ ]
24
+
25
+ def self.options
26
+ [
27
+ ['--deploy', '默认用开发的bundle id,使用--deploy设置使用发布bundle id'],
28
+ ['--adhoc', '默认用dev证书,使用--adhoc设置使用adhoc证书'],
29
+ ].concat(super)
30
+ end
31
+
32
+ def initialize(argv)
33
+ @args_adhoc_flag = argv.flag?('adhoc', false)
34
+ @args_deploy_flag = argv.flag?('deploy', false)
35
+ super
36
+ end
37
+
38
+
39
+ def run
40
+
41
+ mainapp_bundleid= nil
42
+ if @args_deploy_flag
43
+ mainapp_bundleid = get_selected_deploy_bundleid()
44
+ else
45
+ mainapp_bundleid = get_selected_dev_bundleid()
46
+ end
47
+ puts "选择使用的bundle id: #{mainapp_bundleid}"
48
+
49
+ args_temp = []
50
+ args_temp << mainapp_bundleid
51
+ Pindo::Command::Deploy::Pullconfig::run(args_temp)
52
+
53
+
54
+ project_dir = Dir.pwd
55
+ Dir.chdir(project_dir)
56
+ config_json_file = File.join(project_dir,"config.json")
57
+ Debug::modify_cert_with_project(project_dir:project_dir, config_file:config_json_file)
58
+
59
+ args_temp = []
60
+ if @args_adhoc_flag
61
+ args_temp << "--adhoc"
62
+ else
63
+ args_temp << "--dev"
64
+ end
65
+
66
+ Pindo::Command::Deploy::Cert::run(args_temp)
67
+
68
+ end
69
+
70
+ def self.modify_cert_with_project(project_dir:nil, config_file:nil)
71
+
72
+
73
+ project_fullname = ""
74
+ Dir.foreach(project_dir) do |file|
75
+ if file =~ /(.*).xcodeproj/
76
+ project_fullname = file
77
+ break;
78
+ end
79
+ end
80
+
81
+ if !project_fullname.nil?
82
+ proj_name = File.basename(project_fullname, ".xcodeproj")
83
+
84
+ entitlements_plist_path = File.join(project_dir, proj_name + ".entitlements")
85
+ proj_fullname = File.join(project_dir, proj_name) + ".xcodeproj"
86
+ if File.exist?(proj_fullname)
87
+ project_obj = Xcodeproj::Project.open(proj_fullname)
88
+ project_obj.targets.each do |target|
89
+ if target.product_type.to_s.eql?("com.apple.product-type.application") then
90
+ temp_entitlements_file = target.build_configurations.first.build_settings['CODE_SIGN_ENTITLEMENTS']
91
+ if !temp_entitlements_file.nil? && !temp_entitlements_file.empty?
92
+ entitlements_plist_path = File.join(project_dir, temp_entitlements_file)
93
+ end
94
+ end
95
+ end
96
+ end
97
+
98
+ # puts entitlements_plist_path
99
+ if File.exist?(entitlements_plist_path)
100
+
101
+ config_json = nil
102
+ if File.exist?(config_file)
103
+ config_json = JSON.parse(File.read(config_file))
104
+ end
105
+
106
+ entitlements_plist_dict = Xcodeproj::Plist.read_from_path(entitlements_plist_path)
107
+
108
+ if entitlements_plist_dict["com.apple.developer.icloud-container-identifiers"].nil?
109
+ if !config_json.nil? && !config_json["app_info"]['app_icloud_id'].nil?
110
+ config_json["app_info"].delete('app_icloud_id')
111
+ end
112
+ end
113
+
114
+
115
+ if entitlements_plist_dict["com.apple.security.application-groups"].nil?
116
+ if !config_json.nil? && !config_json["app_info"]['app_group_id'].nil?
117
+ config_json["app_info"].delete('app_group_id')
118
+ end
119
+ end
120
+
121
+ # puts JSON.pretty_generate(config_json)
122
+ if !config_json.nil?
123
+ File.open(config_file, "w") do |f|
124
+ f.write(JSON.pretty_generate(config_json))
125
+ end
126
+
127
+ end
128
+
129
+ end
130
+
131
+ end
132
+
133
+
134
+ end
135
+
136
+
137
+ end
138
+ end
139
+ end
140
+ end
141
+
@@ -0,0 +1,171 @@
1
+ require 'fileutils'
2
+
3
+ module Pindo
4
+ class Command
5
+ class Dev < Command
6
+ class Pub < Dev
7
+
8
+ self.summary = '发布代码,添加tag,添加发布信息,并合并到发布分支'
9
+
10
+ self.description = <<-DESC
11
+ 发布代码,添加tag,添加发布信息,并合并到发布分支。用法:在当前代码仓库下执行pindo dev pub
12
+ DESC
13
+
14
+ self.arguments = [
15
+
16
+ ]
17
+
18
+ def self.options
19
+ [
20
+ ].concat(super)
21
+ end
22
+
23
+ def initialize(argv)
24
+
25
+ super
26
+ @additional_args = argv.remainder!
27
+ end
28
+
29
+ def run
30
+
31
+ release_branch = "master"
32
+ current_project_dir = Dir.pwd
33
+
34
+ process_need_add_files(project_dir:current_project_dir)
35
+
36
+ answer = agree("是否添加发布备注信息?(Y/n)")
37
+ if answer
38
+ add_release_info(project_dir:current_project_dir)
39
+ end
40
+
41
+ answer = agree("是否将代码合并到master分支?(Y/n)")
42
+
43
+ if answer
44
+ current_branch = git!(%W(-C #{current_project_dir} rev-parse --abbrev-ref HEAD)).strip
45
+ coding_branch = current_branch
46
+ merge_to_release_branch(project_dir:current_project_dir, release_branch:release_branch, coding_branch:coding_branch)
47
+ add_release_tag(project_dir:current_project_dir)
48
+ end
49
+
50
+
51
+ end
52
+
53
+ def add_release_info(project_dir:nil)
54
+
55
+ puts
56
+ puts "输入Release 备注:"
57
+ description = PgyerHelper.share_instace.get_description()
58
+ File.open("#{project_dir}/.release_info", 'w') { |f| f.write(description) }
59
+ git_addpush_repo(path:project_dir, message:"update release info", commit_file_params:[".release_info"])
60
+
61
+ end
62
+
63
+ def add_release_tag(project_dir:nil)
64
+
65
+ time_str = Time.now.strftime('%Y_%m_%d')
66
+ tag_name = "dev_" + time_str
67
+ remove_tag(local_repo_dir:project_dir, tag_name:tag_name)
68
+ result = add_tag(local_repo_dir:project_dir, tag_name:tag_name)
69
+
70
+ puts
71
+ puts "已经为当前仓库添加tag: #{tag_name}"
72
+ puts "仓库路径:#{project_dir}"
73
+ puts
74
+
75
+ end
76
+
77
+
78
+ def merge_to_release_branch(project_dir:nil, release_branch:nil, coding_branch:nil)
79
+
80
+ current_project_dir = project_dir
81
+
82
+
83
+ if !coding_branch.eql?(release_branch)
84
+
85
+ coding_branch_commit_id = git!(%W(-C #{current_project_dir} rev-parse #{coding_branch})).strip
86
+ release_branch_commit_id = "111"
87
+
88
+ if remote_branch_exists?(local_repo_dir: current_project_dir, branch:release_branch)
89
+ if local_branch_exists?(local_repo_dir: current_project_dir, branch:release_branch)
90
+ puts "存在#{release_branch}远程分支"
91
+ puts "存在#{release_branch}本地分支"
92
+ git!(%W(-C #{current_project_dir} checkout #{release_branch}))
93
+ else
94
+ puts "存在#{release_branch}远程分支"
95
+ puts "不存在#{release_branch}本地分支"
96
+ git!(%W(-C #{current_project_dir} checkout -b #{release_branch} origin/#{release_branch}))
97
+ end
98
+
99
+ git!(%W(-C #{current_project_dir} branch --set-upstream-to=origin/#{release_branch} #{release_branch}))
100
+ git!(%W(-C #{current_project_dir} pull))
101
+ # git!(%W(-C #{current_project_dir} merge #{coding_branch} --quiet))
102
+ res_data = Executable.capture_command('git', %W(merge #{coding_branch}), :capture => :out)
103
+
104
+ conflict_filelist = git!(%W(-C #{current_project_dir} diff --name-only --diff-filter=U --relative))
105
+ if !conflict_filelist.nil? && conflict_filelist.size > 0
106
+ puts "合并代码冲突, 冲突文件如下:"
107
+
108
+ raise Informative, "请手动处理冲突的文件!!!"
109
+
110
+ else
111
+ git!(%W(-C #{current_project_dir} push))
112
+
113
+
114
+ puts ""
115
+ puts "===================================="
116
+ puts "代码已经合并到#{release_branch}分支"
117
+ puts "===================================="
118
+ puts ""
119
+ release_branch_commit_id = git!(%W(-C #{current_project_dir} rev-parse #{release_branch})).strip
120
+ end
121
+
122
+ else
123
+ if local_branch_exists?(local_repo_dir: current_project_dir, branch:release_branch)
124
+ puts "不存在#{release_branch}远程分支"
125
+ puts "存在#{release_branch}本地分支"
126
+ git!(%W(-C #{current_project_dir} checkout #{release_branch}))
127
+ git!(%W(-C #{current_project_dir} checkout -b #{release_branch}_temp))
128
+ git!(%W(-C #{current_project_dir} checkout #{coding_branch}))
129
+ git!(%W(-C #{current_project_dir} branch -D #{release_branch}))
130
+ else
131
+ puts "不存在#{release_branch}远程分支"
132
+ puts "不存在#{release_branch}本地分支"
133
+ end
134
+
135
+ git!(%W(-C #{current_project_dir} checkout -b #{release_branch}))
136
+ git!(%W(-C #{current_project_dir} push origin #{release_branch}))
137
+ git!(%W(-C #{current_project_dir} branch --set-upstream-to=origin/#{release_branch} #{release_branch}))
138
+
139
+
140
+ puts ""
141
+ puts "===================================="
142
+ puts "代码已经合并到#{release_branch}分支"
143
+ puts "===================================="
144
+ puts ""
145
+ release_branch_commit_id = git!(%W(-C #{current_project_dir} rev-parse #{release_branch})).strip
146
+ end
147
+
148
+
149
+ git!(%W(-C #{current_project_dir} checkout #{coding_branch}))
150
+ if !release_branch_commit_id.eql?(coding_branch_commit_id)
151
+ git!(%W(-C #{current_project_dir} merge #{release_branch}))
152
+ puts
153
+ puts "已将#{release_branch}合并到#{coding_branch}"
154
+ puts
155
+ end
156
+
157
+ else
158
+ puts ""
159
+ puts "===================================="
160
+ puts "代码处于#{coding_branch}分支,无需合并"
161
+ puts "===================================="
162
+ puts ""
163
+ end
164
+
165
+ end
166
+
167
+
168
+ end
169
+ end
170
+ end
171
+ end
@@ -0,0 +1,142 @@
1
+ require 'fileutils'
2
+
3
+ module Pindo
4
+ class Command
5
+ class Dev < Command
6
+ class Renewcert < Dev
7
+
8
+ include Appselect
9
+
10
+ self.summary = '更新证书下所有的Provisioning Profile文件'
11
+
12
+ self.description = <<-DESC
13
+ 如果不存在证书,会自动生成新证书,重新生成证书下所有Provisioning Profile文件. 添加新设备或者证书过期时使用, 一般情况请勿操作!!!
14
+ 用法:pindo dev renewcert
15
+ DESC
16
+
17
+ self.arguments = [
18
+
19
+ ]
20
+
21
+ def self.options
22
+ [
23
+
24
+ ['--fast', '快速更新证书,开发用bundle id只更新dev证书,发布bundle id只更新adhoc证书'],
25
+ ['--fixedid', '重新更新bundle id的功能,检查bundle id的功能是否更新'],
26
+ ].concat(super)
27
+ end
28
+
29
+
30
+ def initialize(argv)
31
+
32
+ @fast_flag = argv.flag?('fast', false)
33
+ @fixedid_flag = argv.flag?('fixedid', false)
34
+
35
+ super
36
+
37
+ end
38
+
39
+
40
+ def run
41
+
42
+ auto_fixed_cert
43
+
44
+ end
45
+
46
+ def auto_fixed_cert
47
+
48
+
49
+ @dev_bundle_id_array = all_dev_bundleid() + all_tool_bundleid()
50
+ @deploy_bundle_id_array = all_release_bundleid()
51
+ @all_bundle_id_array = all_itc_bundleid()
52
+
53
+
54
+ fixed_bundleid = @fixedid_flag
55
+
56
+
57
+ fixed_bundleid_array = @all_bundle_id_array
58
+ puts fixed_bundleid_array
59
+
60
+ fixed_bundleid_array.each do |bundle_id|
61
+ begin
62
+ fixed_cert(bundle_id:bundle_id, fixed_bundleid:@fixedid_flag)
63
+ rescue => err
64
+ puts
65
+ puts
66
+ puts "Fixed #{bundle_id} cert---------Error-------!!!"
67
+ puts
68
+ puts
69
+ end
70
+
71
+ end
72
+
73
+ end
74
+
75
+ def fixed_cert(bundle_id:nil, fixed_bundleid: )
76
+ puts "#{bundle_id}"
77
+
78
+ args_temp = []
79
+ args_temp << "#{bundle_id}"
80
+
81
+ Pindo::Command::Deploy::Pullconfig::run(args_temp)
82
+
83
+ if fixed_bundleid
84
+ Pindo::Command::Deploy::Bundleid::run([])
85
+ end
86
+
87
+ if @fast_flag
88
+
89
+ if @dev_bundle_id_array.include?(bundle_id)
90
+ args_temp = []
91
+ args_temp << "--a=#{bundle_id}"
92
+ args_temp << "--dev"
93
+ args_temp << "--renew"
94
+ Pindo::Command::Deploy::Cert::run(args_temp)
95
+ end
96
+
97
+ if @deploy_bundle_id_array.include?(bundle_id)
98
+ args_temp = []
99
+ args_temp << "--a=#{bundle_id}"
100
+ args_temp << "--adhoc"
101
+ args_temp << "--renew"
102
+ Pindo::Command::Deploy::Cert::run(args_temp)
103
+ end
104
+
105
+ else
106
+
107
+ # args_temp = []
108
+ # args_temp << "--a=#{bundle_id}"
109
+ # args_temp << "--dev"
110
+ # args_temp << "--renew"
111
+ # Pindo::Command::Deploy::Cert::run(args_temp)
112
+
113
+ args_temp = []
114
+ args_temp << "--a=#{bundle_id}"
115
+ args_temp << "--adhoc"
116
+ args_temp << "--renew"
117
+ Pindo::Command::Deploy::Cert::run(args_temp)
118
+ end
119
+ end
120
+
121
+
122
+ def fixed_push(bundle_id:nil, fixed_bundleid: false)
123
+
124
+ Pindo::Command::Deploy::Pullconfig::run(args_temp)
125
+
126
+ args_temp = []
127
+ args_temp << "--a=#{bundle_id}"
128
+ args_temp << "--dev"
129
+ Pindo::Command::Deploy::Pem::run(args_temp)
130
+
131
+ args_temp = []
132
+ args_temp << "--a=#{bundle_id}"
133
+ args_temp << "--adhoc"
134
+ Pindo::Command::Deploy::Pem::run(args_temp)
135
+
136
+ end
137
+
138
+ end
139
+ end
140
+ end
141
+ end
142
+
data/lib/pindo/dev.rb ADDED
@@ -0,0 +1,23 @@
1
+ # require 'pindo/dev/create'
2
+
3
+
4
+ # require 'pindo/dev/confuseproj'
5
+ # require 'pindo/dev/confusecode'
6
+ # require 'pindo/dev/cert'
7
+ require 'pindo/dev/pub'
8
+ require 'pindo/dev/debug'
9
+ require 'pindo/dev/autoresign'
10
+ require 'pindo/dev/autobuild'
11
+ require 'pindo/dev/renewcert'
12
+ require 'pindo/dev/createbuild'
13
+
14
+ module Pindo
15
+ class Command
16
+
17
+ class Dev < Command
18
+ self.abstract_command = true
19
+ self.summary = '开发阶段使用的相关命令'
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,53 @@
1
+
2
+ require 'fileutils'
3
+
4
+ module Pindo
5
+ class Command
6
+ class Env < Command
7
+ class Dreamstudio < Env
8
+
9
+ self.summary = '切换到 dreamstudio 环境'
10
+
11
+ self.description = <<-DESC
12
+ 切换到 dreamstudio 环境,终端下运行: pindo env dreamstudio
13
+ DESC
14
+
15
+
16
+ self.arguments = [
17
+
18
+ ]
19
+
20
+ def self.options
21
+ [
22
+
23
+ ].concat(super)
24
+ end
25
+
26
+ def initialize(argv)
27
+ super(argv)
28
+ @additional_args = argv.remainder!
29
+ end
30
+
31
+ def validate!
32
+ super
33
+ end
34
+
35
+ def run
36
+
37
+ clone_pindo_common_config_repo(force_delete:false)
38
+
39
+ pindo_single_config.update_pindo_env(env_name:"dreamstudio_config")
40
+ Pindoconfig.reload_instance
41
+
42
+ pindo_env_dir = pindo_single_config.pindo_env_configdir
43
+ if File.exist?(pindo_env_dir)
44
+ FileUtils.rm_rf(pindo_env_dir)
45
+ end
46
+ clone_pindo_env_config_repo(force_delete:true)
47
+
48
+ end
49
+
50
+ end
51
+ end
52
+ end
53
+ end