val store = build_results.store val sessions_structure = build_results.deps.sessions_structure
/* update */
var seen_theory = Set.empty[String]
using(Export.open_database_context(store)) { database_context => for {
session <- sessions_structure.build_topological_order if build_results(session).ok && !exclude(session)
} {
progress.echo("Updating " + session + " ...") val session_options = sessions_structure(session).options val proper_session_theory =
build_results.deps(session).proper_session_theories.map(_.theory).toSet
using(database_context.open_session0(session)) { session_context => for {
db <- session_context.session_db()
theory <- store.read_theories(db, session) if proper_session_theory(theory) && !seen_theory(theory)
} {
seen_theory += theory val theory_context = session_context.theory(theory) for {
theory_snapshot <- Build.read_theory(theory_context)
node_name <- theory_snapshot.node_files
snapshot = theory_snapshot.switch(node_name) if snapshot.node.source_wellformed
} {
progress.expose_interrupt() val xml =
YXML.parse_body(YXML.bytes_of_body(snapshot.xml_markup(elements = update_elements))) val source1 = XML.content(update_xml(session_options, xml)) if (source1 != snapshot.node.source) { val path = Path.explode(node_name.node)
progress.echo("File " + quote(File.standard_path(path)))
File.write(path, source1)
}
}
}
}
}
}
build_results
}
/* Isabelle tool wrapper */
val isabelle_tool =
Isabelle_Tool("update", "update theory sources based on PIDE markup", Scala_Project.here,
{ args => var base_sessions: List[String] = Nil var select_dirs: List[Path] = Nil var numa_shuffling = false var requirements = false var exclude_session_groups: List[String] = Nil var all_sessions = false var build_heap = false var clean_build = false var dirs: List[Path] = Nil var fresh_build = false var session_groups: List[String] = Nil var max_jobs: Option[Int] = None var base_logics: List[String] = List(Isabelle_System.default_logic()) var no_build = false var options = Options.init() var update_options: List[Options.Spec] = Nil var verbose = false var exclude_sessions: List[String] = Nil
val getopts = Getopts("""
Usage: isabelle update [OPTIONS] [SESSIONS ...]
Options are:
-B NAME include session NAME and all descendants
-D DIR include session directory and select its sessions
-R refer to requirements of selected sessions
-X NAME exclude sessions from group NAME and all descendants
-a select all sessions
-b build heap images
-c clean build
-d DIR include session directory
-f fresh build
-g NAME select session group NAME
-j INT maximum number of parallel jobs (default 1)
-l NAMES comma-separated list of base logics, to remain unchanged
(default: """ + quote(Isabelle_System.default_logic()) + """)
-n no build -- take existing session build databases
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME)
-u OPT override"update" option for selected sessions
-v verbose
-x NAME exclude session NAME and all descendants
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.0Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.