diff options
| author | ruki <[email protected]> | 2021-11-13 12:09:14 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-11-13 12:09:14 +0800 |
| commit | 7625d0368ebf5dd461566b802ebb464cda2b1c9d (patch) | |
| tree | a2fc77574f906c5f704d6a8f3f64a042477beab2 | |
| parent | e0c6eda852156eba4a177bb67c5775d41f207734 (diff) | |
add cargo.install_package stub
| -rw-r--r-- | xmake/modules/package/manager/cargo/find_package.lua | 35 | ||||
| -rw-r--r-- | xmake/modules/package/manager/cargo/install_package.lua | 46 |
2 files changed, 81 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/cargo/find_package.lua b/xmake/modules/package/manager/cargo/find_package.lua new file mode 100644 index 000000000..8ed72efec --- /dev/null +++ b/xmake/modules/package/manager/cargo/find_package.lua @@ -0,0 +1,35 @@ +--!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 find_package.lua +-- + +-- imports +import("core.base.option") +import("core.base.semver") +import("core.project.config") +import("core.project.target") +import("lib.detect.find_tool") +import("lib.detect.find_file") + +-- find package using the cargo package manager +-- +-- @param name the package name +-- @param opt the options, e.g. {verbose = true, require_version = "1.12.x") +-- +function main(name, opt) +end diff --git a/xmake/modules/package/manager/cargo/install_package.lua b/xmake/modules/package/manager/cargo/install_package.lua new file mode 100644 index 000000000..cbf1df8f2 --- /dev/null +++ b/xmake/modules/package/manager/cargo/install_package.lua @@ -0,0 +1,46 @@ +--!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 install_package.lua +-- + +-- imports +import("core.base.option") +import("core.project.config") +import("lib.detect.find_tool") + +-- install package +-- +-- e.g. +-- add_requires("cargo::zip") +-- add_requires("cargo::zip >0.3") +-- add_requires("cargo::zip 0.3.1") +-- +-- @param name the package name, e.g. cargo::zip +-- @param opt the options, e.g. { verbose = true, mode = "release", plat = , arch = , require_version = "x.x.x"} +-- +-- @return true or false +-- +function main(name, opt) + + -- find cargo + local cargo = find_tool("cargo") + if not cargo then + raise("cargo not found!") + end + +end |
