[edk2-devel] [edk2-staging/EdkRepo] [PATCH 3/3] EdkRepo: Multiple Command Package Build Script Update

Desimone, Ashley E ashley.e.desimone at intel.com
Mon Oct 28 23:22:45 UTC 2019


Add support for building extension packages.

Signed-off-by: Ashley E Desimone <ashley.e.desimone at intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Cc: Puja Pandya <puja.pandya at intel.com>
---
 build-scripts/set_version_and_build_wheels.py | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/build-scripts/set_version_and_build_wheels.py b/build-scripts/set_version_and_build_wheels.py
index e8d467e..6fd5ab5 100755
--- a/build-scripts/set_version_and_build_wheels.py
+++ b/build-scripts/set_version_and_build_wheels.py
@@ -195,16 +195,23 @@ def make_selfextract_version_script(version):
         ver.write('chcp 437\n')
     print("VersionInfo script written to set_version.bat\n")
 
-def build_wheels():
+def build_wheels(extension_pkgs):
     dir_path = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
     file_path = os.path.join(dir_path, "setup.py")
     if ostype == WIN:
         check_call("py {} \"{}\" bdist_wheel".format(PYTHON_VERSION, file_path), shell=True, cwd=dir_path)
     else:
         check_call('python3 "{}" bdist_wheel'.format(file_path), shell=True, cwd=dir_path)
+    for pkg in extension_pkgs:
+        ext_dir_path = os.path.abspath(pkg)
+        ext_file_path = os.path.join(ext_dir_path, 'setup.py')
+        if ostype == WIN:
+            check_call("py {} \"{}\" bdist_wheel".format(PYTHON_VERSION, ext_file_path), shell=True, cwd=ext_dir_path)
+        else:
+            check_call('python3 "{}" bdist_wheel'.format(ext_file_path), shell=True, cwd=ext_dir_path)
     print("Wheels built successfully")
 
-def copy_wheels_and_set_xml(package_version):
+def copy_wheels_and_set_xml(package_version, extension_pkgs):
     dir_path = os.path.join(os.path.dirname(os.path.abspath(os.path.dirname(__file__))), "dist")
     dest_path = os.path.join(dir_path, "self_extract")
     if ostype == LINUX:
@@ -218,6 +225,14 @@ def copy_wheels_and_set_xml(package_version):
             if data:
                 wheels.append((data.group(1), file_name))
                 _copy_file(os.path.join(dir_path, file_name), os.path.join(dest_path, file_name))
+    for pkg in extension_pkgs:
+        ext_dir_path = os.path.join(os.path.abspath(pkg), 'dist')
+        for file_name in os.listdir(ext_dir_path):
+            if fnmatch.fnmatch(file_name, "*.whl"):
+                data = wheel_package.match(file_name)
+                if data:
+                    wheels.append((data.group(1), file_name))
+                    _copy_file(os.path.join(ext_dir_path, file_name), os.path.join(dest_path, file_name))
     _set_version_number_and_wheels_cr_tools_installer_config(package_version, wheels)
 
 def create_final_copy_script(version):
@@ -251,6 +266,7 @@ def make_version_cfg_file(version):
             install_cfg.write(f)
 
 def main():
+    extension_pkgs = []
     print("Building Python packages and generating new version number...")
     (version, package_version) = get_current_version_number()
     set_version_number_setup_py(package_version)
@@ -259,8 +275,8 @@ def main():
         set_version_number_setup_launcher_rc(version)
         make_selfextract_version_script(version)
     print("Version number generated and set successfully")
-    build_wheels()
-    copy_wheels_and_set_xml(package_version)
+    build_wheels(extension_pkgs)
+    copy_wheels_and_set_xml(package_version, extension_pkgs)
     make_version_cfg_file(version)
     create_final_copy_script(version)
 
-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49559): https://edk2.groups.io/g/devel/message/49559
Mute This Topic: https://groups.io/mt/39101781/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list