src/Pure/Admin/build_scala.scala
changeset 76542 d6ce50a092eb
parent 76540 83de6e9ae983
child 76547 9fe5d8c70352
equal deleted inserted replaced
76541:3706b88035d2 76542:d6ce50a092eb
    25     def artifact: String =
    25     def artifact: String =
    26       Library.take_suffix[Char](_ != '/', proper_url.toList)._2.mkString
    26       Library.take_suffix[Char](_ != '/', proper_url.toList)._2.mkString
    27 
    27 
    28     def get(path: Path, progress: Progress = new Progress): Unit =
    28     def get(path: Path, progress: Progress = new Progress): Unit =
    29       Isabelle_System.download_file(proper_url, path, progress = progress)
    29       Isabelle_System.download_file(proper_url, path, progress = progress)
    30 
       
    31     def get_unpacked(dir: Path, strip: Boolean = false, progress: Progress = new Progress): Unit =
       
    32       Isabelle_System.with_tmp_file("archive", ext = "tar.gz"){ archive_path =>
       
    33         get(archive_path, progress = progress)
       
    34         progress.echo("Unpacking " + artifact)
       
    35         Isabelle_System.extract(archive_path, dir, strip = strip)
       
    36       }
       
    37 
    30 
    38     def print: String =
    31     def print: String =
    39       "  * " + name + " " + version +
    32       "  * " + name + " " + version +
    40         (if (base_version.nonEmpty) " for Scala " + base_version else "") +
    33         (if (base_version.nonEmpty) " for Scala " + base_version else "") +
    41         ":\n    " + make_url(url)
    34         ":\n    " + make_url(url)
    74       Components.Directory.create(target_dir + Path.basic(component_name), progress = progress)
    67       Components.Directory.create(target_dir + Path.basic(component_name), progress = progress)
    75 
    68 
    76 
    69 
    77     /* download */
    70     /* download */
    78 
    71 
    79     main_download.get_unpacked(component_dir.path, strip = true, progress = progress)
    72     Isabelle_System.with_tmp_file("archive", ext = "tar.gz") { archive_path =>
       
    73       main_download.get(archive_path, progress = progress)
       
    74       Isabelle_System.extract(archive_path, component_dir.path, strip = true)
       
    75     }
    80 
    76 
    81     lib_downloads.foreach(download =>
    77     lib_downloads.foreach(download =>
    82       download.get(component_dir.lib + Path.basic(download.artifact), progress = progress))
    78       download.get(component_dir.lib + Path.basic(download.artifact), progress = progress))
    83 
    79 
    84     File.write(component_dir.LICENSE,
    80     File.write(component_dir.LICENSE,