Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count untraced errors in make.py #5265

Merged
merged 2 commits into from
Jun 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions tools/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

###############################################################################

__version__ = "0.8"
__version__ = "0.9"

import sys

Expand Down Expand Up @@ -248,7 +248,7 @@ def find_depbo_tools(regKey):
winreg.CloseKey(k)
print("Found pboproject.")
except:
print_error("ERROR: Could not find pboProject.")
print_error("Could not find pboProject.")

try:
k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\rapify")
Expand Down Expand Up @@ -308,8 +308,10 @@ def color(color):

def print_error(msg):
color("red")
print ("ERROR: {}".format(msg))
print("ERROR: {}".format(msg))
color("reset")
global printedErrors
printedErrors += 1

def print_green(msg):
color("green")
Expand Down Expand Up @@ -808,6 +810,10 @@ def main(argv):
global pbo_name_prefix
global ciBuild
global missingFiles
global failedBuilds
global printedErrors

printedErrors = 0

if sys.platform != "win32":
print_error("Non-Windows platform (Cygwin?). Please re-run from cmd.")
Expand Down Expand Up @@ -1223,7 +1229,7 @@ def main(argv):

except:
raise
print_error("ERROR: Could not copy module to work drive. Does the module exist?")
print_error("Could not copy module to work drive. Does the module exist?")
input("Press Enter to continue...")
print("Resuming build...")
continue
Expand All @@ -1244,7 +1250,7 @@ def main(argv):
os.remove(f)
except:
raise
print_error("ERROR: Could not copy module to work drive. Does the module exist?")
print_error("Could not copy module to work drive. Does the module exist?")
input("Press Enter to continue...")
print("Resuming build...")
continue
Expand Down Expand Up @@ -1484,24 +1490,23 @@ def main(argv):
except:
print_error("Could not copy files. Is Arma 3 running?")

if len(failedBuilds) > 0 or len(missingFiles) > 0:
tracedErrors = len(failedBuilds) + len(missingFiles)
if printedErrors > 0: # printedErrors includes tracedErrors
printedOnlyErrors = printedErrors - tracedErrors
print()
print_error("Failed with {} errors.".format(printedErrors))
if len(failedBuilds) > 0:
print()
print_error("Build failed! {} PBOs failed!".format(len(failedBuilds)))
for failedBuild in failedBuilds:
print("- {} failed.".format(failedBuild))

print("- {} build failed!".format(failedBuild))
if len(missingFiles) > 0:
missingFiles = set(missingFiles)
print()
print_error("Missing files! {} files not found!".format(len(missingFiles)))
for missingFile in missingFiles:
print("- {} failed.".format(missingFile))

sys.exit(1)
print("- {} not found!".format(missingFile))
if printedOnlyErrors > 0:
print_yellow("- {} untraced error(s)!".format(printedOnlyErrors))
else:
print_green("\nCompleted with 0 errors.")


if __name__ == "__main__":
start_time = timeit.default_timer()
main(sys.argv)
Expand Down