Leaked source code of windows server 2003
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.

213 lines
13 KiB

  1. function Dialog()
  2. {
  3. // "Dialog" is an object that is used to put up dialogs to the user.
  4. this.fShowDialog = false; // true,false
  5. this.fEMailOnly = false; // true,false
  6. this.cDialogIndex = 0; // Index to keep track of wheter we've shown this dialog yet
  7. this.strTitle = ''; // Dialog Title
  8. this.strMessage = ''; // Dialog Message
  9. this.aBtnText = new Array(); // Array of button text strings
  10. this.nSecRemaining = 0; // 3000
  11. }
  12. function BuildType()
  13. {
  14. // "BuildType" is an object to describe the type of build
  15. this.strConfigLongName = ''; // ConfigLongName
  16. this.strEnviroLongName = ''; // EnviroLongName
  17. this.strConfigDescription = ''; // ConfigDescription
  18. this.strEnviroDescription = ''; // EnviroDescription
  19. this.fDistributed = false; // Indicates if this is a distributed build.
  20. this.strPostBuildMachine = ''; // PostBuildMachine
  21. }
  22. function ElapsedTimes()
  23. {
  24. // "ElapsedTimes" is an object to keep track of overall elapsed times for the build
  25. this.dateScorchStart = 'unset'; // UTC Timestamp of when the Scorch phase started
  26. this.dateScorchFinish = 'unset'; // UTC Timestamp of when the Scorch phase finished
  27. this.dateSyncStart = 'unset'; // UTC Timestamp of when the sync phase started
  28. this.dateSyncFinish = 'unset'; // UTC Timestamp of when the sync phase finished
  29. this.dateBuildStart = 'unset'; // UTC Timestamp of when the build phase started
  30. this.dateBuildFinish = 'unset'; // UTC Timestamp of when the build phase finished
  31. this.dateCopyFilesStart = 'unset'; // UTC Timestamp of when the CopyFiles phase started
  32. this.dateCopyFilesFinish = 'unset'; // UTC Timestamp of when the CopyFiles phase finished
  33. this.datePostStart = 'unset'; // UTC Timestamp of when the postbuild phase started
  34. this.datePostFinish = 'unset'; // UTC Timestamp of when the postbuild phase finished
  35. }
  36. function DepotInfo()
  37. {
  38. // "DepotInfo" is an array of depots in this enlistment
  39. this.strName = ''; // Human readable name of depot (left side of sd.map list)
  40. this.strDir = ''; // Directory name for this depot (right side of sd.map list)
  41. }
  42. function Enlistment()
  43. {
  44. // "Enlistment" is an array of known enlistments on the machine (given in env. template)
  45. this.strRootDir = ''; // Root directory of enlistment (e.g. d:\newnt)
  46. this.strBinaryDir = ''; // Place where built binaries get put (e.g. d:\binaries.*)
  47. this.aDepotInfo = new Array(); // "DepotInfo" is an array of depots in this enlistment
  48. }
  49. function Machine()
  50. {
  51. // "Machine" is a hash array indexed by machine name
  52. this.strName = ''; // machine name
  53. this.strStatus = 'idle'; // idle,busy,waiting
  54. this.strLog = ''; // Contents of detailed log for this machine
  55. this.aEnlistment = new Array(); // "Enlistment" is an array of known enlistments on the machine (given in env. template)
  56. this.strBuildPassStatus = ''; // "busy[0,1,2]", "wait[1,2]"
  57. this.fSuccess = true;
  58. }
  59. function UpdateCount()
  60. {
  61. // "UpdateCount" Number which is incremented any time this depot object or its tasks are changed.
  62. this.nCount = 1;
  63. }
  64. function Task()
  65. {
  66. // "Task" is an array of tasks currently or previously performed in this depot
  67. this.strName = ''; // sync,build,postbuild
  68. this.nID = -1; // Machine-unique ID for this task. Must be valid after it has completed
  69. this.dateStart = ''; // Date object giving the start time of the task
  70. this.dateFinish = ''; // Date object giving the finish time of the task
  71. this.strOperation = ''; // Sync:sync,resolve; Build:pass0,compile,link; PostBuild: ???
  72. this.strStatus = 'not started'; // not started,in progress,completed,waiting
  73. this.fSuccess = true; // Indicates success or failure of task. Should be used instead of cErrors to determine error status.
  74. this.nRestarted = 0; // The number of times an operation was automatically restarted.
  75. this.cFiles = 0; // Count of sync'd files
  76. this.cResolved = 0; // Count of resolved files
  77. this.cWarnings = 0; // Warning count
  78. this.cErrors = 0; // Error count
  79. this.strLogPath = ''; // UNC path to detailed log file
  80. this.strErrLogPath = ''; // UNC path to log file containing only detailed error information
  81. this.strFirstLine = ''; // First line of error message in UI status
  82. this.strSecondLine = ''; // Second line of error message in UI status
  83. }
  84. function Depot()
  85. {
  86. // "Depot" is an array of depots for the build. It contains the depots that are actually performing tasks.
  87. this.strName = ''; // Name of depot (DepotInfo.strName)
  88. this.objUpdateCount = new UpdateCount();
  89. this.strDir = ''; // Directory of depot (DepotInfo.strDir)
  90. this.strPath = ''; // Full path of depot's root directory
  91. this.strStatus = 'not started'; // not started,syncing,building,postbuild,waiting,error
  92. this.strMachine = ''; // Name of the machine building this depot
  93. this.nEnlistment = -1; // index of enlistment in machine's enlistment array
  94. this.aTask = new Array(); // "Task" is an array of tasks currently or previously performed in this depot
  95. }
  96. function Build()
  97. {
  98. // "Build" is an array of build objects. For now there will always be only one build.
  99. this.strConfigTemplate = ''; // file://\\server\path\clean_build.xml
  100. this.strEnvTemplate = ''; // file://\\server\path\bluelab.xml
  101. this.objBuildType = new BuildType();
  102. this.objElapsedTimes = new ElapsedTimes();
  103. this.hMachine = new Object(); // "Machine" is a hash array indexed by machine name
  104. this.aDepot = new Array(); // "Depot" is an array of depots for the build. It contains the depots that are actually performing tasks.
  105. }
  106. function PublicDataObj()
  107. {
  108. // "PublicDataObj" is the object to be put in the PublicData property. All data here will be exposed to outside clients.
  109. // $DROPVERSION:
  110. this.strDataVersion = 'V(########) F(!!!!!!!!!!!!!!)';
  111. // $
  112. this.strStatus = 'idle'; // idle,busy,completed
  113. this.strMode = 'idle'; // idle,master,slave,standalone
  114. this.objDialog = new Dialog();
  115. this.aBuild = new Array(); // "Build" is an array of build objects. For now there will always be only one build.
  116. }
  117. function Util()
  118. {
  119. // "Util" is function pointers and other data used by the utility thread.
  120. this.fnLoadXML = null; // Pointer to function which will load an XML file into an object
  121. this.fnUneval = null; // Pointer to function which will convert any JScript data type into a string
  122. this.fnDeleteFileNoThrow = null; // Pointer to function to delete files without throwing errors
  123. this.fnMoveFileNoThrow = null; // Pointer to function to move files without throwing error
  124. this.fnCreateFolderNoThrow = null; // Pointer to function to make folders without throwing error
  125. this.fnDirScanNoThrow = null; // Pointer to function to scan a folder (for files) without throwing error
  126. this.fnCopyFileNoThrow = null; // Pointer to function to copy files without throwing error
  127. this.fnCreateHistoriedFile = null; // Pointer to function create files with a history of numbered files
  128. this.fnCreateNumberedFile = null; // Pointer to function create a file with an increasing index
  129. this.unevalNextID = 0; // Used by the Uneval function to get unique IDs for objects being stringized
  130. }
  131. function PublishedFile()
  132. {
  133. // "PublishedFiles" is the array of filenames
  134. this.strPublishedStatus = 'not yet copied'; // "not yet copied", "duplicate", "copy to master", "copy to slaves", "complete"
  135. this.strName = '';
  136. }
  137. function PublishEnlistment()
  138. {
  139. // "PublishEnlistment" is hash by enlistment path
  140. this.aPublishedFile = new Array(); // "PublishedFiles" is the array of filenames
  141. this.strSrcUNCPrefix = '';
  142. }
  143. function Publisher()
  144. {
  145. // "Publisher" is a hash by slave machine name
  146. this.hPublishEnlistment = new Object(); // "PublishEnlistment" is hash by enlistment path
  147. }
  148. function PublishedFiles()
  149. {
  150. // "PublishedFiles" is a hash by filename of the files to be published
  151. this.aReferences = new Array(); // array of DepotInfo
  152. }
  153. function RemoteMachine()
  154. {
  155. // "RemoteMachine" is a hash array indexed by machine name
  156. this.fSetConfig = false; // Determines if we have succeeded in doing a "setconfig" command to a slave machine.
  157. this.fRegistered = false; // Determines if we have succeeded in doing a "RegisterEventSource" to a slave machine.
  158. this.objRemote = null; // Only valid on master side, handle to remote mtscript
  159. }
  160. function EnvObj()
  161. {
  162. // the environment variables from razzle
  163. }
  164. function EnlistmentInfo()
  165. {
  166. // Array of environments for each enlistment for this machine
  167. this.hEnvObj = new Object();
  168. }
  169. function RemotePublicDataObj()
  170. {
  171. // Hash by machine name, a copy of the public data from each remote build machine
  172. }
  173. function PrivateDataObj()
  174. {
  175. // "PrivateDataObj" is the type of the PrivateData property. This is used to share data between threads but will not be seen by others
  176. this.fileLog = null; // General logfile which logging information is written to
  177. this.fEnableLogging = false; // Enable/Disable writing logmsgs to the logfile.
  178. this.objConfig = null; // Config data read from configuration template
  179. this.objEnviron = null; // Environment data read from environment template
  180. this.fnExecScript = null; // Pointer to function to delegate calls to exec to. Will vary depending on mode engine is running in.
  181. this.objUtil = new Util();
  182. this.dateErrorMailSent = 0; // Time that we last sent out an error message
  183. this.fIsStandalone = false; // True if the machine is operating in standalone mode
  184. this.hPublisher = new Object(); // "Publisher" is a hash by slave machine name
  185. this.hPublishedFiles = new Object(); // "PublishedFiles" is a hash by filename of the files to be published
  186. this.aDepotList = new Array(); // Array of depots giving names of all known depots
  187. this.hRemoteMachine = new Object(); // "RemoteMachine" is a hash array indexed by machine name
  188. this.aEnlistmentInfo = new Array(); // Array of environments for each enlistment for this machine
  189. this.strLogDir = ''; // Directory location where log files should be placed
  190. this.aStringMap = new Array(); // Array of string mappings received from setstringmap - used for sending to slaves
  191. this.hRemotePublicDataObj = new Object();
  192. }