Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

dslings: build-cache: use xmake's watch plugin replace mtime detect #15

Open
Sunrisepeak opened this issue May 22, 2024 · 0 comments
Open
Labels
enhancement | 新功能 New feature or request

Comments

@Sunrisepeak
Copy link
Owner

https://xmake.io/#/zh-cn/plugin/builtin_plugins?id=%e9%a1%b9%e7%9b%ae%e6%9b%b4%e6%96%b0%e5%90%8e%e8%87%aa%e5%8a%a8%e6%9e%84%e5%bb%ba

        import("core.base.fwatcher")

        -- listen file change
        -- use xmake watch plugin and fwatcher to replace file mtime
        fwatcher.add(os.projectdir(), {recursive = true})
        local function target_files_changed()
            local ok, event = fwatcher.wait(50)
            local status = nil
            if ok > 0 then
                local status
                if event.type == fwatcher.ET_CREATE then
                    status = "created"
                elseif event.type == fwatcher.ET_MODIFY then
                    status = "modified"
                elseif event.type == fwatcher.ET_DELETE then
                    status = "deleted"
                end
                -- print(event.path, status)
            end
            return status ~= nil
        end
@Sunrisepeak Sunrisepeak added the enhancement | 新功能 New feature or request label May 22, 2024
@Sunrisepeak Sunrisepeak moved this to Backlog | 未分配 in d2ds - DevKanban | 开发看板 Jul 1, 2024
@Sunrisepeak Sunrisepeak moved this to New | 未处理 in d2ds - DevKanban | 开发看板 Jul 2, 2024
@Sunrisepeak Sunrisepeak moved this from New | 新 to Backlog | 未分配 in d2ds - DevKanban | 开发看板 Jul 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement | 新功能 New feature or request
Projects
Status: Backlog | 未分配
Development

No branches or pull requests

1 participant