@@ -48,7 +48,7 @@ def detect_compose_cmd():
4848 sys .exit (1 )
4949
5050
51- def fmt_elapsed (seconds ):
51+ def format_elapsed_time (seconds ):
5252 m , s = divmod (int (seconds ), 60 )
5353 return f"{ m } m { s } s" if m else f"{ s } s"
5454
@@ -65,11 +65,16 @@ def run_build(compose, service, *, background=False, evomaster=False):
6565 return subprocess .run (cmd , check = False )
6666
6767
68- def copy_additional_files (compose ):
69- print ("Copying Additional Files" )
70- print (">>> Copying evomaster-agent and jacoco files to dist..." )
71- run (compose + ["-f" , COMPOSE_FILE , "run" , "--rm" , "-T" , "copy-additional-files" ])
72- print ("Additional files copied!\n " )
68+ def copy_jacoco (compose ):
69+ print (">>> Copying jacoco files to dist..." )
70+ run (compose + ["-f" , COMPOSE_FILE , "run" , "--rm" , "-T" , "copy-jacoco" ])
71+ print ("Jacoco files copied!\n " )
72+
73+
74+ def copy_evomaster_agent (compose ):
75+ print (">>> Copying evomaster-agent to dist..." )
76+ run (compose + ["-f" , COMPOSE_FILE , "run" , "--rm" , "-T" , "copy-evomaster-agent" ])
77+ print ("evomaster-agent.jar copied!\n " )
7378
7479
7580def show_jar (path ):
@@ -104,9 +109,10 @@ def parse_args():
104109 " dist-docker.py --parallel # Build all projects in parallel\n "
105110 " dist-docker.py 8 gradle # Build only JDK 8 Gradle projects\n "
106111 " dist-docker.py 11 maven -p # Build JDK 11 Maven in parallel mode\n "
107- " dist-docker.py --copy-files # Only copy evomaster-agent and jacoco files\n "
112+ " dist-docker.py --copy-files # Only copy jacoco files\n "
113+ " dist-docker.py --copy-files -E # Only copy jacoco + evomaster-agent files\n "
108114 " dist-docker.py --interactive # Prompt before deleting dist/ on full build\n "
109- " dist-docker.py --evomaster # Also build evomaster runners (full build) \n "
115+ " dist-docker.py --evomaster # Also build evomaster runners + copy evomaster-agent \n "
110116 " dist-docker.py -E --parallel # Full build in parallel"
111117 ),
112118 )
@@ -185,7 +191,9 @@ def main():
185191 print ("Copy Additional Files Only Mode" )
186192 dist_dir .mkdir (parents = True , exist_ok = True )
187193 os .chdir (PROJ_DIR )
188- run (compose + ["-f" , COMPOSE_FILE , "run" , "--rm" , "-T" , "copy-additional-files" ])
194+ copy_jacoco (compose )
195+ if args .evomaster :
196+ copy_evomaster_agent (compose )
189197 print ("Files copied successfully!" )
190198 for f in ["evomaster-agent.jar" , "jacocoagent.jar" , "jacococli.jar" ]:
191199 show_jar (f )
@@ -272,11 +280,11 @@ def main():
272280 for svc , (proc , svc_start ) in list (img_pending .items ()):
273281 if proc .poll () is not None :
274282 done += 1
275- print (f" [{ done } /{ total } ] Image ready: { svc } ({ fmt_elapsed (time .time () - svc_start )} )" )
283+ print (f" [{ done } /{ total } ] Image ready: { svc } ({ format_elapsed_time (time .time () - svc_start )} )" )
276284 del img_pending [svc ]
277285 if img_pending :
278286 time .sleep (2 )
279- print (f"All Docker images built! (took { fmt_elapsed (time .time () - img_start )} )\n " )
287+ print (f"All Docker images built! (took { format_elapsed_time (time .time () - img_start )} )\n " )
280288
281289 # Step 2: Run builds
282290 step2_start = time .time ()
@@ -300,7 +308,7 @@ def main():
300308 code = proc .poll ()
301309 if code is not None :
302310 done += 1
303- svc_elapsed = fmt_elapsed (time .time () - svc_start )
311+ svc_elapsed = format_elapsed_time (time .time () - svc_start )
304312 if code != 0 :
305313 print (f" [{ done } /{ total } ] FAILED: { svc } (exit code { code } , { svc_elapsed } )" )
306314 failed += 1
@@ -314,28 +322,29 @@ def main():
314322 print (f"\n ERROR: { failed } build(s) failed!" )
315323 sys .exit (1 )
316324
317- print (f"\n All parallel builds completed successfully! (took { fmt_elapsed (time .time () - step2_start )} )\n " )
325+ print (f"\n All parallel builds completed successfully! (took { format_elapsed_time (time .time () - step2_start )} )\n " )
318326 else :
319327 print (">>> Running builds in SEQUENTIAL mode...\n " )
320328 for i , svc in enumerate (services , 1 ):
321329 print (f">>> [{ i } /{ total } ] Building: { svc } " )
322330 svc_start = time .time ()
323331 result = run_build (compose , svc , evomaster = args .evomaster )
324- svc_elapsed = fmt_elapsed (time .time () - svc_start )
332+ svc_elapsed = format_elapsed_time (time .time () - svc_start )
325333 if result .returncode != 0 :
326334 print (f"\n ERROR: { svc } build failed! (after { svc_elapsed } )" )
327335 sys .exit (1 )
328336 print (f" Completed in { svc_elapsed } \n " )
329337
338+ copy_jacoco (compose )
330339 if args .evomaster :
331- copy_additional_files (compose )
340+ copy_evomaster_agent (compose )
332341
333342 # Cleanup
334343 print ("Cleaning up Docker containers..." )
335344 run (compose + ["-f" , COMPOSE_FILE , "down" ])
336345
337346 # Summary
338- total_elapsed = fmt_elapsed (time .time () - build_start )
347+ total_elapsed = format_elapsed_time (time .time () - build_start )
339348 print ()
340349 print ("Build Summary" )
341350 print (f"Builds executed: { len (services )} " )
0 commit comments