File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -251,12 +251,23 @@ def copy_code(self, output_dir):
251251 "python" : ["*.py" , "requirements.txt*" ],
252252 "nodejs" : ["*.js" , "package.json" ],
253253 "java" : ["pom.xml" ],
254-
255254 }
256255 path = os .path .join (self .benchmark_path , self .language_name )
256+
257257 for file_type in FILES [self .language_name ]:
258258 for f in glob .glob (os .path .join (path , file_type )):
259259 shutil .copy2 (os .path .join (path , f ), output_dir )
260+
261+ # copy src folder of java (java benchmarks are maven project and need directories)
262+ if self .language_name == "java" :
263+ output_src_dir = os .path .join (output_dir , "src" )
264+
265+ if os .path .exists (output_src_dir ):
266+ # If src dir in output exist, remove the directory and all its contents
267+ shutil .rmtree (output_src_dir )
268+ #To have contents of src directory in the direcory named src located in output
269+ shutil .copytree (os .path .join (path , "src" ), output_src_dir )
270+
260271 # support node.js benchmarks with language specific packages
261272 nodejs_package_json = os .path .join (path , f"package.json.{ self .language_version } " )
262273 if os .path .exists (nodejs_package_json ):
You can’t perform that action at this time.
0 commit comments