Skip to content

Commit

Permalink
[projmgr] Extend type list documentation and schema mutual exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
grasci-arm authored May 6, 2022
1 parent f155e63 commit c66815b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
12 changes: 9 additions & 3 deletions tools/projmgr/docs/Manual/YML-Format.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,11 @@ It is possible to specify only a `<build-type>`, only a `<target-type>` or a com

```yml
for-type: .Test # add item for build-type: Test (any target-type)
for-type: .Debug, .Release+Production-HW # add for build-type: Debug and build-type: Release / target-type: Production-HW
not-for-type: +Virtual # remove item for target-type: Virtual (any build-type)
not-for-type: .Release+Virtual # remove item for build-type: Release with target-type: Virtual
for-type: .Debug, .Release+Production-HW # add for build-type: Debug and build-type: Release / target-type: Production-HW
```
> **Note:** `for-type` and `not-for-type` are mutually exclusive, only one occurrence can be specified for a *list node*.

### *list nodes*

Expand All @@ -862,10 +863,15 @@ The keyword `for-type:` or `not-for-type:` can be applied to the following list
List Node | Description
:------------------------------------------|:------------------------------------
[`- project:`](#projects) | At `projects:` level it is possible to control inclusion of project.
[`- layer:`](#layers) | At `layers:` level it is possible to control inclusion of a software layer.
[`- component:`](#components) | At `components:` level it is possible to control inclusion of a software component.
[`- group:`](#groups) | At `groups:` level it is possible to control inclusion of a file group.
[`- file:`](#files) | At `files:` level it is possible to control inclusion of a file.
[`- layer:`](#layers) | At `projects:` level it is possible to control inclusion of a software layer.
[`- component:`](#components) | At `components:` level it is possible to control inclusion of a software component.

The inclusion of a *list node* is processed for a given *project context* respecting its hierarchy from top to bottom: `project` > `layer` > `component`/`group` > `file`

In other words, the restrictions specified by a *type list* for a *list node* are automatically applied to its children nodes.
Children *list nodes* inherit the restrictions from their parent and consequently it must be considered when processing their *type lists*.

# Related Projects

Expand Down
24 changes: 23 additions & 1 deletion tools/projmgr/schemas/common.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@
],
"description": "Exclude project for a list of [.<build-type>][+<target-type>]"
},
"TypeListMutualExclusion": {
"oneOf": [
{ "required": ["for-type"],
"not": {"required": ["not-for-type"]}
},
{ "required": ["not-for-type"],
"not": {"required": ["for-type"]}
},
{
"allOf": [
{ "not": {"required": ["for-type"] }},
{ "not": {"required": ["not-for-type"]}}
]
}
]
},
"CompilerType": {
"type": "string",
"pattern": "^(GCC|AC6|IAR)(@(\\d+\\.\\d+\\.\\d+((\\+|\\-)[\\w.+-]+)?))?$",
Expand Down Expand Up @@ -175,8 +191,9 @@
},
"for-type": { "$ref": "#/definitions/ForType" },
"not-for-type": { "$ref": "#/definitions/NotForType" }
},
},
"additionalProperties": false,
"$ref": "#/definitions/TypeListMutualExclusion",
"required": [ "project" ]
},
"ProcessorType": {
Expand Down Expand Up @@ -220,6 +237,7 @@
"groups": { "$ref": "#/definitions/GroupsType" },
"files": { "$ref": "#/definitions/FilesType" }
},
"$ref": "#/definitions/TypeListMutualExclusion",
"anyOf": [
{"required" : ["files"]},
{"required" : ["groups"]}
Expand All @@ -246,6 +264,7 @@
"del-paths": { "$ref": "#/definitions/DelpathsType" },
"misc": { "$ref": "#/definitions/MiscTypes" }
},
"$ref": "#/definitions/TypeListMutualExclusion",
"required": [ "file" ],
"additionalProperties": false
},
Expand Down Expand Up @@ -274,6 +293,7 @@
"del-paths": { "$ref": "#/definitions/DelpathsType" },
"misc": { "$ref": "#/definitions/MiscTypes" }
},
"$ref": "#/definitions/TypeListMutualExclusion",
"required": [ "component" ],
"additionalProperties": false
},
Expand All @@ -299,6 +319,7 @@
"del-paths": { "$ref": "#/definitions/DelpathsType" },
"misc": { "$ref": "#/definitions/MiscType" }
},
"$ref": "#/definitions/TypeListMutualExclusion",
"required": [ "layer" ],
"additionalProperties": false
},
Expand Down Expand Up @@ -408,6 +429,7 @@
"for-type": { "$ref": "#/definitions/ForType" },
"not-for-type": { "$ref": "#/definitions/NotForType" }
},
"$ref": "#/definitions/TypeListMutualExclusion",
"required": [ "pack" ],
"additionalProperties": false
}
Expand Down

0 comments on commit c66815b

Please sign in to comment.