aboutsummaryrefslogtreecommitdiff
path: root/xmake.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake.lua')
-rw-r--r--xmake.lua85
1 files changed, 4 insertions, 81 deletions
diff --git a/xmake.lua b/xmake.lua
index 26eb435ac..59c5e7e3f 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -157,87 +157,10 @@ task("bundle")
{nil, "withtrace", "k", nil, "Compiles with trace support"},
}
}
- on_run(function()
- import("core.base.option")
- import("detect.tools.find_zip")
- import("detect.tools.find_7z")
- import("detect.sdks.find_vcpkgdir")
-
- if not is_host("windows") then
- raise("'xmake bundle' not currently supported on this platform")
- end
-
- local zip_cmd = find_7z()
- if not zip_cmd then
- raise("unable to find zip tool")
- end
-
- local dirs = {
- vcpkg = {
- root = find_vcpkgdir(),
- tools = ""
- },
- sentry = {
- root = ""
- },
- package = {
- root = ""
- }
- }
-
- if dirs.vcpkg.root == nil or dirs.vcpkg.root == "" then
- raise("unable to find vcpkg root directory" );
- end
-
- dirs.vcpkg.tools = dirs.vcpkg.root.."/installed/x64-windows-static/tools"
- dirs.sentry.root = dirs.vcpkg.tools.."/sentry-native"
-
- dirs.package_root = "./build/packages/z"
-
- local external_files = {
- dirs.sentry.root.."/crashpad_handler.exe"
- }
-
- dirs.package.root = "./build/packages/z"
-
- dirs.package.zenserver = {
- root = dirs.package.root.."/zenserver",
- windows = dirs.package.root.."/zenserver/windows/x64/release/bin"
- }
-
- local config = "-c -m release -a x64"
- if option.get("withtrace") then
- config = config.." --zentrace=yes"
- end
-
- print(os.exec("xmake config "..config))
- print(os.exec("xmake build zenserver"))
- print(os.exec("xmake package -f local zenserver"))
-
- -- copy extenral file(s)
- for _,file in ipairs(external_files) do
- printf("copy '%s' -> '%s'\n", file, dirs.package.zenserver.windows)
- os.cp(file, dirs.package.zenserver.windows.."/")
- end
-
- -- create zip file
- local bundle_name = "zenserver-win64.zip"
- if option.get("withtrace") then
- bundle_name = "zenserver-trace-win64.zip"
- end
-
- local bundle_path = dirs.package.zenserver.root.."/"..bundle_name
-
- local zip_args = {}
- table.insert(zip_args, "a")
- table.insert(zip_args, bundle_path)
- table.insert(zip_args, dirs.package.zenserver.windows.."/*.*")
-
- print(string.format("creating bundle '%s' from '%s'\n",bundle_path, dirs.package.zenserver.windows.."/"))
- os.runv(zip_cmd, zip_args)
-
- print(string.format("bundle '%s' ok!", bundle_name))
- end)
+ on_run(function ()
+ import("bundle")
+ bundle()
+ end)
task("test")
set_menu {