Lines Matching refs:Path

40 from pathlib import Path
74 self.java_home = Path(os.environ.get("JAVA_HOME")).absolute()
126 def run(self, executable: pathlib.Path, args: List[Union[pathlib.Path, str]]): argument
127 assert isinstance(executable, pathlib.Path), executable
128 cmd: List[Union[pathlib.Path, str]] = []
139 if isinstance(arg, pathlib.Path):
166 def rbe_wrap(self, args, inputs: Set[pathlib.Path]=None): argument
172 if isinstance(arg, pathlib.Path):
186 def rbe_javac(self, javac_path:Path, args): argument
187 output = relpath(Path(args[args.index("-d") + 1]), self.rbe_exec_root)
190 def rbe_d8(self, d8_path:Path, args): argument
192 output = relpath(Path(args[args.index("--output") + 1]), self.rbe_exec_root)
198 def rbe_smali(self, smali_path:Path, args): argument
202 output = Path(args[args.index("--output") + 1])
250 javac_classpath: List[Path]=[], argument
263 class Path(pathlib.Path): class
265 path = pathlib.Path(filename)
287 def zip(zip_target: Path, *files: Path): argument
298 tmp_file = Path(tmp_dir) / "aligned.zip"
304 def make_jasmin(dst_dir: Path, src_dir: Path) -> Optional[Path]: argument
311 def make_smali(dst_dex: Path, src_dir: Path) -> Optional[Path]: argument
319 def make_java(dst_dir: Path, *src_dirs: Path) -> Optional[Path]: argument
333 javac_post = Path("javac_post.sh")
341 def make_dex(src_dir: Path): argument
342 dst_jar = Path(src_dir.name + ".jar")
354 dst_dex = Path(src_dir.name + ".dex")
357 (Path(tmp_dir) / "classes.dex").rename(dst_dex)
361 def make_dexmerge(dst_dex: Path, *src_dexs: Path): argument
381 def make_hiddenapi(*dex_files: Path): argument
382 if not use_hiddenapi or not Path("hiddenapi-flags.csv").exists():
384 args: List[Union[str, Path]] = ["encode"]
392 if Path("classes.dex").exists():
393 zip(Path(self.test_name + ".jar"), Path("classes.dex"))
396 if Path("classes.dm").exists():
397 zip(Path(self.test_name + ".jar"), Path("classes.dm"))
400 if make_jasmin(Path("jasmin_classes"), Path("jasmin")):
401 javac_classpath.append(Path("jasmin_classes"))
403 if make_jasmin(Path("jasmin_classes2"), Path("jasmin-multidex")):
404 javac_classpath.append(Path("jasmin_classes2"))
413 if (Path("src").exists() and
414 any(Path(p).exists() for p in extra_srcs + replacement_srcs)):
415 make_java(Path("classes-tmp-all"), Path("src"), *map(Path, extra_srcs))
416 javac_classpath.append(Path("classes-tmp-all"))
418 if make_java(Path("classes-aotex"), Path("src-aotex")) and need_dex:
419 make_dex(Path("classes-aotex"))
421 Path("classes-aotex.dex").rename(Path("classes.dex"))
422 zip(Path(self.test_name + "-aotex.jar"), Path("classes.dex"))
424 if make_java(Path("classes-bcpex"), Path("src-bcpex")) and need_dex:
425 make_dex(Path("classes-bcpex"))
427 Path("classes-bcpex.dex").rename(Path("classes.dex"))
428 zip(Path(self.test_name + "-bcpex.jar"), Path("classes.dex"))
430 make_java(Path("classes"), Path("src"))
435 make_java(Path("classes"), Path("src-art"))
437 if make_java(Path("classes2"), Path("src-multidex")) and need_dex:
438 make_dex(Path("classes2"))
440 make_java(Path("classes"), Path("src2"))
444 if any(Path("classes").glob("*")) and need_dex:
445 make_dex(Path("classes"))
447 if Path("jasmin_classes").exists():
450 make_dex(Path("jasmin_classes"))
451 make_dexmerge(Path("classes.dex"), Path("jasmin_classes.dex"))
455 Path("classes").mkdir(exist_ok=True)
456 copytree(Path("jasmin_classes"), Path("classes"), dirs_exist_ok=True)
458 if need_dex and make_smali(Path("smali_classes.dex"), Path("smali")):
461 make_dexmerge(Path("classes.dex"), Path("smali_classes.dex"))
465 if Path("jasmin-multidex").exists():
467 make_dex(Path("jasmin_classes2"))
468 make_dexmerge(Path("classes2.dex"), Path("jasmin_classes2.dex"))
472 Path("classes2").mkdir()
473 copytree(Path("jasmin_classes2"), Path("classes2"), dirs_exist_ok=True)
474 rmtree(Path("jasmin_classes2"))
476 if need_dex and make_smali(Path("smali_classes2.dex"), Path("smali-multidex")):
478 make_dexmerge(Path("classes2.dex"), Path("smali_classes2.dex"))
480 make_java(Path("classes-ex"), Path("src-ex"))
482 make_java(Path("classes-ex"), Path("src-ex2"))
484 if Path("classes-ex").exists() and need_dex:
485 make_dex(Path("classes-ex"))
487 if need_dex and make_smali(Path("smali_classes-ex.dex"), Path("smali-ex")):
489 make_dexmerge(Path("classes-ex.dex"), Path("smali_classes-ex.dex"))
491 if Path("classes-ex.dex").exists():
493 make_hiddenapi(Path("classes-ex.dex"))
496 Path("classes.dex").rename(Path("classes-1.dex"))
497 Path("classes-ex.dex").rename(Path("classes.dex"))
498 zip(Path(self.test_name + "-ex.jar"), Path("classes.dex"))
499 Path("classes.dex").rename(Path("classes-ex.dex"))
500 Path("classes-1.dex").rename(Path("classes.dex"))
504 if any(Path(".").glob("*-multidex")):
505 make_hiddenapi(Path("classes.dex"), Path("classes2.dex"))
507 make_hiddenapi(Path("classes.dex"))
511 if Path("classes2.dex").exists():
512 zip(Path(self.test_name + ".jar"), Path("classes.dex"), Path("classes2.dex"))
514 zip(Path(self.test_name + ".jar"), Path("classes.dex"))
525 lock_path = Path(environ["TMPDIR"]) / ("art-test-run-test-build-py-" + mode)
536 parser.add_argument("--out", type=Path, help="Final zip file")
538 parser.add_argument("--bootclasspath", type=Path)
539 parser.add_argument("--d8", type=Path)
540 parser.add_argument("--hiddenapi", type=Path)
541 parser.add_argument("--jasmin", type=Path)
542 parser.add_argument("--rewrapper", type=Path)
543 parser.add_argument("--smali", type=Path)
544 parser.add_argument("--soong_zip", type=Path)
545 parser.add_argument("--zipalign", type=Path)
547 parser.add_argument("srcs", nargs="+", type=Path)
550 android_build_top = Path(getcwd()).absolute()
561 def filter_by_hiddenapi(srcdir: Path) -> bool: argument