220 |
220 |
221 private def build_heaps( |
221 private def build_heaps( |
222 options: Options, |
222 options: Options, |
223 platform: Platform.Family.Value, |
223 platform: Platform.Family.Value, |
224 build_sessions: List[String], |
224 build_sessions: List[String], |
225 local_dir: Path |
225 local_dir: Path, |
|
226 progress: Progress = new Progress, |
226 ): Unit = { |
227 ): Unit = { |
227 val server_option = "build_host_" + platform.toString |
228 val server_option = "build_host_" + platform.toString |
|
229 val server = options.string(server_option) |
|
230 progress.echo("Building heaps " + commas_quote(build_sessions) + |
|
231 " (" + server_option + " = " + quote(server) + ") ...") |
|
232 |
228 val ssh = |
233 val ssh = |
229 options.string(server_option) match { |
234 server match { |
230 case "" => |
235 case "" => |
231 if (Platform.family == platform) SSH.Local |
236 if (Platform.family == platform) SSH.Local |
232 else error("Undefined option " + server_option + ": cannot build heaps") |
237 else error("Undefined option " + server_option + ": cannot build heaps") |
233 case SSH.Target(user, host) => |
238 case SSH.Target(user, host) => |
234 SSH.open_session(options, host = host, user = user) |
239 SSH.open_session(options, host = host, user = user) |
235 case s => error("Malformed option " + server_option + ": " + quote(s)) |
240 case _ => error("Malformed option " + server_option + ": " + quote(server)) |
236 } |
241 } |
237 try { |
242 try { |
238 Isabelle_System.with_tmp_file("tmp", ext = "tar") { local_tmp_tar => |
243 Isabelle_System.with_tmp_file("tmp", ext = "tar") { local_tmp_tar => |
239 execute_tar(local_dir, "-cf " + File.bash_path(local_tmp_tar) + " .") |
244 execute_tar(local_dir, "-cf " + File.bash_path(local_tmp_tar) + " .") |
240 ssh.with_tmp_dir { remote_dir => |
245 ssh.with_tmp_dir { remote_dir => |
581 |
586 |
582 |
587 |
583 // build heaps |
588 // build heaps |
584 |
589 |
585 if (build_sessions.nonEmpty) { |
590 if (build_sessions.nonEmpty) { |
586 progress.echo("Building heaps " + commas_quote(build_sessions) + " ...") |
591 build_heaps(options, platform, build_sessions, isabelle_target, progress = progress) |
587 build_heaps(options, platform, build_sessions, isabelle_target) |
|
588 } |
592 } |
589 |
593 |
590 |
594 |
591 // application bundling |
595 // application bundling |
592 |
596 |