# - Junit Logger\r
# - output_stream the StringIO output stream from this plugin via logging\r
def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM, PLMHelper, tc, output_stream=None):\r
- edk2_path = Edk2pathObj.WorkspacePath\r
+ workspace_path = Edk2pathObj.WorkspacePath\r
basetools_path = environment.GetValue("EDK_TOOLS_PATH")\r
python_path = os.path.join(basetools_path, "Source", "Python")\r
env = shell_environment.GetEnvironment()\r
env.set_shell_var('PYTHONPATH', python_path)\r
- env.set_shell_var('WORKSPACE', edk2_path)\r
+ env.set_shell_var('WORKSPACE', workspace_path)\r
self.ECC_PASS = True\r
- self.ApplyConfig(pkgconfig, edk2_path, basetools_path, packagename)\r
+ self.ApplyConfig(pkgconfig, workspace_path, basetools_path, packagename)\r
modify_dir_list = self.GetModifyDir(packagename)\r
patch = self.GetDiff(packagename)\r
- ecc_diff_range = self.GetDiffRange(patch, packagename, edk2_path)\r
- self.GenerateEccReport(modify_dir_list, ecc_diff_range, edk2_path, basetools_path)\r
- ecc_log = os.path.join(edk2_path, "Ecc.log")\r
+ ecc_diff_range = self.GetDiffRange(patch, packagename, workspace_path)\r
+ self.GenerateEccReport(modify_dir_list, ecc_diff_range, workspace_path, basetools_path)\r
+ ecc_log = os.path.join(workspace_path, "Ecc.log")\r
self.RevertCode()\r
if self.ECC_PASS:\r
tc.SetSuccess()\r
return comment_range\r
\r
def GenerateEccReport(self, modify_dir_list: List[str], ecc_diff_range: Dict[str, List[Tuple[int, int]]],\r
- edk2_path: str, basetools_path: str) -> None:\r
+ workspace_path: str, basetools_path: str) -> None:\r
ecc_need = False\r
ecc_run = True\r
config = os.path.join(basetools_path, "Source", "Python", "Ecc", "config.ini")\r
exception = os.path.join(basetools_path, "Source", "Python", "Ecc", "exception.xml")\r
- report = os.path.join(edk2_path, "Ecc.csv")\r
+ report = os.path.join(workspace_path, "Ecc.csv")\r
for modify_dir in modify_dir_list:\r
- target = os.path.join(edk2_path, modify_dir)\r
+ target = os.path.join(workspace_path, modify_dir)\r
logging.info('Run ECC tool for the commit in %s' % modify_dir)\r
ecc_need = True\r
ecc_params = "-c {0} -e {1} -t {2} -r {3}".format(config, exception, target, report)\r
- return_code = RunCmd("Ecc", ecc_params, workingdir=edk2_path)\r
+ return_code = RunCmd("Ecc", ecc_params, workingdir=workspace_path)\r
if return_code != 0:\r
ecc_run = False\r
break\r
if not ecc_run:\r
logging.error('Fail to run ECC tool')\r
- self.ParseEccReport(ecc_diff_range, edk2_path)\r
+ self.ParseEccReport(ecc_diff_range, workspace_path)\r
\r
if not ecc_need:\r
logging.info("Doesn't need run ECC check")\r
RunCmd("git", revert_params)\r
return\r
\r
- def ParseEccReport(self, ecc_diff_range: Dict[str, List[Tuple[int, int]]], edk2_path: str) -> None:\r
- ecc_log = os.path.join(edk2_path, "Ecc.log")\r
+ def ParseEccReport(self, ecc_diff_range: Dict[str, List[Tuple[int, int]]], workspace_path: str) -> None:\r
+ ecc_log = os.path.join(workspace_path, "Ecc.log")\r
ecc_csv = "Ecc.csv"\r
- file = os.listdir(edk2_path)\r
+ file = os.listdir(workspace_path)\r
row_lines = []\r
ignore_error_code = self.GetIgnoreErrorCode()\r
if ecc_csv in file:\r
log.writelines(all_line)\r
return\r
\r
- def ApplyConfig(self, pkgconfig: Dict[str, List[str]], edk2_path: str, basetools_path: str, pkg: str) -> None:\r
+ def ApplyConfig(self, pkgconfig: Dict[str, List[str]], workspace_path: str, basetools_path: str, pkg: str) -> None:\r
if "IgnoreFiles" in pkgconfig:\r
for a in pkgconfig["IgnoreFiles"]:\r
- a = os.path.join(edk2_path, pkg, a)\r
+ a = os.path.join(workspace_path, pkg, a)\r
a = a.replace(os.sep, "/")\r
\r
logging.info("Ignoring Files {0}".format(a))\r