Skip to content

Instantly share code, notes, and snippets.

@jiemachina
Last active December 10, 2015 17:08
Show Gist options
  • Save jiemachina/4465609 to your computer and use it in GitHub Desktop.
Save jiemachina/4465609 to your computer and use it in GitHub Desktop.
channel build
#!/usr/bin/python
import os
# -*- coding: utf-8 -*-
def writeFile(filename, content):
outfile = open(filename, "w")
outfile.write(content)
outfile.close()
def build(versionString):
xmlHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
xmlResH = "<resources>\n\t"
xmlEnd = "</resources>"
f = open("channel.txt")
line= f.readline()
while line:
line = line.strip()
xmlChannel = "<string name=\"channel\"> "+ line+"</string>\n"
writeFile("res/values/channel.xml", xmlHeader + xmlResH + xmlChannel + xmlEnd)
print line
os.system("rm -rf bin")
os.system("ant release")
os.system("cp bin/readfriend-release.apk channel/readfriend-release-"+line + "-" +versionString+".apk")
line = f.readline()
f.close()
build("1.0.11");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment