Commit 12eb91a5 by sikang

update script

parent 28e3bd5b
......@@ -22,6 +22,5 @@
"RepaymentFragment"
],
"root": "../../app/src/main",
"manifest": "../../app/src/main/AndroidManifest.xml",
"applibroot": "../../app/src/app"
"manifest": "../../app/src/main/AndroidManifest.xml"
}
......@@ -79,43 +79,5 @@ manifest_path = os.path.join(os.getcwd(), manifest)
process_file_content(manifest_path, "AndroidManifest.xml")
#update applib
# read configs
with open('obact_lib.json', "rt") as f:
json_root = json.load(f)
activities = json_root["activities"]
source_root = json_root["applibroot"]
manifest = json_root["appmanifest"]
print("activity mapping %s"%activity_mangle_setting)
root_path = os.path.join(os.getcwd(), source_root)
# perform content replace for the files
print("processing file content...")
for root, dirs, files in os.walk(source_root):
directory = os.path.join(os.getcwd(), root)
for file in files:
if file.endswith(".java"):
# get the path of the java file
path = os.path.join(directory, file)
process_file_content(path, file)
print("processing file content done")
print("renaming files")
for root, dirs, files in os.walk(source_root):
directory = os.path.join(os.getcwd(), root)
for file in files:
if file.endswith(".java"):
name = os.path.splitext(file)[0]
if name in activity_mangle_setting:
# get the path of the java file
src = os.path.join(directory, file)
dst = os.path.join(directory, "%s.java"%activity_mangle_setting[name])
print("%s -> %s"%(src, dst))
os.rename(src, dst)
print("renaming files done")
......@@ -82,6 +82,5 @@
"root": "../../lib_base/src/main",
"manifest": "../../lib_base/src/main/AndroidManifest.xml",
"approot": "../../app/src/main",
"appmanifest": "../../app/src/main/AndroidManifest.xml",
"applibroot": "../../app/src/app"
"appmanifest": "../../app/src/main/AndroidManifest.xml"
}
......@@ -120,42 +120,3 @@ manifest_path = os.path.join(os.getcwd(), manifest)
process_file_content(manifest_path, "AndroidManifest.xml")
#update applib
# read configs
with open('obact_lib.json', "rt") as f:
json_root = json.load(f)
activities = json_root["activities"]
source_root = json_root["applibroot"]
manifest = json_root["appmanifest"]
print("activity mapping %s"%activity_mangle_setting)
root_path = os.path.join(os.getcwd(), source_root)
# perform content replace for the files
print("processing file content...")
for root, dirs, files in os.walk(source_root):
directory = os.path.join(os.getcwd(), root)
for file in files:
if file.endswith(".java"):
# get the path of the java file
path = os.path.join(directory, file)
process_file_content(path, file)
print("processing file content done")
print("renaming files")
for root, dirs, files in os.walk(source_root):
directory = os.path.join(os.getcwd(), root)
for file in files:
if file.endswith(".java"):
name = os.path.splitext(file)[0]
if name in activity_mangle_setting:
# get the path of the java file
src = os.path.join(directory, file)
dst = os.path.join(directory, "%s.java"%activity_mangle_setting[name])
print("%s -> %s"%(src, dst))
os.rename(src, dst)
print("renaming files done")
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