some administrative support for AFP;
authorwenzelm
Mon Oct 09 17:09:08 2017 +0200 (19 months ago)
changeset 66820fc516da7ee4f
parent 66819 064c80e9d1cf
child 66821 c0e8c199cb2e
some administrative support for AFP;
src/Pure/Admin/afp.scala
src/Pure/build-jars
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/Pure/Admin/afp.scala	Mon Oct 09 17:09:08 2017 +0200
     1.3 @@ -0,0 +1,32 @@
     1.4 +/*  Title:      Pure/Admin/afp.scala
     1.5 +    Author:     Makarius
     1.6 +
     1.7 +Administrative support for the Archive of Formal Proofs.
     1.8 +*/
     1.9 +
    1.10 +package isabelle
    1.11 +
    1.12 +
    1.13 +object AFP
    1.14 +{
    1.15 +  sealed case class Entry(name: String, sessions: List[String])
    1.16 +
    1.17 +  def init(base_dir: Path = Path.explode("$AFP_BASE")): AFP = new AFP(base_dir)
    1.18 +}
    1.19 +
    1.20 +class AFP private(val base_dir: Path)
    1.21 +{
    1.22 +  val main_dir: Path = base_dir + Path.explode("thys")
    1.23 +
    1.24 +  val entries: List[AFP.Entry] =
    1.25 +    (for (name <- Sessions.parse_roots(main_dir + Sessions.ROOTS))
    1.26 +    yield {
    1.27 +      val sessions =
    1.28 +        Sessions.parse_root_entries(main_dir + Path.explode(name) + Sessions.ROOT).map(_.name)
    1.29 +      AFP.Entry(name, sessions)
    1.30 +    }).sortBy(_.name)
    1.31 +
    1.32 +  val sessions: List[String] = entries.flatMap(_.sessions).sorted
    1.33 +
    1.34 +  override def toString: String = base_dir.expand.toString
    1.35 +}
     2.1 --- a/src/Pure/build-jars	Mon Oct 09 17:08:37 2017 +0200
     2.2 +++ b/src/Pure/build-jars	Mon Oct 09 17:09:08 2017 +0200
     2.3 @@ -9,6 +9,7 @@
     2.4  ## sources
     2.5  
     2.6  declare -a SOURCES=(
     2.7 +  Admin/afp.scala
     2.8    Admin/build_cygwin.scala
     2.9    Admin/build_doc.scala
    2.10    Admin/build_history.scala