Commit d6389956 authored by Jack Jansen's avatar Jack Jansen

Don't generate project if the XML file already exists and is identical to what...

Don't generate project if the XML file already exists and is identical to what we've generated. Overridable with a "force" argument to mkproject().
parent 0c94724c
......@@ -4,7 +4,7 @@ import os
import AppleEvents
import macfs
def mkproject(outputfile, modulename, settings):
def mkproject(outputfile, modulename, settings, force=0):
#
# Copy the dictionary
#
......@@ -29,6 +29,14 @@ def mkproject(outputfile, modulename, settings):
#
xmlbuilder = cwxmlgen.ProjectBuilder(dictcopy)
xmlbuilder.generate()
if not force:
# check whether it is the same as it was
if os.path.exists(dictcopy['mac_projectxmlname']):
fp = open(dictcopy['mac_projectxmlname'])
data = fp.read()
fp.close()
if data == dictcopy["tmp_projectxmldata"]:
return
fp = open(dictcopy['mac_projectxmlname'], "w")
fp.write(dictcopy["tmp_projectxmldata"])
fp.close()
......
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