diff options
| author | ruki <[email protected]> | 2023-11-09 23:55:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-09 23:55:57 +0800 |
| commit | fcbd4baf1055b02ce4cd71ed96c7d32402f077e9 (patch) | |
| tree | dd9992551afcd157c05f143ee8184f15923a1160 /xmake/plugins | |
| parent | 6fa2d1e158c2d97d9f3f5349874150f06f914cbb (diff) | |
add pack nsis stub
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/pack/main.lua | 13 | ||||
| -rw-r--r-- | xmake/plugins/pack/nsis/main.lua | 28 | ||||
| -rw-r--r-- | xmake/plugins/pack/xpack.lua | 3 |
3 files changed, 40 insertions, 4 deletions
diff --git a/xmake/plugins/pack/main.lua b/xmake/plugins/pack/main.lua index 51de15822..b0a147208 100644 --- a/xmake/plugins/pack/main.lua +++ b/xmake/plugins/pack/main.lua @@ -25,11 +25,16 @@ import("core.project.project") import("private.service.remote_build.action", {alias = "remote_build_action"}) import("xpack") +function _pack_package(package) + assert(package:formats(), "xpack(%s): formats not found, please use `set_formats()` to set it.", package:name()) + for _, format in package:formats():keys() do + import(format)(package) + end +end + function _pack_packages() - for _, instance in pairs(xpack.packages()) do - print("xpack(%s)", instance:name()) - print(" description: %s", instance:description()) - print(" installcmd: ", instance:script("installcmd")) + for _, package in pairs(xpack.packages()) do + _pack_package(package) end end diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua new file mode 100644 index 000000000..695e5b19f --- /dev/null +++ b/xmake/plugins/pack/nsis/main.lua @@ -0,0 +1,28 @@ +--!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("core.base.option") + +function main(package) + print("xpack(%s)", package:name()) + print(" description: %s", package:description()) + print(" installcmd: ", package:script("installcmd")) +end diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua index b22d07a2f..680b75d6d 100644 --- a/xmake/plugins/pack/xpack.lua +++ b/xmake/plugins/pack/xpack.lua @@ -197,6 +197,9 @@ function packages() local formats_need = option.get("formats") if formats_need then formats_need = formats_need:split(",") + if formats_need[1] == "all" then + formats_need = nil + end end local xpack_scope = project.scope("xpack") for name, scope in pairs(xpack_scope) do |
