update_versions.py does not execute if javadoc cannot be executed

This commit is contained in:
sidheshenator 2015-06-23 09:16:23 -04:00
parent f391e32f6b
commit 85ea8bc90d

View File

@ -218,10 +218,15 @@ def compare_xml(module, apiname_tag, apiname_cur):
"-newapi", newapi, "-newapi", newapi,
"-script", "-script",
null_file] null_file]
try:
jdiff = subprocess.Popen(cmd, stdout=log, stderr=log) jdiff = subprocess.Popen(cmd, stdout=log, stderr=log)
jdiff.wait() jdiff.wait()
log.close()
code = jdiff.returncode code = jdiff.returncode
except Exception:
printt("Javadoc not found. Exiting...")
exit(1)
log.close()
print("Compared XML for " + module.name) print("Compared XML for " + module.name)
if code == NO_CHANGES: if code == NO_CHANGES:
print(" No API changes") print(" No API changes")
@ -257,8 +262,12 @@ def gen_xml(path, modules, name):
"-apiname", xml_out, # leaving it in just in case it's needed once again "-apiname", xml_out, # leaving it in just in case it's needed once again
"-sourcepath", fix_path(src)] "-sourcepath", fix_path(src)]
cmd = cmd + get_packages(src) cmd = cmd + get_packages(src)
try:
jdiff = subprocess.Popen(cmd, stdout=log, stderr=log) jdiff = subprocess.Popen(cmd, stdout=log, stderr=log)
jdiff.wait() jdiff.wait()
except Exception:
printt("Javadoc not found. Exiting...")
exit(1)
log.close() log.close()
print("Generated XML for " + name + " " + module.name) print("Generated XML for " + name + " " + module.name)
sys.stdout.flush() sys.stdout.flush()
@ -633,16 +642,16 @@ def print_version_updates(modules):
output = (module.name + ":\n") output = (module.name + ":\n")
output += ("\tMajor Release:\tNo Change.\n") output += ("\tMajor Release:\tNo Change.\n")
output += ("\tSpecification:\t" + str(versions[0]) + "\t->\t" + str(versions[0].increment()) + "\n") output += ("\tSpecification:\t" + str(versions[0]) + "\t->\t" + str(versions[0].increment()) + "\n")
output += ("\tImplementation:\t" + str(versions[1]) + "\t->\t" + str(versions[1] + 1) + "\n") output += ("\tImplementation:\t" + str(versions[1]) + "\t->\t" + str(float(versions[1]) + 1) + "\n")
output += ("\n") output += ("\n")
print(output) print(output)
sys.stdout.flush() sys.stdout.flush()
f.write(output) f.write(output)
elif module.ret == NON_COMPATIBLE: elif module.ret == NON_COMPATIBLE:
output = (module.name + ":\n") output = (module.name + ":\n")
output += ("\Major Release:\t" + str(versions[2]) + "\t->\t" + str(versions[2] + 1) + "\n") output += ("\Major Release:\t" + str(versions[2]) + "\t->\t" + str(float(versions[2]) + 1) + "\n")
output += ("\tSpecification:\t" + str(versions[0]) + "\t->\t" + str(versions[0].overflow()) + "\n") output += ("\tSpecification:\t" + str(versions[0]) + "\t->\t" + str(versions[0].overflow()) + "\n")
output += ("\tImplementation:\t" + str(versions[1]) + "\t->\t" + str(versions[1] + 1) + "\n") output += ("\tImplementation:\t" + str(versions[1]) + "\t->\t" + str(float(versions[1]) + 1) + "\n")
output += ("\n") output += ("\n")
print(output) print(output)
sys.stdout.flush() sys.stdout.flush()
@ -662,7 +671,7 @@ def print_version_updates(modules):
if versions[1] is None: if versions[1] is None:
output += ("\tImplementation: None\n") output += ("\tImplementation: None\n")
else: else:
output += ("\tImplementation:\t" + str(versions[1]) + "\t->\t" + str(versions[1] + 1) + "\n") output += ("\tImplementation:\t" + str(versions[1]) + "\t->\t" + str(float(versions[1]) + 1) + "\n")
output += ("\n") output += ("\n")
print(output) print(output)
sys.stdout.flush() sys.stdout.flush()