summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-09-22 22:30:23 +0800
committerruki <[email protected]>2017-09-22 09:02:23 +0800
commit291b88206009a6fa1953930a5d044b9eabc16bb9 (patch)
treeb680eee9a5742a25e8dad388b09175e4234baca8
parente52dcf0c8dda3fd4f1189af14ce09034d3b31b51 (diff)
add cmake to builin package
m---------tests/projects/requires/source/tboox.tbox0
-rw-r--r--xmake/actions/build/statistics.lua17
-rw-r--r--xmake/actions/require/package.lua6
-rw-r--r--xmake/packages/cmake/xmake.lua19
4 files changed, 38 insertions, 4 deletions
diff --git a/tests/projects/requires/source/tboox.tbox b/tests/projects/requires/source/tboox.tbox
deleted file mode 160000
-Subproject b8d43a17797fb4ac7a57be0373e3528ddf0b720
diff --git a/xmake/actions/build/statistics.lua b/xmake/actions/build/statistics.lua
index e70726b11..faa537597 100644
--- a/xmake/actions/build/statistics.lua
+++ b/xmake/actions/build/statistics.lua
@@ -24,6 +24,9 @@
-- imports
import("core.base.option")
+import("core.project.config")
+import("core.platform.platform")
+import("core.platform.environment")
-- statistics is enabled?
function _is_enabled()
@@ -86,6 +89,7 @@ function post()
function ()
local proc = process.openv("xmake", argv, path.join(os.tmpdir(), projectname .. ".stats.log"))
if proc ~= nil then
+ process.wait(proc, -1)
process.close(proc)
end
end
@@ -100,10 +104,18 @@ function main()
return
end
+ -- load config
+ config.load()
+
+ -- load platform
+ platform.load(config.plat())
+
+ -- enter environment
+ environment.enter("toolchains")
+
-- get the project directory name
local projectname = path.basename(os.projectdir())
- -- TODO git on windows
-- clone the xmake-stats repo to update the traffic(git clones) info in github
local outputdir = path.join(os.tmpdir(), "stats", os.date("%y%m%d"), projectname)
if not os.isdir(outputdir) then
@@ -111,4 +123,7 @@ function main()
clone("https://github.com/tboox/xmake-stats.git", {depth = 1, branch = "master", outputdir = outputdir})
print("post ok!")
end
+
+ -- leave environment
+ environment.leave("toolchains")
end
diff --git a/xmake/actions/require/package.lua b/xmake/actions/require/package.lua
index ea950071c..e311ae300 100644
--- a/xmake/actions/require/package.lua
+++ b/xmake/actions/require/package.lua
@@ -38,9 +38,9 @@ import("repository")
--
-- add_requires("tboox.tbox >=1.5.1", "zlib >=1.2.11")
-- add_requires("zlib master")
--- add_requires("[email protected] >=1.5.1")
--- add_requires("https://github.com/tboox/[email protected] >=1.5.1")
--- add_requires("tboox.tbox >=1.5.1 <1.6.0")
+-- add_requires("[email protected] >=1.5.1")
+-- add_requires("https://github.com/tboox/[email protected] >=1.5.1")
+-- add_requires("tboox.tbox >=1.5.1 <1.6.0", {optional = true})
--
function _parse_require(require_str, requires_extra)
diff --git a/xmake/packages/cmake/xmake.lua b/xmake/packages/cmake/xmake.lua
new file mode 100644
index 000000000..c78f590fd
--- /dev/null
+++ b/xmake/packages/cmake/xmake.lua
@@ -0,0 +1,19 @@
+package("cmake")
+
+ set_kind("binary")
+ set_homepage("https://cmake.org")
+ set_description("A cross-platform family of tool designed to build, test and package software")
+ add_imports("package.manager.install")
+
+ on_build(function (package)
+ end)
+
+ on_install(function (package)
+ install("cmake")
+ end)
+
+ on_install("windows", function (package)
+ -- the winenv with cmake has been installed when installing git
+ raise()
+ end)
+