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

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 1.12.0
    • 1.11.0
    • Qt Creator Integration
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            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