File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 13
13
#include < util/config.h>
14
14
#include < util/cmdline.h>
15
15
#include < util/string2int.h>
16
+ #include < json/json_parser.h>
16
17
17
18
#include < goto-programs/class_hierarchy.h>
18
19
@@ -59,6 +60,25 @@ void java_bytecode_languaget::get_language_options(const cmdlinet &cmd)
59
60
java_cp_include_files=cmd.get_value (" java-cp-include-files" );
60
61
else
61
62
java_cp_include_files=" .*" ;
63
+ // load file list from JSON file
64
+ if (java_cp_include_files[0 ]==' @' )
65
+ {
66
+ jsont json_cp_config;
67
+ if (parse_json (
68
+ java_cp_include_files.substr (1 ),
69
+ get_message_handler (),
70
+ json_cp_config))
71
+ throw " cannot read JSON input configuration for JAR loading" ;
72
+ assert (json_cp_config.is_object () && " JSON has wrong format" );
73
+ jsont include_files=json_cp_config[" jar" ];
74
+ assert (include_files.is_array () && " JSON has wrong format" );
75
+ // add jars from JSON config file to classpath
76
+ for (const jsont &file_entry : include_files.array )
77
+ {
78
+ assert (file_entry.is_string () && has_suffix (file_entry.value , " .jar" ));
79
+ config.java .classpath .push_back (file_entry.value );
80
+ }
81
+ }
62
82
}
63
83
64
84
/* ******************************************************************\
You can’t perform that action at this time.
0 commit comments