summaryrefslogtreecommitdiff
path: root/tests/plugins/pack/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-11-26 00:49:39 +0800
committerruki <[email protected]>2025-11-26 00:49:39 +0800
commit7a15f43c268a3cd192fedbcf6f0a65ab80f1646d (patch)
treefd1eb999a9d167361d5bc8399e1780e0e16de0d4 /tests/plugins/pack/xmake.lua
parent79d611989dc8004733a4a81ef7124466788b79f4 (diff)
add pack macapp test
Diffstat (limited to 'tests/plugins/pack/xmake.lua')
-rw-r--r--tests/plugins/pack/xmake.lua74
1 files changed, 0 insertions, 74 deletions
diff --git a/tests/plugins/pack/xmake.lua b/tests/plugins/pack/xmake.lua
deleted file mode 100644
index 244bcaee6..000000000
--- a/tests/plugins/pack/xmake.lua
+++ /dev/null
@@ -1,74 +0,0 @@
-set_version("1.0.0")
-add_rules("mode.debug", "mode.release")
-
-includes("@builtin/xpack")
-
-add_requires("zlib", {configs = {shared = true}})
-
-target("test")
- set_kind("binary")
- add_files("src/*.cpp")
- if is_plat("windows") then
- add_files("src/*.rc")
- end
-
-target("foo")
- set_kind("shared")
- add_files("src/*.cpp")
- add_headerfiles("include/(*.h)")
- add_packages("zlib")
-
-xpack("test")
- set_formats("nsis", "srpm", "rpm", "deb", "zip", "targz", "srczip", "srctargz", "runself", "wix", "dmg")
- set_title("hello")
- set_author("ruki <[email protected]>")
- set_description("A test installer.")
- set_homepage("https://xmake.io")
- set_license("Apache-2.0")
- set_licensefile("LICENSE.md")
- add_targets("test", "foo")
- add_installfiles("src/(assets/*.png)", {prefixdir = "images"})
- add_sourcefiles("(src/**)")
- add_sourcefiles("xmake.lua")
- set_iconfile("src/assets/xmake.ico")
- add_components("LongPath")
-
- on_load(function (package)
- if package:with_source() then
- package:set("basename", "test-$(plat)-src-v$(version)")
- else
- package:set("basename", "test-$(plat)-$(arch)-v$(version)")
- end
- end)
-
- after_installcmd(function (package, batchcmds)
- if package:format() == "runself" then
- batchcmds:runv("echo", {"hello"})
- else
- batchcmds:mkdir(package:installdir("resources"))
- batchcmds:cp("src/assets/*.txt", package:installdir("resources"), {rootdir = "src"})
- batchcmds:mkdir(package:installdir("stub"))
- end
- end)
-
- after_uninstallcmd(function (package, batchcmds)
- batchcmds:rmdir(package:installdir("resources"))
- batchcmds:rmdir(package:installdir("stub"))
- end)
-
-xpack_component("LongPath")
- set_default(false)
- set_title("Enable Long Path")
- set_description("Increases the maximum path length limit, up to 32,767 characters (before 256).")
- on_installcmd(function (component, batchcmds)
- batchcmds:rawcmd("wix", [[
- <RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Control\FileSystem">
- <RegistryValue Type="integer" Name="LongPathsEnabled" Value="1" KeyPath="yes"/>
- </RegistryKey>
- ]])
- batchcmds:rawcmd("nsis", [[
- ${If} $NoAdmin == "false"
- ; Enable long path
- WriteRegDWORD ${HKLM} "SYSTEM\CurrentControlSet\Control\FileSystem" "LongPathsEnabled" 1
- ${EndIf}]])
- end)