File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 4848TOOLS_DIR = pathlib .Path (__file__ ).resolve ().parent
4949REPO_ROOT = TOOLS_DIR .parent
5050
51+ def overlay (from_root , to_root ):
52+ for from_path in pathlib .Path (from_root ).rglob ('*' ):
53+ relpath = from_path .relative_to (from_root )
54+ to_path = to_root / relpath
55+ if from_path .is_file ():
56+ assert not to_path .exists ()
57+ shutil .copyfile (from_path , to_path )
58+ else :
59+ to_path .mkdir (exist_ok = True )
5160
5261def main (unused_argv ):
5362 merged_source = pathlib .Path (tempfile .mkdtemp ())
5463 (merged_source / 'java/org' ).mkdir (parents = True )
5564
5665 shutil .copytree (REPO_ROOT / 'tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/' ,
5766 merged_source / 'java/org/tensorflow' )
67+ overlay (REPO_ROOT / 'tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow' ,
68+ merged_source / 'java/org/tensorflow' )
5869 shutil .copytree (REPO_ROOT / 'tensorflow-framework/src/main/java/org/tensorflow/framework' ,
5970 merged_source / 'java/org/tensorflow/framework' )
6071 shutil .copytree (REPO_ROOT / 'ndarray/src/main/java/org/tensorflow/ndarray' ,
You can’t perform that action at this time.
0 commit comments