update scripts

pull/1880/head
ruki 2 years ago
parent b510cb152f
commit 64134295c4
  1. 2
      scripts/build_artifacts.lua
  2. 4
      scripts/packages.lua

@ -44,7 +44,7 @@ function main()
local packagedir = path.directory(file) local packagedir = path.directory(file)
local packagename = path.filename(packagedir) local packagename = path.filename(packagedir)
if #path.filename(path.directory(packagedir)) == 1 then if #path.filename(path.directory(packagedir)) == 1 then
local instance = package.load_from_repository(packagename, nil, packagedir, file) local instance = package.load_from_repository(packagename, nil, packagedir, {packagefile = file})
if instance and packages.is_supported(instance, "windows") if instance and packages.is_supported(instance, "windows")
and (instance.is_headeronly and not instance:is_headeronly()) then and (instance.is_headeronly and not instance:is_headeronly()) then
local versions = instance:versions() local versions = instance:versions()

@ -63,12 +63,12 @@ function main(opt)
for _, packagedir in ipairs(os.dirs(path.join("packages", "*", "*"))) do for _, packagedir in ipairs(os.dirs(path.join("packages", "*", "*"))) do
local packagename = path.filename(packagedir) local packagename = path.filename(packagedir)
local packagefile = path.join(packagedir, "xmake.lua") local packagefile = path.join(packagedir, "xmake.lua")
local instance = package.load_from_repository(packagename, nil, packagedir, packagefile) local instance = package.load_from_repository(packagename, nil, packagedir, {packagefile = packagefile})
local basename = instance:get("base") local basename = instance:get("base")
if instance and basename then if instance and basename then
local basedir = path.join("packages", basename:sub(1, 1):lower(), basename:lower()) local basedir = path.join("packages", basename:sub(1, 1):lower(), basename:lower())
local basefile = path.join(basedir, "xmake.lua") local basefile = path.join(basedir, "xmake.lua")
instance._BASE = package.load_from_repository(basename, nil, basedir, basefile) instance._BASE = package.load_from_repository(basename, nil, basedir, {packagefile = basefile})
end end
if instance then if instance then
for _, plat in ipairs({"windows", "linux", "macosx", "iphoneos", "android", "mingw", "msys", "bsd", "wasm", "cross"}) do for _, plat in ipairs({"windows", "linux", "macosx", "iphoneos", "android", "mingw", "msys", "bsd", "wasm", "cross"}) do

Loading…
Cancel
Save