BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1680
Respect artifact location within directory structure.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Christian Rodriguez <christian.rodriguez@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
FileDir = path.join(GlobalData.gBinCacheDest, self.Arch, self.SourceDir, self.MetaFile.BaseName)\r
CreateDirectory (FileDir)\r
HashFile = path.join(self.BuildDir, self.Name + '.hash')\r
FileDir = path.join(GlobalData.gBinCacheDest, self.Arch, self.SourceDir, self.MetaFile.BaseName)\r
CreateDirectory (FileDir)\r
HashFile = path.join(self.BuildDir, self.Name + '.hash')\r
- ModuleFile = path.join(self.OutputDir, self.Name + '.inf')\r
if os.path.exists(HashFile):\r
shutil.copy2(HashFile, FileDir)\r
if os.path.exists(HashFile):\r
shutil.copy2(HashFile, FileDir)\r
+ if self.IsLibrary:\r
+ return\r
+ ModuleFile = path.join(self.OutputDir, self.Name + '.inf')\r
if os.path.exists(ModuleFile):\r
shutil.copy2(ModuleFile, FileDir)\r
if not self.OutputFile:\r
if os.path.exists(ModuleFile):\r
shutil.copy2(ModuleFile, FileDir)\r
if not self.OutputFile:\r
if not os.path.isabs(File):\r
File = os.path.join(self.OutputDir, File)\r
if os.path.exists(File):\r
if not os.path.isabs(File):\r
File = os.path.join(self.OutputDir, File)\r
if os.path.exists(File):\r
- shutil.copy2(File, FileDir)\r
+ sub_dir = os.path.relpath(File, self.OutputDir)\r
+ destination_file = os.path.join(FileDir, sub_dir)\r
+ destination_dir = os.path.dirname(destination_file)\r
+ CreateDirectory(destination_dir)\r
+ shutil.copy2(File, destination_dir)\r
\r
def AttemptModuleCacheCopy(self):\r
# If library or Module is binary do not skip by hash\r
\r
def AttemptModuleCacheCopy(self):\r
# If library or Module is binary do not skip by hash\r
shutil.copy2(HashFile, self.BuildDir)\r
else:\r
File = path.join(root, f)\r
shutil.copy2(HashFile, self.BuildDir)\r
else:\r
File = path.join(root, f)\r
- shutil.copy2(File, self.OutputDir)\r
+ sub_dir = os.path.relpath(File, FileDir)\r
+ destination_file = os.path.join(self.OutputDir, sub_dir)\r
+ destination_dir = os.path.dirname(destination_file)\r
+ CreateDirectory(destination_dir)\r
+ shutil.copy2(File, destination_dir)\r
if self.Name == "PcdPeim" or self.Name == "PcdDxe":\r
CreatePcdDatabaseCode(self, TemplateString(), TemplateString())\r
return True\r
if self.Name == "PcdPeim" or self.Name == "PcdDxe":\r
CreatePcdDatabaseCode(self, TemplateString(), TemplateString())\r
return True\r