# HG changeset patch # User wenzelm # Date 1626003974 -7200 # Node ID f090787bb4c429185381571918283b7adb621578 # Parent 027f837d18eecb66085ae6900d4503c80e0ebf96 operations for all components; diff -r 027f837d18ee -r f090787bb4c4 src/Tools/Setup/isabelle/setup/Build.java --- a/src/Tools/Setup/isabelle/setup/Build.java Sun Jul 11 12:58:02 2021 +0200 +++ b/src/Tools/Setup/isabelle/setup/Build.java Sun Jul 11 13:46:14 2021 +0200 @@ -43,6 +43,7 @@ /** context **/ public static String BUILD_PROPS = "build.props"; + public static String COMPONENT_BUILD_PROPS = "etc/build.props"; public static Context directory_context(Path dir) throws IOException @@ -56,11 +57,26 @@ throws IOException { Properties props = new Properties(); - Path build_props = dir.resolve("etc").resolve(BUILD_PROPS); + Path build_props = dir.resolve(COMPONENT_BUILD_PROPS); if (Files.exists(build_props)) { props.load(Files.newBufferedReader(build_props)); } return new Context(dir, props); } + public static List component_contexts() + throws IOException, InterruptedException + { + List result = new LinkedList(); + for (String p : Environment.getenv("ISABELLE_COMPONENTS").split(":", -1)) { + if (!p.isEmpty()) { + Path dir = Path.of(Environment.platform_path(p)); + if (Files.exists(dir.resolve(COMPONENT_BUILD_PROPS))) { + result.add(component_context(dir)); + } + } + } + return List.copyOf(result); + } + public static class Context { private final Path _dir; @@ -287,6 +303,31 @@ } + /** classpath **/ + + public static List classpath() + throws IOException, InterruptedException + { + List result = new LinkedList(); + for (Context context : component_contexts()) { + result.add(context.path(context.jar_name())); + } + return List.copyOf(result); + } + + public static List services() + throws IOException, InterruptedException + { + List result = new LinkedList(); + for (Context context : component_contexts()) { + for (String s : context.services()) { + result.add(s); + } + } + return List.copyOf(result); + } + + /** build **/ public static void build(Context context, boolean fresh) @@ -401,4 +442,12 @@ } } } + + public static void build_components(boolean fresh) + throws IOException, InterruptedException, NoSuchAlgorithmException + { + for (Context context : component_contexts()) { + build(context, fresh); + } + } }