11#!/usr/bin/env python3
22# Copyright (c) 2019 The Khronos Group Inc.
3+ # SPDX-License-Identifier: Apache-2.0
34
45from itertools import product
56from pathlib import Path
7+ import shutil
68import sys
79
810from shared import PLATFORMS , TRUE_FALSE , VS_VERSION , make_win_artifact_name
@@ -22,28 +24,25 @@ def move(src, dest):
2224 workspace = Path (sys .argv [1 ])
2325 outbase = Path (sys .argv [2 ])
2426
25-
26- include_copied = False
27+ common_copied = False
2728
2829 for platform , uwp in product (PLATFORMS , TRUE_FALSE ):
2930 # ARM/ARM64 is only built for the UWP platform.
3031 if not uwp and (platform .lower () == 'arm' or platform .lower () == 'arm64' ):
3132 continue
3233
33- base = outbase / '{}{}' .format (platform ,
34- '_uwp' if uwp else '' )
35- base . mkdir ( parents = True , exist_ok = True )
34+ platform_dirname = '{}{}' .format (platform ,
35+ '_uwp' if uwp else '' )
36+
3637 name = make_win_artifact_name (platform , uwp )
3738
3839 artifact = workspace / name
3940
40- if not include_copied :
41- # Move over one set of includes to the base
42- move (artifact / 'include' , outbase / 'include' )
43- include_copied = True
41+ if not common_copied :
42+ # Start by copying the full tree over.
43+ shutil .copytree (artifact , outbase , dirs_exist_ok = True )
44+ common_copied = True
45+ continue
4446
4547 # lib files
46- move (artifact / 'lib' , base / 'lib' )
47-
48- # dll files
49- move (artifact / 'bin' , base / 'bin' )
48+ shutil .copytree (artifact / platform_dirname , outbase / platform_dirname , dirs_exist_ok = True )
0 commit comments