Skip to content

Commit 3e74fe9

Browse files
authored
Update platform.py
1 parent 905c6a3 commit 3e74fe9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

platform.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,29 @@ def configure_default_packages(self, variables, targets):
5656
board_sdkconfig = variables.get("board_espidf.custom_sdkconfig", board_config.get("espidf.custom_sdkconfig", ""))
5757
frameworks = variables.get("pioframework", [])
5858

59+
def _lazy_framework_validation(self, variables):
60+
"""Perform framework validation only when actually needed"""
61+
if not hasattr(self, '_framework_validated'):
62+
frameworks = variables.get("pioframework", [])
63+
64+
# Only validate if we have sufficient context
65+
if (variables.get("board") and
66+
variables.get("project_dir") and
67+
not frameworks):
68+
69+
self._show_framework_warning()
70+
71+
self._framework_validated = True
72+
73+
def _show_framework_warning(self):
74+
"""Show framework warning without terminating early setup"""
75+
warning_msg = (
76+
"\n⚠️ WARNING: No framework specified in platformio.ini\n"
77+
" Add 'framework = arduino' or 'framework = espidf'\n"
78+
" Build may fail without proper framework configuration.\n"
79+
)
80+
print(warning_msg, file=sys.stderr)
81+
5982
def install_tool(TOOL, retry_count=0):
6083
self.packages[TOOL]["optional"] = False
6184
TOOL_PATH = os.path.join(ProjectConfig.get_instance().get("platformio", "packages_dir"), TOOL)

0 commit comments

Comments
 (0)