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

Set Module Properties in Project Item

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • General
    • None

    Description

      It would be nice to set (default) properties for certain modules from within a global project item. These properties would be default for all nested products and sub-projects. Something like:

      Project {
        cpp.optimization : "fast"
      
        Product { .. }
      }
      

      Requirements for module property assignments in project items:

      • Module property assignments on project level are evaluated before those in profiles, hence:
      • Scalar properties will be overridden if they are set in a profile, list properties will be merged if set in a profile
      • When project items are nested, both scalar and list values can be overridden, but the parent values are available via "outer". We want to keep consistency with Group and Properties items. Access via parent.module.prop should also be possible.
      • Products cannot opt out unless their surrounding project item sets the values to undefined explicitly

       

      Project {
      
          m.scalarProp: "v1"
          m.listProp: "v1"
      
          Product { 
              Depends { name: "m" } 
              // m.scalarProp is v1
              // m.listProp is v1 
          }
      
          Project {
              m.scalarProp : "v2" // implicit override
              m.listProp: "v2" // v2 - implicit override
              m.otherListProp: outer.concat(["v2"]) // explicit merge
      
              Profile {
                  name: "projectProfile"
                  m.scalarProp: "v3"
                  m.listProp: "v3"
              }
              
              Product { 
                  profile: "projectProfile"
                  Depends { name: "m" }
                  m.listProp: "v4"
                  // m.scalarProp is v3
                  // m.listProp is v2, v3, v4
              }
      
              Product {
                  Depends { name: "m" }
                  // m.scalarProp is v2
                  // m.listProp is v1, v2
              }
          } 
      }

       

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              rweickelt Richard Weickelt
              Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes