diff options
| author | ruki <[email protected]> | 2025-12-22 14:21:12 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-22 14:21:12 +0800 |
| commit | ec6b795ae184f9c7e1d14f0b6de99afeff7bb89b (patch) | |
| tree | 9532936986f626ad32fbbd6b7b08ffcbc3c567bd | |
| parent | b626131f4dd8e329718c175a5430cf0b48266a1d (diff) | |
| parent | a699d95a122367dba7e92b5772430b8b6bf3fa72 (diff) | |
Merge pull request #7160 from xmake-io/repo
remove load deprecated xmake.lua in repository rootdir
| -rw-r--r-- | xmake/core/package/package.lua | 5 | ||||
| -rw-r--r-- | xmake/core/package/repository.lua | 43 | ||||
| -rw-r--r-- | xmake/plugins/repo/main.lua | 25 |
3 files changed, 1 insertions, 72 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 4a32bbdf7..780bf6608 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -3109,11 +3109,6 @@ function package.load_from_repository(packagename, packagedir, opt) return instance end - -- load repository first for checking the xmake minimal version (deprecated) - local repo = opt.repo - if repo then - repo:load() - end -- find the package script path local scriptpath = opt.packagefile diff --git a/xmake/core/package/repository.lua b/xmake/core/package/repository.lua index 400cd2751..7f140c098 100644 --- a/xmake/core/package/repository.lua +++ b/xmake/core/package/repository.lua @@ -46,18 +46,6 @@ function _instance.new(name, url, branch, directory, is_global) return instance end --- get the repository configure -function _instance:get(name) - - -- load info - local info = self:load() - - -- get if from info - local value = info and info[name] or nil - if value ~= nil then - return value - end -end -- get the repository name function _instance:name() @@ -94,37 +82,6 @@ function _instance:directory() return self._DIRECTORY end --- load the repository info in xmake.lua -function _instance:load() - - -- do not loaded? - if not self._INFO then - - -- attempt to load info from the repository script (xmake.lua) - local scriptpath = path.join(self:directory(), "xmake.lua") - if os.isfile(scriptpath) then - - -- get interpreter - local interp = repository._interpreter() - - -- load script - local ok, errors = interp:load(scriptpath) - if not ok then - os.raise("load repo(%s) failed, " .. errors, self:name()) - end - - -- load repository and disable filter - local results, errors = interp:make(nil, true, false) - if not results then - os.raise("load repo(%s) failed, " .. errors, self:name()) - end - - -- save repository info - self._INFO = results - end - end - return self._INFO -end -- get cache function repository._cache(is_global) diff --git a/xmake/plugins/repo/main.lua b/xmake/plugins/repo/main.lua index efc0c4207..cb21992e7 100644 --- a/xmake/plugins/repo/main.lua +++ b/xmake/plugins/repo/main.lua @@ -82,10 +82,7 @@ function _remove(name, is_global) -- clear quick search cache _clear_quick_search_cache(is_global) - - -- trace cprint("${bright}remove %s repository(%s): ok!", (is_global and "global" or "local"), name) - end -- update repositories @@ -162,8 +159,6 @@ function _update() -- leave environment environment.leave() - - -- trace cprint("${green}ok") end @@ -181,37 +176,20 @@ function _clear(is_global) -- clear quick search cache _clear_quick_search_cache(is_global) - - -- trace cprint("${color.success}clear %s repositories: ok!", (is_global and "global" or "local")) end -- list all repositories function _list(is_global) - - -- list all repositories local count = 0 for _, position in ipairs(is_global and "global" or {"local", "global"}) do - - -- trace print("%s repositories:", position) - - -- list all for _, repo in pairs(repository.repositories(position == "global")) do - - -- trace - local description = repo:get("description") - print(" %s %s%s %s", repo:name(), repo:url(), repo:branch() and (" " .. repo:branch()) or "", description and ("(" .. description .. ")") or "") - - -- update count + print(" %s %s%s", repo:name(), repo:url(), repo:branch() and (" " .. repo:branch()) or "") count = count + 1 end - - -- trace print("") end - - -- trace print("%d repositories were found!", count) end @@ -276,4 +254,3 @@ function main() _directory(option.get("global")) end end - |
