Exemple #1
0
			/////////////////////////////////////////////////////////////////////////////

			private void Update( string rspPath, string dllPath )
			{
				// ******
				string resetDir = Directory.GetCurrentDirectory();

				// ******
				try {
					Directory.SetCurrentDirectory( Path.GetDirectoryName(rspPath) );

					// ******
					DateTime whenStarted = File.GetLastWriteTimeUtc( dllPath );
					
					// ******
					string cmdLine = string.Format( "@\"{0}\"", rspPath );

					External ext = new External();
					ExecResult execResult = ext.Execute( "csc.exe", cmdLine, mp.GrandCentral.MaxExecTime );
					
					if( execResult.StdOut.IndexOf("error", StringComparison.OrdinalIgnoreCase) >= 0 ) {
						ThreadContext.MacroError( "#makersp: error compiling: {0}", execResult.StdOut );
					}

					// ******
					DateTime current = File.GetLastWriteTimeUtc(dllPath);
					if( whenStarted == current ) {
						//
						// did not update, file times the same
						//
						ThreadContext.MacroError( "#makersp: the output file \"{0}\" was not updated\nHINT: make sure csc.exe is in your path\n", dllPath );
					}

					// ******
					ThreadContext.WriteMessage( "successfully compiled \"{0}\" via response file \"{1}\"", dllPath, rspPath );
				}

				finally {
					Directory.SetCurrentDirectory( resetDir );
				}
			}
Exemple #2
0
		/////////////////////////////////////////////////////////////////////////////

		protected object HandleExec( string exeName, string cmdLine )
		{
			External ext = new External();
			return ext.Execute( exeName, cmdLine, gc.MaxExecTime );
		}
Exemple #3
0
		/////////////////////////////////////////////////////////////////////////////

		public static ExecResult RunNode( string pathToNode, string cmdLine, int waitTime )
		{
			// ******
			if( string.IsNullOrEmpty( pathToNode ) ) {
				pathToNode = FindExe( "node.exe" );
			}

			// ******
			var external = new External();
			return external.Execute( pathToNode, cmdLine, waitTime );
		}