license.conf 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. LICENSE_EXPRESSION=
  2. LICENSE_NAMES=
  3. MODULE_LICENSES_RESTRICTIONS=
  4. MODULE_LICENSES_RESTRICTION_EXCEPTIONS=
  5. MODULE_LICENSES_RESTRICTION_TYPES=
  6. MODULEWISE_LICENSES_RESTRICTIONS=
  7. MODULEWISE_LICENSES_RESTRICTION_TYPES=
  8. DEFAULT_MODULE_LICENSE=Service-Default-License
  9. EXPLICIT_LICENSE_PREFIXES=
  10. EXPLICIT_LICENSE_EXCEPTIONS=
  11. LICENSES=
  12. LICENSES+=build/conf/licenses.json
  13. macro _DONT_REQUIRE_LICENSE() {
  14. SET(EXPLICIT_LICENSE_PREFIXES "")
  15. }
  16. ### @usage: LICENSE(licenses...)
  17. ###
  18. ### Specify the licenses of the module, separated by spaces. Specifying multiple licenses interpreted as permission to use this
  19. ### library satisfying all conditions of any of the listed licenses.
  20. ###
  21. ### A license must be prescribed for contribs
  22. macro LICENSE(Flags...) {
  23. SET(LICENSE_EXPRESSION $Flags)
  24. SET(LICENSE_NAMES $Flags)
  25. # TODO(YMAKE-1136) avoid abusing LICENSE
  26. # NOTICE: final value of MODVER might not be set yet if VERSION macro is called after LICENSE. Var expansion is
  27. # escaped here to prevent eager value substitution by SET but allow delayed value substitution when
  28. # adding linking SBOM data command to graph.
  29. when ($_NEED_SBOM_INFO == "yes") {
  30. _SBOM_INFO_LOCAL="path=${MODDIR};ver=${join=.:MODVER};lang=${MODULE_LANG}"
  31. }
  32. otherwise {
  33. _SBOM_INFO_LOCAL=
  34. }
  35. SET_APPEND(_SBOM_INFO_GLOBAL $_SBOM_INFO_LOCAL)
  36. }
  37. ### @usage LICENSE_RESTRICTION(ALLOW_ONLY|DENY LicenseProperty...)
  38. ###
  39. ### Restrict licenses of direct and indirect module dependencies.
  40. ###
  41. ### ALLOW_ONLY restriction type requires dependent module to have at least one license without properties not listed in restrictions list.
  42. ###
  43. ### DENY restriction type forbids dependency on module with no license without any listed property from the list.
  44. ###
  45. ### Note: Can be used multiple times on the same module all specified constraints will be checked.
  46. ### All macro invocation for the same module must use same constraints type (DENY or ALLOW_ONLY)
  47. macro LICENSE_RESTRICTION(TYPE, RESTRICTIONS...) {
  48. SET_APPEND(MODULE_LICENSES_RESTRICTION_TYPES $TYPE)
  49. SET_APPEND(MODULE_LICENSES_RESTRICTIONS $RESTRICTIONS)
  50. }
  51. ### @usage MODULEWISE_LICENSE_RESTRICTION(ALLOW_ONLY|DENY LicenseProperty...)
  52. ###
  53. ### Restrict licenses per module only, without it peers.
  54. ###
  55. ### ALLOW_ONLY restriction type requires module to have at least one license without properties not listed in restrictions list.
  56. ###
  57. ### DENY restriction type forbids module with no license without any listed property from the list.
  58. ###
  59. ### Note: Can be used multiple times on the same module all specified constraints will be checked.
  60. ### All macro invocation for the same module must use same constraints type (DENY or ALLOW_ONLY)
  61. macro MODULEWISE_LICENSE_RESTRICTION(TYPE, RESTRICTIONS...) {
  62. SET_APPEND(MODULEWISE_LICENSES_RESTRICTION_TYPES $TYPE)
  63. SET_APPEND(MODULEWISE_LICENSES_RESTRICTIONS $RESTRICTIONS)
  64. }
  65. ### @usage LICENSE_RESTRICTION_EXCEPTIONS(Module...)
  66. ###
  67. ### List of modules for exception from LICENSE_RESTRICTION and MODULEWISE_LICENSE_RESTRICTION logic.
  68. macro LICENSE_RESTRICTION_EXCEPTIONS(EXCEPT...) {
  69. SET_APPEND(MODULE_LICENSES_RESTRICTION_EXCEPTIONS $EXCEPT)
  70. }