Add-ons: Exclude contrib for beta, rc and release builds.

* Make it clearer that contrib isn't shipped with releases, by already excluding it in beta.
* Improve the UI by hiding the "Testing" enum item in these case.

Differential Revision: https://developer.blender.org/D16729
This commit is contained in:
Thomas Dinges 2022-12-13 11:12:36 +01:00
parent a14a152024
commit e8c7866608
Notes: blender-bot 2023-03-30 21:44:58 +02:00
Referenced by issue #105213, "Testing" tab missing from "Preferences>Add-ons" section.
Referenced by issue #106306, Addons from Alternate script path (script_directory) in addon_contribs not showing in addon preferences
2 changed files with 14 additions and 7 deletions

View File

@ -94,6 +94,16 @@ _namespace = globals()
_modules_loaded = [_namespace[name] for name in _modules]
del _namespace
def _addon_support_items():
"""Return the addon support levels suitable for this Blender build."""
items = [
('OFFICIAL', "Official", "Officially supported"),
('COMMUNITY', "Community", "Maintained by community developers"),
]
if bpy.app.version_cycle == 'alpha':
items.append(('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)"))
return items
def register():
from bpy.utils import register_class
@ -141,11 +151,7 @@ def register():
)
WindowManager.addon_support = EnumProperty(
items=[
('OFFICIAL', "Official", "Officially supported"),
('COMMUNITY', "Community", "Maintained by community developers"),
('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)")
],
items=_addon_support_items(),
name="Support",
description="Display support level",
default={'OFFICIAL', 'COMMUNITY'},

View File

@ -394,9 +394,10 @@ install(
if(WITH_PYTHON)
# install(CODE "message(\"copying blender scripts...\")")
# exclude addons_contrib if release
# exclude addons_contrib if release branch
if("${BLENDER_VERSION_CYCLE}" STREQUAL "release" OR
"${BLENDER_VERSION_CYCLE}" STREQUAL "rc")
"${BLENDER_VERSION_CYCLE}" STREQUAL "rc" OR
"${BLENDER_VERSION_CYCLE}" STREQUAL "beta")
set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*")
else()
set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*") # Dummy, won't do anything.