src/Pure/Admin/build_history.scala
changeset 65844 76e60a142ca1
parent 65843 d547173212d2
child 65845 b8ff63149256
equal deleted inserted replaced
65843:d547173212d2 65844:76e60a142ca1
   303       var more_settings: List[String] = Nil
   303       var more_settings: List[String] = Nil
   304       var fresh = false
   304       var fresh = false
   305       var init_settings: List[String] = Nil
   305       var init_settings: List[String] = Nil
   306       var arch_64 = false
   306       var arch_64 = false
   307       var nonfree = false
   307       var nonfree = false
       
   308       var output_file = ""
   308       var rev = default_rev
   309       var rev = default_rev
   309       var build_tags = List.empty[String]
   310       var build_tags = List.empty[String]
   310       var verbose = false
   311       var verbose = false
   311 
   312 
   312       val getopts = Getopts("""
   313       val getopts = Getopts("""
   323     -e TEXT      additional text for generated etc/settings
   324     -e TEXT      additional text for generated etc/settings
   324     -f           fresh build of Isabelle/Scala components (recommended)
   325     -f           fresh build of Isabelle/Scala components (recommended)
   325     -i TEXT      initial text for generated etc/settings
   326     -i TEXT      initial text for generated etc/settings
   326     -m ARCH      processor architecture (32=x86, 64=x86_64, default: x86)
   327     -m ARCH      processor architecture (32=x86, 64=x86_64, default: x86)
   327     -n           include nonfree components
   328     -n           include nonfree components
       
   329     -o FILE      output file for log names (default: stdout)
   328     -r REV       update to revision (default: """ + default_rev + """)
   330     -r REV       update to revision (default: """ + default_rev + """)
   329     -t TAG       free-form build tag (multiple occurrences possible)
   331     -t TAG       free-form build tag (multiple occurrences possible)
   330     -v           verbose
   332     -v           verbose
   331 
   333 
   332   Build Isabelle sessions from the history of another REPOSITORY clone,
   334   Build Isabelle sessions from the history of another REPOSITORY clone,
   349             case "32" | "x86" => arch_64 = false
   351             case "32" | "x86" => arch_64 = false
   350             case "64" | "x86_64" => arch_64 = true
   352             case "64" | "x86_64" => arch_64 = true
   351             case bad => error("Bad processor architecture: " + quote(bad))
   353             case bad => error("Bad processor architecture: " + quote(bad))
   352           },
   354           },
   353         "n" -> (_ => nonfree = true),
   355         "n" -> (_ => nonfree = true),
       
   356         "o:" -> (arg => output_file = arg),
   354         "r:" -> (arg => rev = arg),
   357         "r:" -> (arg => rev = arg),
   355         "t:" -> (arg => build_tags = build_tags ::: List(arg)),
   358         "t:" -> (arg => build_tags = build_tags ::: List(arg)),
   356         "v" -> (_ => verbose = true))
   359         "v" -> (_ => verbose = true))
   357 
   360 
   358       val more_args = getopts(args)
   361       val more_args = getopts(args)
   371           multicore_base = multicore_base, multicore_list = multicore_list, arch_64 = arch_64,
   374           multicore_base = multicore_base, multicore_list = multicore_list, arch_64 = arch_64,
   372           heap = heap.getOrElse(if (arch_64) default_heap * 2 else default_heap),
   375           heap = heap.getOrElse(if (arch_64) default_heap * 2 else default_heap),
   373           max_heap = max_heap, init_settings = init_settings, more_settings = more_settings,
   376           max_heap = max_heap, init_settings = init_settings, more_settings = more_settings,
   374           verbose = verbose, build_tags = build_tags, build_args = build_args)
   377           verbose = verbose, build_tags = build_tags, build_args = build_args)
   375 
   378 
   376       for ((_, log_path) <- results) Output.writeln(log_path.implode, stdout = true)
   379       if (output_file == "") {
       
   380         for ((_, log_path) <- results)
       
   381           Output.writeln(log_path.implode, stdout = true)
       
   382       }
       
   383       else {
       
   384         File.write(Path.explode(output_file),
       
   385           cat_lines(for ((_, log_path) <- results) yield log_path.implode))
       
   386       }
   377 
   387 
   378       val rc = (0 /: results) { case (rc, (res, _)) => rc max res.rc }
   388       val rc = (0 /: results) { case (rc, (res, _)) => rc max res.rc }
   379       if (rc != 0) sys.exit(rc)
   389       if (rc != 0) sys.exit(rc)
   380     }
   390     }
   381   }
   391   }