Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1337

Use VCS module without svn or git emit an compile error.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 1.11.0
    • Fix Version/s: 1.12.0
    • Component/s: Qt Creator Integration
    • Labels:
      None
    • Commits:
      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

          Activity

            People

            Assignee:
            kandeler Christian Kandeler
            Reporter:
            dm.pozhidaev Dmitry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes