src/Pure/Tools/scala_build.scala
changeset 75660 45d3497c0baa
parent 75657 900b76040211
child 75661 2d153e052aea
equal deleted inserted replaced
75659:9bd92ac9328f 75660:45d3497c0baa
    92       val jar_path = context(dir, component = component).module_result
    92       val jar_path = context(dir, component = component).module_result
    93       Result(output, jar_bytes, jar_path)
    93       Result(output, jar_bytes, jar_path)
    94     }
    94     }
    95   }
    95   }
    96 
    96 
       
    97   object Scala_Fun extends Scala.Fun("scala_build") with Scala.Bytes_Fun {
       
    98     val here = Scala_Project.here
       
    99     def invoke(args: List[Bytes]): List[Bytes] =
       
   100       args match {
       
   101         case List(component, dir) =>
       
   102           val result =
       
   103             build_result(Path.explode(dir.text),
       
   104               component = Value.Boolean.parse(component.text))
       
   105           val jar_name =
       
   106             result.jar_path match {
       
   107               case Some(path) => path.file_name
       
   108               case None => "result.jar"
       
   109             }
       
   110           List(Bytes("scala_build/" + jar_name), result.jar_bytes, Bytes(result.output))
       
   111         case _ => error("Bad arguments")
       
   112       }
       
   113   }
       
   114 
    97   def component_contexts(): List[Context] =
   115   def component_contexts(): List[Context] =
    98     isabelle.setup.Build.component_contexts().asScala.toList.map(new Context(_))
   116     isabelle.setup.Build.component_contexts().asScala.toList.map(new Context(_))
    99 }
   117 }