Enable icu_use_data_file_flag on Android
[chromium-blink-merge.git] / third_party / tlslite / make_release.py
blobd2898798f27244c48529ec38b772a6085843732f
2 #When run on (my) windows box, this builds and cleans everything in
3 #preparation for a release.
5 import os
6 import sys
8 #Replace version strings
9 if len(sys.argv)>1:
10 oldVersion = sys.argv[1]
11 newVersion = sys.argv[2]
12 query = raw_input("Replace %s with %s?: " % (oldVersion, newVersion))
13 if query == "y":
14 #First, scan through and make sure the replacement is possible
15 for filename in ("setup.py", "tlslite\\__init__.py", "scripts\\tls.py", "scripts\\tlsdb.py"):
16 s = open(filename, "rU").read()
17 x = s.count(oldVersion)
18 if filename.endswith("__init__.py"):
19 if x != 2:
20 print "Error, old version appears in %s %s times" % (filename, x)
21 sys.exit()
22 else:
23 if x != 1:
24 print "Error, old version appears in %s %s times" % (filename, x)
25 sys.exit()
27 #Then perform it
28 for filename in ("setup.py", "tlslite\\__init__.py", "scripts\\tls.py", "scripts\\tlsdb.py"):
29 os.system("copy %s .." % filename) #save a backup copy in case something goes awry
30 s = open(filename, "r").read()
31 f = open(filename, "w")
32 f.write(s.replace(oldVersion, newVersion))
33 f.close()
36 #Make windows installers
37 os.system("del installers\*.exe")
39 #Python 2.3
40 os.system("rmdir build /s /q")
41 os.system("python23 setup.py bdist_wininst -o")
42 os.system("copy dist\* installers")
44 #Python 2.4
45 os.system("rmdir build /s /q")
46 os.system("python24 setup.py bdist_wininst -o")
47 os.system("copy dist\* installers")
50 #Make documentation
51 os.system("python23 c:\\devtools\\python23\\scripts\\epydoc.py --html -o docs tlslite")
53 #Delete excess files
54 os.system("del tlslite\\*.pyc")
55 os.system("del tlslite\\utils\\*.pyc")
56 os.system("del tlslite\\integration\\*.pyc")
57 os.system("rmdir build /s /q")
58 os.system("rmdir dist /s /q")