23 } |
23 } |
24 |
24 |
25 |
25 |
26 /* file and directories */ |
26 /* file and directories */ |
27 |
27 |
|
28 def plugin_contexts(): List[isabelle.setup.Build.Context] = |
|
29 for (plugin <- List("jedit_base", "jedit_main")) |
|
30 yield { |
|
31 val dir = Path.explode("$ISABELLE_HOME/src/Tools/jEdit") + Path.basic(plugin) |
|
32 isabelle.setup.Build.directory_context(dir.java_path) |
|
33 } |
|
34 |
28 lazy val isabelle_files: (List[Path], List[Path]) = |
35 lazy val isabelle_files: (List[Path], List[Path]) = |
29 { |
36 { |
30 val component_contexts = |
37 val contexts = |
31 isabelle.setup.Build.component_contexts().asScala.toList |
38 isabelle.setup.Build.component_contexts().asScala.toList ::: |
|
39 plugin_contexts() |
32 |
40 |
33 val jars1 = Path.split(Isabelle_System.getenv("ISABELLE_CLASSPATH")) |
41 val jars1 = Path.split(Isabelle_System.getenv("ISABELLE_CLASSPATH")) |
34 val jars2 = |
42 val jars2 = |
35 (for { |
43 (for { |
36 context <- component_contexts.iterator |
44 context <- contexts.iterator |
37 s <- context.requirements().asScala.iterator |
45 s <- context.requirements().asScala.iterator |
38 path <- context.requirement_paths(s).asScala.iterator |
46 path <- context.requirement_paths(s).asScala.iterator |
39 } yield File.path(path.toFile)).toList |
47 } yield File.path(path.toFile)).toList |
40 |
48 |
41 val jar_files = |
49 val jar_files = |
42 (jars1 ::: jars2).filterNot(path => |
50 Library.distinct(jars1 ::: jars2).filterNot(path => |
43 component_contexts.exists(context => |
51 contexts.exists(context => |
44 { |
52 { |
45 val name: String = context.module_name() |
53 val name: String = context.module_name() |
46 name.nonEmpty && File.eq(context.path(name).toFile, path.file) |
54 name.nonEmpty && File.eq(context.path(name).toFile, path.file) |
47 })) |
55 })) |
48 |
56 |
49 val source_files = |
57 val source_files = |
50 (for { |
58 (for { |
51 context <- component_contexts.iterator |
59 context <- contexts.iterator |
52 file <- context.sources.asScala.iterator |
60 file <- context.sources.asScala.iterator |
53 if file.endsWith(".scala") || file.endsWith(".java") |
61 if file.endsWith(".scala") || file.endsWith(".java") |
54 } yield File.path(context.path(file).toFile)).toList |
62 } yield File.path(context.path(file).toFile)).toList |
55 |
63 |
56 (jar_files, source_files) |
64 (jar_files, source_files) |