diff options
| author | ruki <[email protected]> | 2023-11-17 23:54:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-17 23:54:59 +0800 |
| commit | 14f1ed5587ebe19a644f4832c059ff4ec830f6df (patch) | |
| tree | 27e9173c19fe656f4f96497133748a5df2838c00 | |
| parent | 45e0cdff6efa8afa9a097b40fef9539c8561b779 (diff) | |
add targz format
| -rw-r--r-- | tests/plugins/pack/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/pack/archive.lua | 3 | ||||
| -rw-r--r-- | xmake/plugins/pack/targz/main.lua | 26 | ||||
| -rw-r--r-- | xmake/plugins/pack/xpack.lua | 5 |
4 files changed, 31 insertions, 5 deletions
diff --git a/tests/plugins/pack/xmake.lua b/tests/plugins/pack/xmake.lua index 9142e3aa8..2828524f2 100644 --- a/tests/plugins/pack/xmake.lua +++ b/tests/plugins/pack/xmake.lua @@ -19,7 +19,7 @@ target("foo") add_packages("zlib") xpack("test") - set_formats("nsis", "zip") + set_formats("nsis", "zip", "targz") set_description("hello") set_licensefile("LICENSE.md") add_targets("test", "foo") diff --git a/xmake/plugins/pack/archive.lua b/xmake/plugins/pack/archive.lua index 585fc7dc1..2db7a1e3c 100644 --- a/xmake/plugins/pack/archive.lua +++ b/xmake/plugins/pack/archive.lua @@ -80,7 +80,6 @@ function _pack_archive(package) end function main(package) - cprint("packing %s", package:outputfile()) - _pack_archive(package) + cprint("packing %s .. ", package:outputfile()) end diff --git a/xmake/plugins/pack/targz/main.lua b/xmake/plugins/pack/targz/main.lua new file mode 100644 index 000000000..fe511bff9 --- /dev/null +++ b/xmake/plugins/pack/targz/main.lua @@ -0,0 +1,26 @@ +--!A cross-platform build utility based on Lua +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +-- Copyright (C) 2015-present, TBOOX Open Source Group. +-- +-- @author ruki +-- @file main.lua +-- + +-- imports +import(".archive") + +function main(package) + archive(package) +end diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua index 4d32d6c08..0c255c6b2 100644 --- a/xmake/plugins/pack/xpack.lua +++ b/xmake/plugins/pack/xpack.lua @@ -323,8 +323,9 @@ end -- get the output filename function xpack:filename() local extensions = { - nsis = ".exe", - zip = ".zip" + nsis = ".exe", + zip = ".zip", + targz = ".tar.gz" } local extension = extensions[self:format()] or "" return self:basename() .. extension |
