diff options
| author | ruki <[email protected]> | 2019-03-14 22:50:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-03-14 11:02:51 +0800 |
| commit | fbf5ca5b9f93713dd2d7017674aebcdd31aaa2aa (patch) | |
| tree | 89f1bd9604f4f2bf58fe99b3fe67655c6d2f652f /xmake/core/package/package.lua | |
| parent | dd6aeb6af01259e38472228ecc1aa7c9fc96f7bd (diff) | |
add_configs for package
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 91d5bb07f..e3a6579d6 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -76,6 +76,11 @@ function _instance:add(name, ...) self._INFO:apival_add(name, ...) end +-- get the extra configuration +function _instance:extraconf(name, item, key) + return self._INFO:extraconf(name, item, key) +end + -- get the package description function _instance:description() return self:get("description") @@ -418,11 +423,19 @@ function _instance:requireinfo_set(requireinfo) self._REQUIREINFO = requireinfo end --- get the all configuration values of package +-- get the given configuration value of package +function _instance:config(name) + local configs = self:configs() + if configs then + return configs[name] + end +end + +-- get the configurations of package function _instance:configs() local requireinfo = self:requireinfo() if requireinfo then - return requireinfo.config + return requireinfo.configs end end @@ -447,14 +460,6 @@ function _instance:group() end end --- get the given configuration value of package -function _instance:config(name) - local configs = self:configs() - if configs then - return configs[name] - end -end - -- is optional package? function _instance:optional() local requireinfo = self:requireinfo() @@ -691,6 +696,7 @@ function package.apis() , "package.add_deps" , "package.add_urls" , "package.add_imports" + , "package.add_configs" } , script = { |
