src/Pure/Admin/build_sqlite.scala
changeset 75393 87ebf5a50283
parent 73566 4e6b31ed7197
child 75394 42267c650205
equal deleted inserted replaced
75388:b3ca4a6ed74b 75393:87ebf5a50283
     5 */
     5 */
     6 
     6 
     7 package isabelle
     7 package isabelle
     8 
     8 
     9 
     9 
    10 object Build_SQLite
    10 object Build_SQLite {
    11 {
       
    12   /* build sqlite */
    11   /* build sqlite */
    13 
    12 
    14   def build_sqlite(
    13   def build_sqlite(
    15     download_url: String,
    14     download_url: String,
    16     progress: Progress = new Progress,
    15     progress: Progress = new Progress,
    17     target_dir: Path = Path.current): Unit =
    16     target_dir: Path = Path.current
    18   {
    17   ): Unit = {
    19     val Download_Name = """^.*/([^/]+)\.jar""".r
    18     val Download_Name = """^.*/([^/]+)\.jar""".r
    20     val download_name =
    19     val download_name =
    21       download_url match {
    20       download_url match {
    22         case Download_Name(download_name) => download_name
    21         case Download_Name(download_name) => download_name
    23         case _ => error("Malformed jar download URL: " + quote(download_url))
    22         case _ => error("Malformed jar download URL: " + quote(download_url))
    53     /* jar */
    52     /* jar */
    54 
    53 
    55     val jar = component_dir + Path.basic(download_name).ext("jar")
    54     val jar = component_dir + Path.basic(download_name).ext("jar")
    56     Isabelle_System.download_file(download_url, jar, progress = progress)
    55     Isabelle_System.download_file(download_url, jar, progress = progress)
    57 
    56 
    58     Isabelle_System.with_tmp_dir("sqlite")(jar_dir =>
    57     Isabelle_System.with_tmp_dir("sqlite")(jar_dir => {
    59     {
       
    60       progress.echo("Unpacking " + jar)
    58       progress.echo("Unpacking " + jar)
    61       Isabelle_System.bash("isabelle_jdk jar xf " + File.bash_path(jar.absolute),
    59       Isabelle_System.bash("isabelle_jdk jar xf " + File.bash_path(jar.absolute),
    62         cwd = jar_dir.file).check
    60         cwd = jar_dir.file).check
    63 
    61 
    64       val jar_files =
    62       val jar_files =
    83 
    81 
    84   /* Isabelle tool wrapper */
    82   /* Isabelle tool wrapper */
    85 
    83 
    86   val isabelle_tool =
    84   val isabelle_tool =
    87     Isabelle_Tool("build_sqlite", "build Isabelle sqlite-jdbc component from official download",
    85     Isabelle_Tool("build_sqlite", "build Isabelle sqlite-jdbc component from official download",
    88       Scala_Project.here, args =>
    86       Scala_Project.here, args => {
    89     {
       
    90       var target_dir = Path.current
    87       var target_dir = Path.current
    91 
    88 
    92       val getopts = Getopts("""
    89       val getopts = Getopts("""
    93 Usage: isabelle build_sqlite [OPTIONS] DOWNLOAD
    90 Usage: isabelle build_sqlite [OPTIONS] DOWNLOAD
    94 
    91