Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
1.11.0
-
None
-
a6120f687ee4dc7641e3ea80dc7401915bfd14c9
Description
Hi
I like QBS!
If I use the VCS module, but if for some reason neither SVN nor GIT is working on the computer, I get an compile error. Because "vcs-repo-state.h" file is not created. Because repoState is null.
I propose to make a property defaultRepoMessage in the module that will define the default message in the created headerFileName file if the version control did not work, but module VCS is in use.
// ...... property string headerFileName: "vcs-repo-state.h" property string defaultRepoMessage: "VCS info is undefined" ..... Rule { condition: headerFileName multiplex: true Artifact { filePath: FileInfo.joinPaths(product.vcs.includeDir, product.vcs.headerFileName) fileTags: ["hpp"] } prepare: { var cmd = new JavaScriptCommand(); cmd.description = "generating " + output.fileName; cmd.highlight = "codegen"; cmd.repoState = product.vcs.repoState; cmd.sourceCode = function() { var f = new TextFile(output.filePath, TextFile.WriteOnly); try { f.writeLine("#ifndef VCS_REPO_STATE_H"); f.writeLine("#define VCS_REPO_STATE_H"); f.writeLine('#define VCS_REPO_STATE "' + (repoState?repoState:product.vcs.defaultRepoMessage) + '"') f.writeLine("#endif"); } finally { f.close(); } }; return [cmd]; } }
Attachments
For Gerrit Dashboard: QBS-1337 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
227162,2 | vcs module: Create header file even without a repository being present | master | qbs/qbs | Status: MERGED | +2 | 0 |