summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/doxygen/main.lua4
-rw-r--r--xmake/plugins/macro/macros/package.lua2
-rw-r--r--xmake/plugins/pack/main.lua2
-rw-r--r--xmake/plugins/pack/nsis/main.lua2
-rw-r--r--xmake/plugins/pack/runself/main.lua2
-rw-r--r--xmake/plugins/pack/srpm/main.lua8
-rw-r--r--xmake/plugins/pack/wix/main.lua4
-rw-r--r--xmake/plugins/pack/xpack.lua14
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua4
-rw-r--r--xmake/plugins/show/info/basic.lua4
-rw-r--r--xmake/plugins/watch/main.lua4
11 files changed, 28 insertions, 22 deletions
diff --git a/xmake/plugins/doxygen/main.lua b/xmake/plugins/doxygen/main.lua
index cf65cacbc..c0448a508 100644
--- a/xmake/plugins/doxygen/main.lua
+++ b/xmake/plugins/doxygen/main.lua
@@ -52,7 +52,7 @@ function _generate_doxyfile(doxygen)
--
-- OUTPUT_DIRECTORY =
--
- local outputdir = option.get("outputdir") or config.buildir()
+ local outputdir = option.get("outputdir") or config.builddir()
if outputdir then
io.gsub(doxyfile, "OUTPUT_DIRECTORY%s-=.-\n", format("OUTPUT_DIRECTORY = %s\n", outputdir))
os.mkdir(outputdir)
@@ -116,7 +116,7 @@ function main()
os.vrunv(doxygen.program, {doxyfile}, {curdir = project.directory()})
-- done
- local outputdir = option.get("outputdir") or config.buildir()
+ local outputdir = option.get("outputdir") or config.builddir()
cprint("${bright green}result: ${default green}%s/html/index.html", outputdir)
cprint("${color.success}doxygen ok!")
os.setenvs(oldenvs)
diff --git a/xmake/plugins/macro/macros/package.lua b/xmake/plugins/macro/macros/package.lua
index 64ea352de..14a7992c0 100644
--- a/xmake/plugins/macro/macros/package.lua
+++ b/xmake/plugins/macro/macros/package.lua
@@ -88,7 +88,7 @@ function main(argv)
config.load()
os.cd(project.directory())
- local outputdir = args.outputdir or config.get("buildir")
+ local outputdir = args.outputdir or config.builddir()
local targets = {}
if option.get("target") then
local target = project.target(option.get("target"))
diff --git a/xmake/plugins/pack/main.lua b/xmake/plugins/pack/main.lua
index b108be790..dd599a61d 100644
--- a/xmake/plugins/pack/main.lua
+++ b/xmake/plugins/pack/main.lua
@@ -52,7 +52,7 @@ end
function _load_package(package)
-- ensure build and output directories
- os.tryrm(package:buildir())
+ os.tryrm(package:builddir())
os.mkdir(package:outputdir())
-- load it
diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua
index 64c002042..d252d5e4f 100644
--- a/xmake/plugins/pack/nsis/main.lua
+++ b/xmake/plugins/pack/nsis/main.lua
@@ -254,7 +254,7 @@ end
function _pack_nsis(makensis, package)
-- install the initial specfile
- local specfile = path.join(package:buildir(), package:basename() .. ".nsi")
+ local specfile = path.join(package:builddir(), package:basename() .. ".nsi")
if not os.isfile(specfile) then
local specfile_template = package:get("specfile") or path.join(os.programdir(), "scripts", "xpack", "nsis", "makensis.nsi")
os.cp(specfile_template, specfile)
diff --git a/xmake/plugins/pack/runself/main.lua b/xmake/plugins/pack/runself/main.lua
index 91284edc0..47ab74eee 100644
--- a/xmake/plugins/pack/runself/main.lua
+++ b/xmake/plugins/pack/runself/main.lua
@@ -108,7 +108,7 @@ end
function _pack_runself(makeself, package)
-- install the initial specfile
- local specfile = path.join(package:buildir(), package:basename() .. ".lsm")
+ local specfile = path.join(package:builddir(), package:basename() .. ".lsm")
if not os.isfile(specfile) then
local specfile_template = package:get("specfile") or path.join(os.programdir(), "scripts", "xpack", "runself", "makeself.lsm")
os.cp(specfile_template, specfile, {writeable = true})
diff --git a/xmake/plugins/pack/srpm/main.lua b/xmake/plugins/pack/srpm/main.lua
index 72b76563e..e8600427a 100644
--- a/xmake/plugins/pack/srpm/main.lua
+++ b/xmake/plugins/pack/srpm/main.lua
@@ -57,7 +57,7 @@ end
-- get archive file
function _get_archivefile(package)
- return path.absolute(path.join(package:buildir(), package:basename() .. ".tar.gz"))
+ return path.absolute(path.join(package:builddir(), package:basename() .. ".tar.gz"))
end
-- translate the file path
@@ -202,7 +202,7 @@ function _pack_srpm(rpmbuild, package)
end
-- install the initial specfile
- local specfile = path.join(package:buildir(), package:basename() .. ".spec")
+ local specfile = path.join(package:builddir(), package:basename() .. ".spec")
if not os.isfile(specfile) then
local specfile_template = package:get("specfile") or path.join(os.programdir(), "scripts", "xpack", "srpm", "srpm.spec")
os.cp(specfile_template, specfile, {writeable = true})
@@ -263,8 +263,8 @@ function _pack_srpm(rpmbuild, package)
-- pack srpm package
os.vrunv(rpmbuild, {"-bs", specfile,
- "--define", "_topdir " .. package:buildir(),
- "--define", "_sourcedir " .. package:buildir(),
+ "--define", "_topdir " .. package:builddir(),
+ "--define", "_sourcedir " .. package:builddir(),
"--define", "_srcrpmdir " .. package:outputdir()})
-- pack rpm package
diff --git a/xmake/plugins/pack/wix/main.lua b/xmake/plugins/pack/wix/main.lua
index a99070def..5d04eb7f5 100644
--- a/xmake/plugins/pack/wix/main.lua
+++ b/xmake/plugins/pack/wix/main.lua
@@ -240,7 +240,7 @@ function _get_specvars(package)
rtf_string = _to_rtf_string(io.readfile(licensefile))
end
- local rtf_file = path.join(package:buildir(), "license.rtf")
+ local rtf_file = path.join(package:builddir(), "license.rtf")
io.writefile(rtf_file, rtf_string)
return rtf_file
end
@@ -258,7 +258,7 @@ end
function _pack_wix(wix, package)
-- install the initial specfile
- local specfile = path.join(package:buildir(), package:basename() .. ".wxs")
+ local specfile = path.join(package:builddir(), package:basename() .. ".wxs")
if not os.isfile(specfile) then
local specfile_template = package:get("specfile") or path.join(os.programdir(), "scripts", "xpack", "wix", "msi.wxs")
os.cp(specfile_template, specfile)
diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua
index 5cd3431a5..780d6ca36 100644
--- a/xmake/plugins/pack/xpack.lua
+++ b/xmake/plugins/pack/xpack.lua
@@ -256,15 +256,21 @@ function xpack:with_binary()
end
-- get the build directory
+function xpack:builddir()
+ return path.join(config.builddir(), ".xpack", self:name())
+end
+
+-- get the build directory (deprecated)
function xpack:buildir()
- return path.join(config.buildir(), ".xpack", self:name())
+ wprint("xpack:buildir() has been deprecated, please use xpack:builddir()")
+ return self:builddir()
end
-- get the output directory
function xpack:outputdir()
local outputdir = option.get("outputdir")
if outputdir == nil then
- outputdir = path.join(config.buildir(), "xpack", self:name())
+ outputdir = path.join(config.builddir(), "xpack", self:name())
end
return outputdir
end
@@ -420,7 +426,7 @@ end
-- get the installed root directory, this is just a temporary sandbox installation path,
-- we may replace it with the actual installation path in the specfile
function xpack:install_rootdir()
- return path.join(self:buildir(), "installed", self:format())
+ return path.join(self:builddir(), "installed", self:format())
end
-- get the installed directory
@@ -440,7 +446,7 @@ end
-- get the source root directory
function xpack:source_rootdir()
- return path.join(self:buildir(), "source", self:format())
+ return path.join(self:builddir(), "source", self:format())
end
-- get the source directory
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 12d6497c0..ae69fbb58 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -131,7 +131,7 @@ function _make_targetinfo(mode, arch, target)
-- save dirs
targetinfo.targetdir = _make_dirs(target:get("targetdir"))
- targetinfo.buildir = _make_dirs(config.get("buildir"))
+ targetinfo.builddir = _make_dirs(config.get("builddir") or config.get("buildir"))
targetinfo.rundir = _make_dirs(target:get("rundir"))
targetinfo.configdir = _make_dirs(os.getenv("XMAKE_CONFIGDIR"))
targetinfo.configfiledir = _make_dirs(target:get("configdir"))
@@ -425,7 +425,7 @@ function main(outputdir, vsinfo)
-- init config flags
local flags = {}
for k, v in table.orderpairs(localcache.get("config", "options")) do
- if k ~= "plat" and k ~= "mode" and k ~= "arch" and k ~= "clean" and k ~= "buildir" then
+ if k ~= "plat" and k ~= "mode" and k ~= "arch" and k ~= "clean" and k ~= "builddir" and k ~= "buildir" then
table.insert(flags, "--" .. k .. "=" .. tostring(v))
end
end
diff --git a/xmake/plugins/show/info/basic.lua b/xmake/plugins/show/info/basic.lua
index 697f0da29..46840b55e 100644
--- a/xmake/plugins/show/info/basic.lua
+++ b/xmake/plugins/show/info/basic.lua
@@ -60,8 +60,8 @@ function main()
if config.mode() then
cprint(" ${color.dump.string}mode${clear}: %s", config.mode())
end
- if config.buildir() then
- cprint(" ${color.dump.string}buildir${clear}: %s", config.buildir())
+ if config.builddir() then
+ cprint(" ${color.dump.string}builddir${clear}: %s", config.builddir())
end
cprint(" ${color.dump.string}configdir${clear}: %s", config.directory())
cprint(" ${color.dump.string}projectdir${clear}: %s", os.projectdir())
diff --git a/xmake/plugins/watch/main.lua b/xmake/plugins/watch/main.lua
index cbef811ae..f7269caf9 100644
--- a/xmake/plugins/watch/main.lua
+++ b/xmake/plugins/watch/main.lua
@@ -52,8 +52,8 @@ function _add_watchdirs()
elseif os.isfile(os.projectfile()) then
watchdirs = os.dirs(path.join(os.projectdir(), "*|.*"))
for _, watchdir in ipairs(watchdirs) do
- local buildir = path.absolute(config.buildir())
- if path.absolute(watchdir) ~= buildir then
+ local builddir = path.absolute(config.builddir())
+ if path.absolute(watchdir) ~= builddir then
_add_watchdir(watchdir, {recursion = true})
end
end