From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Sean Brogan <sean.brogan@microsoft.com>,
Bob Feng <bob.c.feng@intel.com>,
Liming Gao <liming.gao@intel.com>
Subject: [Patch 4/4] BaseTools/WindowsVsToolChain: Clean up Python source formatting
Date: Thu, 6 Feb 2020 15:07:15 -0800 [thread overview]
Message-ID: <20200206230715.15564-5-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20200206230715.15564-1-michael.d.kinney@intel.com>
From: Sean Brogan <sean.brogan@microsoft.com>
https://bugzilla.tianocore.org/show_bug.cgi?id=2495
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../WindowsVsToolChain/WindowsVsToolChain.py | 45 +++++++++++--------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
index e3c4cc94a3..c9279e1c75 100644
--- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
+++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
@@ -1,4 +1,4 @@
-## @file WindowsVsToolChain.py
+# @file WindowsVsToolChain.py
# Plugin to configures paths for the VS2017 and VS2019 tool chain
##
# This plugin works in conjuncture with the tools_def
@@ -14,6 +14,7 @@ from edk2toollib.windows.locate_tools import FindWithVsWhere
from edk2toolext.environment import shell_environment
from edk2toolext.environment import version_aggregator
+
class WindowsVsToolChain(IUefiBuildPlugin):
def do_post_build(self, thebuilder):
@@ -28,9 +29,9 @@ class WindowsVsToolChain(IUefiBuildPlugin):
#
# VS2017 - Follow VS2017 where there is potential for many versions of the tools.
# If a specific version is required then the user must set both env variables:
- ## VS150INSTALLPATH: base install path on system to VC install dir. Here you will find the VC folder, etc
- ## VS150TOOLVER: version number for the VC compiler tools
- ## VS2017_PREFIX: path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
+ # VS150INSTALLPATH: base install path on system to VC install dir. Here you will find the VC folder, etc
+ # VS150TOOLVER: version number for the VC compiler tools
+ # VS2017_PREFIX: path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
if thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2017":
# check to see if full path already configured
@@ -38,11 +39,13 @@ class WindowsVsToolChain(IUefiBuildPlugin):
self.Logger.info("VS2017_PREFIX is already set.")
else:
- install_path = self._get_vs_install_path("VS2017".lower(), "VS150INSTALLPATH")
+ install_path = self._get_vs_install_path(
+ "VS2017".lower(), "VS150INSTALLPATH")
vc_ver = self._get_vc_version(install_path, "VS150TOOLVER")
if install_path is None or vc_ver is None:
- self.Logger.error("Failed to configure environment for VS2017")
+ self.Logger.error(
+ "Failed to configure environment for VS2017")
return -1
version_aggregator.GetVersionAggregator().ReportVersion(
@@ -50,8 +53,9 @@ class WindowsVsToolChain(IUefiBuildPlugin):
version_aggregator.GetVersionAggregator().ReportVersion(
"VC Version", vc_ver, version_aggregator.VersionTypes.TOOL)
- #make VS2017_PREFIX to align with tools_def.txt
- prefix = os.path.join(install_path, "VC", "Tools", "MSVC", vc_ver)
+ # make VS2017_PREFIX to align with tools_def.txt
+ prefix = os.path.join(install_path, "VC",
+ "Tools", "MSVC", vc_ver)
prefix = prefix + os.path.sep
shell_environment.GetEnvironment().set_shell_var("VS2017_PREFIX", prefix)
@@ -73,9 +77,9 @@ class WindowsVsToolChain(IUefiBuildPlugin):
#
# VS2019 - Follow VS2019 where there is potential for many versions of the tools.
# If a specific version is required then the user must set both env variables:
- ## VS160INSTALLPATH: base install path on system to VC install dir. Here you will find the VC folder, etc
- ## VS160TOOLVER: version number for the VC compiler tools
- ## VS2019_PREFIX: path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
+ # VS160INSTALLPATH: base install path on system to VC install dir. Here you will find the VC folder, etc
+ # VS160TOOLVER: version number for the VC compiler tools
+ # VS2019_PREFIX: path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
elif thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2019":
# check to see if full path already configured
@@ -83,11 +87,13 @@ class WindowsVsToolChain(IUefiBuildPlugin):
self.Logger.info("VS2019_PREFIX is already set.")
else:
- install_path = self._get_vs_install_path("VS2019".lower(), "VS160INSTALLPATH")
+ install_path = self._get_vs_install_path(
+ "VS2019".lower(), "VS160INSTALLPATH")
vc_ver = self._get_vc_version(install_path, "VS160TOOLVER")
if install_path is None or vc_ver is None:
- self.Logger.error("Failed to configure environment for VS2019")
+ self.Logger.error(
+ "Failed to configure environment for VS2019")
return -1
version_aggregator.GetVersionAggregator().ReportVersion(
@@ -95,8 +101,9 @@ class WindowsVsToolChain(IUefiBuildPlugin):
version_aggregator.GetVersionAggregator().ReportVersion(
"VC Version", vc_ver, version_aggregator.VersionTypes.TOOL)
- #make VS2019_PREFIX to align with tools_def.txt
- prefix = os.path.join(install_path, "VC", "Tools", "MSVC", vc_ver)
+ # make VS2019_PREFIX to align with tools_def.txt
+ prefix = os.path.join(install_path, "VC",
+ "Tools", "MSVC", vc_ver)
prefix = prefix + os.path.sep
shell_environment.GetEnvironment().set_shell_var("VS2019_PREFIX", prefix)
@@ -126,14 +133,16 @@ class WindowsVsToolChain(IUefiBuildPlugin):
if rc == 0 and path is not None and os.path.exists(path):
self.Logger.debug("Found VS instance for %s", vs_version)
else:
- self.Logger.error("Failed to find VS instance with VsWhere (%d)" % rc)
+ self.Logger.error(
+ "Failed to find VS instance with VsWhere (%d)" % rc)
return path
def _get_vc_version(self, path, varname):
# check if already specified
vc_ver = shell_environment.GetEnvironment().get_shell_var(varname)
if (path is None):
- self.Logger.critical("Failed to find Visual Studio tools. Might need to check for VS install")
+ self.Logger.critical(
+ "Failed to find Visual Studio tools. Might need to check for VS install")
return vc_ver
if(vc_ver is None):
# Not specified...find latest
@@ -145,5 +154,3 @@ class WindowsVsToolChain(IUefiBuildPlugin):
vc_ver = os.listdir(p2)[-1].strip() # get last in list
self.Logger.debug("Found VC Tool version is %s" % vc_ver)
return vc_ver
-
-
--
2.21.0.windows.1
next prev parent reply other threads:[~2020-02-06 23:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 23:07 [Patch 0/4] Fix Structured PCD Application CI build issues Michael D Kinney
2020-02-06 23:07 ` [Patch 1/4] BaseTools/Build: Do not use Common.lib in Structured PCD app Michael D Kinney
2020-02-07 3:43 ` Bob Feng
2020-02-06 23:07 ` [Patch 2/4] BaseTools/PcdValueCommon: Fix 64-bit host compiler error Michael D Kinney
2020-02-07 2:47 ` Bob Feng
2020-02-06 23:07 ` [Patch 3/4] BaseTools/WindowsVsToolChain: Setup VS2017/VS2019 env Michael D Kinney
2020-02-07 3:32 ` Bob Feng
2020-02-06 23:07 ` Michael D Kinney [this message]
2020-02-07 3:28 ` [Patch 4/4] BaseTools/WindowsVsToolChain: Clean up Python source formatting Bob Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200206230715.15564-5-michael.d.kinney@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox