src/Pure/Tools/build.scala
changeset 51252 03d1fca818a4
parent 51244 d8ca566b22b3
child 51253 ab4c296a1e60
equal deleted inserted replaced
51251:d55cce4d72dd 51252:03d1fca818a4
    33   class Console_Progress(verbose: Boolean) extends Progress
    33   class Console_Progress(verbose: Boolean) extends Progress
    34   {
    34   {
    35     override def echo(msg: String) { java.lang.System.out.println(msg) }
    35     override def echo(msg: String) { java.lang.System.out.println(msg) }
    36     override def theory(session: String, theory: String): Unit =
    36     override def theory(session: String, theory: String): Unit =
    37       if (verbose) echo(session + ": theory " + theory)
    37       if (verbose) echo(session + ": theory " + theory)
       
    38 
       
    39     @volatile private var is_stopped = false
       
    40     def interrupt_handler[A](e: => A): A = Interrupt.handler { is_stopped = true } { e }
       
    41     override def stopped: Boolean = { val b = is_stopped; is_stopped = false; b  }
    38   }
    42   }
    39 
    43 
    40 
    44 
    41 
    45 
    42   /** session information **/
    46   /** session information **/
   887           Command_Line.Chunks(select_dirs, include_dirs, session_groups, build_options, sessions) =>
   891           Command_Line.Chunks(select_dirs, include_dirs, session_groups, build_options, sessions) =>
   888             val options = (Options.init() /: build_options)(_ + _)
   892             val options = (Options.init() /: build_options)(_ + _)
   889             val dirs =
   893             val dirs =
   890               select_dirs.map(d => (true, Path.explode(d))) :::
   894               select_dirs.map(d => (true, Path.explode(d))) :::
   891               include_dirs.map(d => (false, Path.explode(d)))
   895               include_dirs.map(d => (false, Path.explode(d)))
   892             build(new Build.Console_Progress(verbose), options, requirements, all_sessions,
   896             val progress = new Build.Console_Progress(verbose)
   893               build_heap, clean_build, dirs, session_groups, max_jobs, list_files, no_build,
   897             progress.interrupt_handler {
   894               system_mode, verbose, sessions)
   898               build(progress, options, requirements, all_sessions,
       
   899                 build_heap, clean_build, dirs, session_groups, max_jobs, list_files, no_build,
       
   900                 system_mode, verbose, sessions)
       
   901             }
   895         case _ => error("Bad arguments:\n" + cat_lines(args))
   902         case _ => error("Bad arguments:\n" + cat_lines(args))
   896       }
   903       }
   897     }
   904     }
   898   }
   905   }
   899 }
   906 }