From b507b7a077578e551f5d78f0c5af1b052c4b223c Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Wed, 31 Jul 2024 21:46:56 +0800 Subject: [PATCH] relax conditions on building artifacts (#4802) --- scripts/build_artifacts.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/build_artifacts.lua b/scripts/build_artifacts.lua index c2b01949d..da8e5980c 100644 --- a/scripts/build_artifacts.lua +++ b/scripts/build_artifacts.lua @@ -14,6 +14,10 @@ function _load_package(packagename, packagedir, packagefile) end end +function _need_artifact(instance) + return (not instance:is_headeronly()) and (packages_util.is_supported(instance, "windows", "x64") or packages_util.is_supported(instance, "windows", "x86")) +end + function _build_artifacts(name, versions) local buildinfo = {name = name, versions = versions} print(buildinfo) @@ -60,8 +64,7 @@ function _get_latest_modified_packages() local packagename = path.filename(packagedir) if #path.filename(path.directory(packagedir)) == 1 then local instance = _load_package(packagename, packagedir, file) - if instance and packages_util.is_supported(instance, "windows") - and (instance.is_headeronly and not instance:is_headeronly()) then + if instance and _need_artifact(instance) then table.insert(instances, instance) print(" > %s", instance:name()) end @@ -86,8 +89,7 @@ function _get_all_packages() local basefile = path.join(basedir, "xmake.lua") instance._BASE = _load_package(basename, basedir, basefile) end - if instance and packages_util.is_supported(instance, "windows") - and (instance.is_headeronly and not instance:is_headeronly()) then + if instance and _need_artifact(instance) then table.insert(packages, instance) end end @@ -128,8 +130,7 @@ function _get_packagerefs_in_latest_24h() local packagename = path.filename(packagedir) if #path.filename(path.directory(packagedir)) == 1 then local instance = _load_package(packagename, packagedir, file) - if instance and packages_util.is_supported(instance, "windows") - and (instance.is_headeronly and not instance:is_headeronly()) then + if instance and _need_artifact(instance) then table.insert(instances, instance) end end