@@ -74,19 +74,37 @@ void java_bytecode_languaget::get_language_options(const cmdlinet &cmd)
74
74
java_cp_include_files.substr (1 ),
75
75
get_message_handler (),
76
76
json_cp_config))
77
- throw " cannot read JSON input configuration for JAR loading" ;
77
+ throw " cannot read JSON input configuration for JAR/WAR loading" ;
78
78
79
79
if (!json_cp_config.is_object ())
80
80
throw " the JSON file has a wrong format" ;
81
- jsont include_files=json_cp_config[" jar" ];
82
- if (!include_files.is_array ())
83
- throw " the JSON file has a wrong format" ;
84
-
85
- // add jars from JSON config file to classpath
86
- for (const jsont &file_entry : include_files.array )
81
+ jsont include_jar_files=json_cp_config[" jar" ];
82
+ if (!include_jar_files.is_null ())
83
+ {
84
+ if (!include_jar_files.is_array ())
85
+ throw " the JSON file has a wrong format" ;
86
+
87
+ // add jars from JSON config file to classpath
88
+ for (const jsont &file_entry : include_jar_files.array )
89
+ {
90
+ assert (file_entry.is_string () &&
91
+ has_suffix (file_entry.value , " .jar" ));
92
+ config.java .classpath .push_back (file_entry.value );
93
+ }
94
+ }
95
+ jsont include_war_files=json_cp_config[" war" ];
96
+ if (!include_war_files.is_null ())
87
97
{
88
- assert (file_entry.is_string () && has_suffix (file_entry.value , " .jar" ));
89
- config.java .classpath .push_back (file_entry.value );
98
+ if (!include_war_files.is_array ())
99
+ throw " the JSON file has a wrong format" ;
100
+
101
+ // add wars from JSON config file to classpath
102
+ for (const jsont &file_entry : include_war_files.array )
103
+ {
104
+ assert (file_entry.is_string () &&
105
+ has_suffix (file_entry.value , " .war" ));
106
+ config.java .classpath .push_back (file_entry.value );
107
+ }
90
108
}
91
109
}
92
110
}
0 commit comments