fix: bridge nested PlatformIO async dependencies

This commit is contained in:
2026-08-26 01:19:35 +10:00
parent f4fa653a7b
commit d8a78bae03
4 changed files with 34 additions and 5 deletions
+5 -1
View File
@@ -1,10 +1,14 @@
# Changelog # Changelog
## 3.0.3 ## 3.0.5
- Add a library-owned PlatformIO bridge for the asynchronous web/TCP include paths required when WiFiManager is nested beneath DeviceFramework.
## 3.0.4 ## 3.0.4
- Set the package's deep PlatformIO dependency-discovery mode so WiFiManager's asynchronous web/TCP children remain available when it is consumed through DeviceFramework. - Set the package's deep PlatformIO dependency-discovery mode so WiFiManager's asynchronous web/TCP children remain available when it is consumed through DeviceFramework.
## 3.0.3
- Declare the ESP8266 and ESP32 async TCP libraries explicitly in the PlatformIO package manifest so clean consumers resolve the headers required by the asynchronous portal. - Declare the ESP8266 and ESP32 async TCP libraries explicitly in the PlatformIO package manifest so clean consumers resolve the headers required by the asynchronous portal.
+1 -1
View File
@@ -216,7 +216,7 @@ their include paths:
```ini ```ini
[common] [common]
lib_deps = lib_deps =
WiFiManager=https://github.com/alexhopeoconnor/WiFiManager.git#v3.0.4 WiFiManager=https://github.com/alexhopeoconnor/WiFiManager.git#v3.0.5
ESP32Async/ESPAsyncWebServer@3.9.1 ESP32Async/ESPAsyncWebServer@3.9.1
[env:esp8266] [env:esp8266]
+4 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "WiFiManager", "name": "WiFiManager",
"version": "3.0.4", "version": "3.0.5",
"keywords": [ "keywords": [
"wifi", "wifi",
"wi-fi", "wi-fi",
@@ -64,7 +64,7 @@
"build": { "build": {
"includeDir": "lib/WiFiManager/include", "includeDir": "lib/WiFiManager/include",
"srcDir": "lib/WiFiManager/src", "srcDir": "lib/WiFiManager/src",
"libLDFMode": "deep+" "extraScript": "tools/platformio/dependencies.py"
}, },
"export": { "export": {
"include": [ "include": [
@@ -72,7 +72,8 @@
"lib/WiFiManager/src", "lib/WiFiManager/src",
"LICENSE", "LICENSE",
"README.md", "README.md",
"library.json" "library.json",
"tools"
] ]
}, },
"$schema": "https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/schema/library.json", "$schema": "https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/schema/library.json",
+24
View File
@@ -0,0 +1,24 @@
"""Expose WiFiManager's async dependencies to PlatformIO's nested library builds."""
from __future__ import print_function
import glob
import os
from SCons.Script import Import
Import("env")
def append_dependency_include(package_prefix):
"""Add the installed package's source directory when PlatformIO has it."""
package_root = env.subst("$PROJECT_LIBDEPS_DIR")
candidates = glob.glob(os.path.join(package_root, package_prefix + "*", "src"))
if candidates:
env.Append(CPPPATH=[candidates[0]])
append_dependency_include("ESPAsyncWebServer")
if env.subst("$PIOPLATFORM") == "espressif8266":
append_dependency_include("ESPAsyncTCP")
elif env.subst("$PIOPLATFORM") == "espressif32":
append_dependency_include("AsyncTCP")