Ejemplo n.º 1
0
 private static bool BuildProject(KoanSource koans)
 {
     Console.WriteLine("Building...");
     using (Process build = new Process())
     {
         build.StartInfo.FileName       = "devenv";
         build.StartInfo.Arguments      = String.Format(@"/build Debug /project {0} ..\..\..\DotNetKoans.sln", koans.ProjectName);
         build.StartInfo.CreateNoWindow = true;
         build.Start();
         build.WaitForExit();
     }
     return(false);
 }
Ejemplo n.º 2
0
        private static void StartRunner(object sender, FileSystemEventArgs e)
        {
            if (e != null)
            {
                DateTime timestamp = File.GetLastWriteTime(e.FullPath);
                if (_LastChange.ToString() == timestamp.ToString())                // Use string version to eliminate second save by VS a fraction of a second later
                {
                    return;
                }
                _LastChange = timestamp;
            }
            KoanSource source = Array.Find(KoanSource.Sources, s => e.FullPath.EndsWith(s.Extension));

            BuildProject(source);
            RunKoans(source);
        }
Ejemplo n.º 3
0
 private static bool BuildProject(KoanSource koans)
 {
     Console.WriteLine("Building...");
     using (Process build = new Process())
     {
         build.StartInfo.FileName       = "devenv";
         build.StartInfo.Arguments      = String.Format(@"/build Debug /project {0} ..\..\..\DotNetKoans.sln", koans.ProjectName);
         build.StartInfo.CreateNoWindow = true;
         build.Start();
         build.WaitForExit();
         if (build.ExitCode != 0)
         {
             Console.WriteLine("There was a build error.  Please check your code and try again.");
         }
     }
     return(false);
 }
Ejemplo n.º 4
0
 private static void RunKoans(KoanSource koans)
 {
     if (File.Exists(koans.AssemblyPath))
     {
         Console.WriteLine("Checking Koans...");
         using (Process launch = new Process())
         {
             launch.StartInfo.FileName  = koansRunner;
             launch.StartInfo.Arguments = koans.AssemblyPath;
             launch.StartInfo.RedirectStandardOutput = true;
             launch.StartInfo.UseShellExecute        = false;
             launch.Start();
             string output = launch.StandardOutput.ReadToEnd();
             launch.WaitForExit();
             EchoResult(output, koans.ProjectName);
         }
     }
     File.Delete(koans.AssemblyPath);
 }
Ejemplo n.º 5
0
        private static bool BuildProject(KoanSource koans)
        {
            var projectName = koans?.ProjectName;

            Console.WriteLine($"The master is pondering your {projectName ?? "path to enlightenment"}...");

            using (Process build = new Process())
            {
                build.StartInfo.FileName  = "devenv";
                build.StartInfo.Arguments = String.Format(@"DotNetKoans.sln /build Debug {0}",
                                                          projectName != null ? "/project " + projectName : null);
                build.StartInfo.CreateNoWindow = true;

                build.Start();
                build.WaitForExit();
                if (build.ExitCode != 0 && koans != null)
                {
                    Console.WriteLine($"There was a build error ({build.ExitCode}).  Please check your code and try again.");
                }
            }
            return(false);
        }