@@ -126,6 +126,7 @@ def install_class_file(pathname,output_dir,class_temp_dir):
126
126
shutil .copyfile (pathname ,class_pathname )
127
127
128
128
prof ["duration" ] = time .time () - prof_start_time
129
+ prof ["count" ] = 1
129
130
return prof
130
131
131
132
@@ -187,55 +188,58 @@ def install_war_file(pathname,output_dir,temp_dir,class_temp_dir):
187
188
return prof
188
189
189
190
190
- def build_classes_configuration (app_binary_dir , output_dir ,temp_dir ):
191
+ def build_classes_configuration (app_binary_dirs , output_dir , temp_dir ):
191
192
prof = {}
192
193
prof_start_time = time .time ()
193
194
194
195
prof ["unpack" ] = {"duration" : 0.0 }
195
196
prof ["collect" ] = {"duration" : 0.0 }
197
+ prof ["install" ] = { "count" : 0 , "duration" : 0.0 , "fullname" : { "duration" : 0.0 } }
198
+
199
+ def add_prof_install (arg1 , arg2 ):
200
+ return {
201
+ "count" : arg1 ["count" ] + arg2 ["count" ],
202
+ "duration" : arg1 ["duration" ] + arg2 ["duration" ],
203
+ "fullname" : {"duration" : arg1 ["fullname" ]["duration" ] + arg2 ["fullname" ]["duration" ]}
204
+ }
196
205
197
206
class_temp_dir = os .path .join (temp_dir , "FULLNAME" )
198
207
199
- files = []
200
- prof ["collect" ] = collect_java_files (app_binary_dir ,"class" ,files )
208
+ for app_binary_dir in app_binary_dirs :
201
209
202
- prof ["install" ] = { "count" : len (files ), "duration" : 0.0 , "fullname" : { "duration" : 0.0 } }
210
+ files = []
211
+ prof_collect = collect_java_files (app_binary_dir ,"class" ,files )
212
+ prof ["collect" ]["duration" ] += prof_collect ["duration" ]
203
213
204
- for fname in files :
205
- prof_install = install_class_file (fname ,output_dir ,class_temp_dir )
214
+ for fname in files :
215
+ prof_install = install_class_file (fname ,output_dir ,class_temp_dir )
216
+ prof ["install" ] = add_prof_install (prof ["install" ], prof_install )
206
217
207
- prof ["install" ]["duration" ] += prof_install ["duration" ]
208
- prof ["install" ]["fullname" ]["duration" ] += prof_install ["fullname" ]["duration" ]
218
+ temp_dir_counter = 0
209
219
210
- temp_dir_counter = 0
220
+ files = []
221
+ prof_collect = collect_java_files (app_binary_dir ,"jar" ,files )
222
+ prof ["collect" ]["duration" ] += prof_collect ["duration" ]
211
223
212
- files = []
213
- prof_collect = collect_java_files ( app_binary_dir , "jar" , files )
214
- prof [ "collect" ][ "duration" ] += prof_collect [ "duration" ]
224
+ for fname in files :
225
+ prof_install = install_jar_file ( fname , output_dir , _make_temp_unpack_dir ( os . path . join ( temp_dir , "JAR" ), fname , temp_dir_counter ), class_temp_dir )
226
+ temp_dir_counter += 1
215
227
216
- for fname in files :
217
- prof_install = install_jar_file ( fname , output_dir , _make_temp_unpack_dir ( os . path . join ( temp_dir , "JAR" ), fname , temp_dir_counter ), class_temp_dir )
218
- temp_dir_counter += 1
228
+ prof [ "unpack" ][ "duration" ] += prof_install [ "unpack" ][ "duration" ]
229
+ prof [ "collect" ][ "duration" ] += prof_install [ "collect" ][ "duration" ]
230
+ prof [ "install" ] = add_prof_install ( prof [ "install" ], prof_install [ "install" ])
219
231
220
- prof ["unpack" ]["duration" ] += prof_install ["unpack" ]["duration" ]
221
- prof ["collect" ]["duration" ] += prof_install ["collect" ]["duration" ]
222
- prof ["install" ]["count" ] += prof_install ["install" ]["count" ]
223
- prof ["install" ]["duration" ] += prof_install ["install" ]["duration" ]
224
- prof ["install" ]["fullname" ]["duration" ] += prof_install ["install" ]["fullname" ]["duration" ]
225
-
226
- files = []
227
- prof_collect = collect_java_files (app_binary_dir , "war" , files )
228
- prof ["collect" ]["duration" ] += prof_collect ["duration" ]
232
+ files = []
233
+ prof_collect = collect_java_files (app_binary_dir , "war" , files )
234
+ prof ["collect" ]["duration" ] += prof_collect ["duration" ]
229
235
230
- for fname in files :
231
- prof_install = install_war_file (fname ,output_dir ,_make_temp_unpack_dir (os .path .join (temp_dir ,"WAR" ),fname ,temp_dir_counter ),class_temp_dir )
232
- temp_dir_counter += 1
236
+ for fname in files :
237
+ prof_install = install_war_file (fname ,output_dir ,_make_temp_unpack_dir (os .path .join (temp_dir ,"WAR" ),fname ,temp_dir_counter ),class_temp_dir )
238
+ temp_dir_counter += 1
233
239
234
- prof ["unpack" ]["duration" ] += prof_install ["unpack" ]["duration" ]
235
- prof ["collect" ]["duration" ] += prof_install ["collect" ]["duration" ]
236
- prof ["install" ]["count" ] += prof_install ["install" ]["count" ]
237
- prof ["install" ]["duration" ] += prof_install ["install" ]["duration" ]
238
- prof ["install" ]["fullname" ]["duration" ] += prof_install ["install" ]["fullname" ]["duration" ]
240
+ prof ["unpack" ]["duration" ] += prof_install ["unpack" ]["duration" ]
241
+ prof ["collect" ]["duration" ] += prof_install ["collect" ]["duration" ]
242
+ prof ["install" ] = add_prof_install (prof ["install" ], prof_install ["install" ])
239
243
240
244
prof ["duration" ] = time .time () - prof_start_time
241
245
return prof
0 commit comments