Browse Source

Licenses restrictions per module without it peers

dimdim11 1 year ago
parent
commit
ed0808eb0b
1 changed files with 18 additions and 0 deletions
  1. 18 0
      build/conf/license.conf

+ 18 - 0
build/conf/license.conf

@@ -4,6 +4,8 @@ LICENSE_NAMES=
 MODULE_LICENSES_RESTRICTIONS=
 MODULE_LICENSES_RESTRICTION_EXCEPTIONS=
 MODULE_LICENSES_RESTRICTION_TYPES=
+MODULEWISE_LICENSES_RESTRICTIONS=
+MODULEWISE_LICENSES_RESTRICTION_TYPES=
 DEFAULT_MODULE_LICENSE=Service-Default-License
 EXPLICIT_LICENSE_PREFIXES=
 EXPLICIT_LICENSE_EXCEPTIONS=
@@ -448,3 +450,19 @@ macro LICENSE_RESTRICTION(TYPE, RESTRICTIONS...) {
 macro LICENSE_RESTRICTION_EXCEPTIONS(EXCEPT...) {
     SET_APPEND(MODULE_LICENSES_RESTRICTION_EXCEPTIONS $EXCEPT)
 }
+
+### @usage MODULEWISE_LICENSE_RESTRICTION(ALLOW_ONLY|DENY LicenseProperty...)
+###
+### Restrict licenses per module only, without it peers.
+###
+### ALLOW_ONLY restriction type requires dependent module to have at leas one license without propertis not listed in restrictions
+### list.
+###
+### DENY restriction type forbids dependency on module with no license without any listed propery from the list.
+###
+### Note: Can be used multiple times on the same module all specified constraints will be checked.
+### All macro invocation for the same module must use same constraints type (DENY or ALLOW_ONLY)
+macro MODULEWISE_LICENSE_RESTRICTION(TYPE, RESTRICTIONS...) {
+    SET_APPEND(MODULEWISE_LICENSES_RESTRICTION_TYPES $TYPE)
+    SET_APPEND(MODULEWISE_LICENSES_RESTRICTIONS $RESTRICTIONS)
+}