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 @@ -166,7 +166,18 @@ def main(argv: List[str]):
166166 parser .add_argument ('--jmh-args' , default = '' , help = 'Extra arguments to pass to the JMH main (e.g. "-f 1 -wi 0 -i 1")' )
167167 args = parser .parse_args (argv )
168168
169- repo_root = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' ))
169+ # Determine repository root by searching upwards for a marker (mvnw or pom.xml).
170+ start_dir = os .path .abspath (os .path .dirname (__file__ ))
171+ repo_root = start_dir
172+ while True :
173+ if os .path .exists (os .path .join (repo_root , 'mvnw' )) or os .path .exists (os .path .join (repo_root , 'pom.xml' )):
174+ break
175+ parent = os .path .dirname (repo_root )
176+ if parent == repo_root :
177+ # reached filesystem root; fallback to original heuristic (one level up)
178+ repo_root = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' , '..' ))
179+ break
180+ repo_root = parent
170181 os .chdir (repo_root )
171182
172183 build_benchmarks (args .mvnw , args .module )
You can’t perform that action at this time.
0 commit comments