summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdel Vilkov <[email protected]>2019-04-15 18:08:15 +0300
committerAdel Vilkov <[email protected]>2019-04-15 18:08:15 +0300
commita58d9e70433b5720f3cb314cf6e2463e465130c2 (patch)
tree76f08a357b7aa6e461d68a554b5147de3431c147
parent5ba527330e2179fab1a1da86e84ada542926eae8 (diff)
Replaced clib marker file contents with table for potential future
improvements
-rw-r--r--xmake/modules/package/manager/clib/find_package.lua4
-rw-r--r--xmake/modules/package/manager/clib/install_package.lua8
2 files changed, 6 insertions, 6 deletions
diff --git a/xmake/modules/package/manager/clib/find_package.lua b/xmake/modules/package/manager/clib/find_package.lua
index 7aa9d6ad1..4caf6063d 100644
--- a/xmake/modules/package/manager/clib/find_package.lua
+++ b/xmake/modules/package/manager/clib/find_package.lua
@@ -35,6 +35,6 @@ function main(name, opt)
end
local install_path = io.readfile(marker_path)
- dprint("%s is installed to %s", name, install_path)
- return {includedirs = { install_path }}
+ dprint("found marker file for %s", name)
+ return io.load(marker_path)
end
diff --git a/xmake/modules/package/manager/clib/install_package.lua b/xmake/modules/package/manager/clib/install_package.lua
index d51164f02..0fb057183 100644
--- a/xmake/modules/package/manager/clib/install_package.lua
+++ b/xmake/modules/package/manager/clib/install_package.lua
@@ -29,14 +29,14 @@ function configurations()
{
save = {description = "save dependency in project's package.json", default = false, type = "boolean"},
save_dev = {description = "save as development dependency in project's package.json", default = false, type = "boolean"},
- out_dir = {description = "package installation directory relative to project root", default = "clib"},
+ outputdir = {description = "package installation directory relative to project root", default = "clib"},
}
end
-- install package
-- @param name the package name, e.g. clib::clibs/[email protected]
-- @param opt the options, .e.g { verbose = true,
--- settings = {out_dir = "clib", save = false, save_dev = false}}
+-- settings = {outputdir = "clib", save = false, save_dev = false}}
--
-- @return true or false
--
@@ -48,7 +48,7 @@ function main(name, opt)
end
local argv = {"install", name}
- local abs_out = path.join(os.projectdir(), opt.out_dir)
+ local abs_out = path.join(os.projectdir(), opt.outputdir)
dprint("installing %s to %s", name, abs_out)
table.insert(argv, "-o " .. abs_out)
@@ -77,5 +77,5 @@ function main(name, opt)
local marker_filename = string.gsub(name, "%/", "=")
local marker_path = path.join(cache_dir, marker_filename)
dprint("writing clib marker file for %s to %s", name, marker_path)
- io.writefile(marker_path, abs_out)
+ io.save(marker_path, {includedirs = { abs_out }})
end