Commit 2b6d5ff5 by sikang

update script

parent 145212d7
......@@ -202,12 +202,13 @@ class Function:
with open("/Users/connor/StudioProjects/WorkSpace/app_desc.txt", "r") as f:
file_content = f.read().replace("\n", "--line--")
index = random.randint(1, 41)
info = re.compile(r''+"@Example %d--line--(.*)@End %d" % (index,index))
info = re.compile(
r''+"@Example %d--line--(.*)@End %d" % (index, index))
desc = info.search(file_content).group()
desc = desc.replace("--line--", "\n")\
.replace("@Example %d\n" % index, "")\
.replace("@End %d"% index, "")
.replace("@End %d" % index, "")
file_name = "%s_%s"\
% (config['corp_id'], config['app_name'].replace(" ", "_"))
......@@ -300,3 +301,40 @@ class Function:
with open("/Users/connor/Documents/apks/%s.html" % file_name, "wt") as fout:
fout.write(file_content)
print("privacy done\n")
# 转移出所有素材
@staticmethod
def move_resources(config):
file_name = "%s_%s"\
% (config['corp_id'], config['app_name'].replace(" ", "_"))
target = "/Users/connor/Documents/apks"
img_path = "../../app/src/main/res/drawable-xxhdpi"
if not os.path.exists(target+"/cache"):
os.makedirs(target+"/cache")
# 移除
shutil.copy("%s/logo.png" % img_path, "%s/cache/logo.png" % target)
shutil.copy("%s/top.png" % img_path, "%s/cache/top.png" % target)
shutil.copy("%s/script/api_mapping" %
config['root'], "%s/cache/api_mapping" % target)
new_config = Function.load_properties("../../gradle.properties")
os.system("git reset --hard origin/%s" % config['git_branch'])
# 还原
shutil.copy("%s/cache/logo.png" % target, "%s/logo.png" % img_path)
shutil.copy("%s/cache/top.png" % target, "%s/top.png" % img_path)
shutil.copy("%s/cache/api_mapping" %
target, "%s/script/api_mapping" % config['root'])
Function.update_gateway(new_config)
lines = {
"app_id","\"%s\""% new_config['app_id'],
"app_name","\"%s\""% new_config['app_name'],
"signing_keyAlias","\"%s\""% new_config['signing_keyAlias'],
"signing_certificate","\"%s\""% new_config['signing_certificate'],
"signging_certificatePassword","\"%s\""% new_config['signging_certificatePassword'],
"signging_storePassword","\"%s\""% new_config['signging_storePassword'],
}
Function.update_properties(config,lines)
......@@ -21,6 +21,7 @@ print("5、pull lib_base & cash_plugin_toolbox")
print("6、commit & push lib_base")
print("7、获取签名秘钥散列")
print("8、提交一个渠道包Tag")
print("9、还原某一次提交的包名、logo、gw、name、但保持最新代码")
print("11、copy apk")
print("12、马甲包切换")
print("13、打印checklist")
......@@ -55,6 +56,10 @@ elif command == 7:
elif command == 8:
Shell.push_with_tag(config)
elif command == 9:
Shell.reset_by_pkgname(config)
Function.move_resources(config)
elif command == 11:
Function.move_apk(config)
......
......@@ -3,6 +3,18 @@ import os
class Shell:
#编译 待开发
@staticmethod
def build_release():
command = "%s\n%s\n" \
% (
"cd ../script",
"./release_builder.sh"
)
os.system(command)
#commit&push project
@staticmethod
def push_project(config):
......@@ -63,12 +75,15 @@ class Shell:
os.system(command)
#编译 待开发
#push with tag
@staticmethod
def build_release():
command = "%s\n%s\n" \
% (
"cd ../script",
"./release_builder.sh"
)
os.system(command)
def reset_by_pkgname(config):
pkgname = input("输入包名: ")
os.system("git log --grep %s"% pkgname)
print(" ")
commit_id = input("输入commit id: ")
os.system("git reset --hard %s"% commit_id)
print(" ")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment