Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.0 KiB

  1. set wso = CreateObject("WScript.Shell")
  2. SAPIROOT = wso.ExpandEnvironmentStrings("%SAPIROOT%")
  3. function GetErrLine(logname)
  4. set fso = CreateObject("Scripting.FileSystemObject")
  5. set logfile = fso.GetFile(SAPIROOT & "\builder\logs\" & logname)
  6. set fstream = logfile.OpenAsTextStream
  7. do while fstream.AtEndOfStream <> True
  8. linein = fstream.ReadLine ' get last line in file
  9. loop
  10. fstream.Close()
  11. GetErrLine = linein
  12. end function
  13. ' format of VS6 error line is:
  14. ' all - 0 error(s), 4 warning(s)
  15. chkerrline = GetErrLine("chkbld.log")
  16. chkvals = split(chkerrline)
  17. chkerrs = chkvals(2)
  18. chkwarns = chkvals(4)
  19. wscript.echo "Debug build completed with: errors=" & chkerrs & ", warnings=" & chkwarns
  20. freerrline = GetErrLine("frebld.log")
  21. frevals = split(freerrline)
  22. freerrs = frevals(2)
  23. frewarns = frevals(4)
  24. wscript.echo "Release build completed with: errors=" & freerrs & ", warnings=" & frewarns
  25. if (chkerrs > 0 and freerrs > 0) then
  26. wscript.echo "Both builds completed with errors, build will be halted"
  27. wscript.quit -1
  28. else
  29. wscript.quit 0
  30. end if