代码之家  ›  专栏  ›  技术社区  ›  Houss_gc

子类化探测不起作用

qbs
  •  0
  • Houss_gc  · 技术社区  · 7 年前

    GitProbe:

    import qbs
    import qbs.File
    import qbs.Process
    
    Probe {
        property string gitUrl
        property string wd
        property string name
        property string dir: wd + "/" + name
        configure: {
            try {
                if(File.directoryEntries(dir, File.AllEntries).length > 0){
                    File.remove(dir)
                }
                var gitProcess = Process()
                gitProcess.setWorkingDirectory(wd)
                gitProcess.exec("git", ["clone", gitUrl], true)
                found = true
            } catch(err) {
                console.warn("GitProbe : could not clone repository " + gitUrl)
                console.error("GitProbe : " + err)
                found = false
            }
        }
    }
    

    GitProbe.qbs dir/imports/ 在我的项目中 qbsSearchPath: "path-to-dir" Unexpected item type 'GitProbe'

    1 回复  |  直到 7 年前
        1
  •  0
  •   Christian Kandeler    7 年前

    这是一个已知的限制:在解析当前文件时,需要已经设置搜索路径。因此,解决方法是从另一个文件中的项目项引用您的文件,并在那里设置搜索路径。你可能想投票 https://bugreports.qt.io/browse/QBS-667