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

Incorrect resolution of the scope

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 2.2.0
    • 2.1.1, 2.1.2
    • None
    • b661c34d8 (master)

    Description

      In my project, I have a certain naming style guide for the products. For example, all QML engine extensions are prefixed by ext- and all dynamically loaded plugins are prefixed with plugin-.

      Now, I want to simplify life for myself so that I can write something like this:

      mega-app.qbs
      Application {
          Relies { on: 'lib-logger' }
          Relies { on: 'ext-controls' }
          Relies { on: 'plugin-mega-addon' }
      
          name: 'mega-app'
      }
      

      For this, I define an auxiliary item like this:

      Relies.qbs
      Depends {
          id: root
      
          property string on
      
          name: on
          enableFallback: false
          cpp.link: {
              var prefix = root.name.split('-')[0]
      
              console.warn(root.name)  // => name of the product,
                                       //    not of the Depends item
              console.warn(root.on)    // => undefined
      
              return prefix !== 'ext' && prefix !== 'plugin'
          }
      }
      

      I described the actual result in the comments above.

      The expected behavior though would be to get the property of the item, not of the product it's in. Effectively, root.name should be equal to root.on in this case.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            gooroo Serhii Olendarenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes