mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-15 00:08:11 -07:00
Merge branch 'dev' of https://github.com/DarkFlippers/unleashed-firmware into xfw-dev
This commit is contained in:
@@ -177,6 +177,12 @@ static void byte_input_draw_input(Canvas* canvas, ByteInputModel* model) {
|
||||
|
||||
if(i == model->selected_byte) {
|
||||
canvas_draw_frame(canvas, text_x + byte_position * 14, text_y - 9, 15, 11);
|
||||
if(model->selected_row == -2) {
|
||||
canvas_draw_icon(
|
||||
canvas, text_x + 6 + byte_position * 14, text_y - 14, &I_arrow_nano_up);
|
||||
canvas_draw_icon(
|
||||
canvas, text_x + 6 + byte_position * 14, text_y + 5, &I_arrow_nano_down);
|
||||
}
|
||||
|
||||
if(model->selected_high_nibble) {
|
||||
canvas_draw_glyph(
|
||||
@@ -233,6 +239,7 @@ static void byte_input_draw_input(Canvas* canvas, ByteInputModel* model) {
|
||||
}
|
||||
|
||||
if(draw_index_line) {
|
||||
canvas_draw_icon(canvas, 1, text_y + 8, &I_Hashmark_7x7);
|
||||
canvas_draw_glyph(
|
||||
canvas, text_x + 2 + byte_position * 14, text_y2, num_to_char[(i + 1) / 10]);
|
||||
|
||||
@@ -600,9 +607,6 @@ static void byte_input_view_draw_callback(Canvas* canvas, void* _model) {
|
||||
|
||||
canvas_clear(canvas);
|
||||
canvas_set_color(canvas, ColorBlack);
|
||||
|
||||
canvas_draw_str(canvas, 2, 9, model->header);
|
||||
|
||||
canvas_set_font(canvas, FontKeyboard);
|
||||
|
||||
if(model->selected_row == -1) {
|
||||
@@ -613,9 +617,19 @@ static void byte_input_view_draw_callback(Canvas* canvas, void* _model) {
|
||||
|
||||
if(model->selected_row == -2) {
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
canvas_draw_icon(canvas, 3, 52, &I_Pin_back_arrow_10x8);
|
||||
canvas_draw_str_aligned(canvas, 16, 60, AlignLeft, AlignBottom, "back to keyboard");
|
||||
canvas_draw_icon(canvas, 3, 1, &I_Pin_back_arrow_10x8);
|
||||
canvas_draw_str_aligned(canvas, 16, 9, AlignLeft, AlignBottom, "back to keyboard");
|
||||
elements_button_center(canvas, "Save");
|
||||
} else {
|
||||
// Draw the header
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
if(model->selected_row == -1) {
|
||||
canvas_draw_str(canvas, 10, 9, "Move up for alternate input");
|
||||
canvas_draw_icon(canvas, 3, 4, &I_SmallArrowUp_3x5);
|
||||
} else {
|
||||
canvas_draw_str(canvas, 2, 9, model->header);
|
||||
}
|
||||
canvas_set_font(canvas, FontKeyboard);
|
||||
// Draw keyboard
|
||||
for(uint8_t row = 0; row < keyboard_row_count; row++) {
|
||||
const uint8_t column_count = byte_input_get_row_size(row);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BROWSER_SORT_THRESHOLD 400
|
||||
#define BROWSER_SORT_THRESHOLD 220
|
||||
|
||||
typedef struct BrowserWorker BrowserWorker;
|
||||
typedef void (*BrowserWorkerFolderOpenCallback)(
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 957 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 949 B |
@@ -3433,6 +3433,7 @@ Variable,+,I_FaceConfused_29x14,Icon,
|
||||
Variable,+,I_FaceNopower_29x14,Icon,
|
||||
Variable,+,I_FaceNormal_29x14,Icon,
|
||||
Variable,+,I_Fishing_123x52,Icon,
|
||||
Variable,+,I_Hashmark_7x7,Icon,
|
||||
Variable,+,I_Health_16x16,Icon,
|
||||
Variable,+,I_Hidden_window_9x8,Icon,
|
||||
Variable,+,I_InfraredArrowDown_4x8,Icon,
|
||||
@@ -3496,6 +3497,8 @@ Variable,+,I_Voltage_16x16,Icon,
|
||||
Variable,+,I_Volup_8x6,Icon,
|
||||
Variable,+,I_WarningDolphin_45x42,Icon,
|
||||
Variable,+,I_Warning_30x23,Icon,
|
||||
Variable,+,I_arrow_nano_down,Icon,
|
||||
Variable,+,I_arrow_nano_up,Icon,
|
||||
Variable,+,I_back_10px,Icon,
|
||||
Variable,+,I_badkb_10px,Icon,
|
||||
Variable,+,I_bright_text_30x30,Icon,
|
||||
|
||||
|
@@ -1,31 +1,22 @@
|
||||
#include "dev_info_service.h"
|
||||
#include "app_common.h"
|
||||
#include "gatt_char.h"
|
||||
#include <ble/ble.h>
|
||||
|
||||
#include <furi.h>
|
||||
#include <protobuf_version.h>
|
||||
#include <lib/toolbox/version.h>
|
||||
|
||||
#include "dev_info_service_uuid.inc"
|
||||
|
||||
#define TAG "BtDevInfoSvc"
|
||||
|
||||
typedef enum {
|
||||
DevInfoSvcGattCharacteristicMfgName = 0,
|
||||
DevInfoSvcGattCharacteristicSerial,
|
||||
DevInfoSvcGattCharacteristicFirmwareRev,
|
||||
DevInfoSvcGattCharacteristicSoftwareRev,
|
||||
DevInfoSvcGattCharacteristicRpcVersion,
|
||||
DevInfoSvcGattCharacteristicCount,
|
||||
} DevInfoSvcGattCharacteristicId;
|
||||
|
||||
#define DEVICE_INFO_HARDWARE_REV_SIZE 4
|
||||
typedef struct {
|
||||
uint16_t service_handle;
|
||||
FlipperGattCharacteristicInstance characteristics[DevInfoSvcGattCharacteristicCount];
|
||||
uint16_t man_name_char_handle;
|
||||
uint16_t serial_num_char_handle;
|
||||
uint16_t firmware_rev_char_handle;
|
||||
uint16_t software_rev_char_handle;
|
||||
uint16_t rpc_version_char_handle;
|
||||
FuriString* version_string;
|
||||
char hardware_revision[DEVICE_INFO_HARDWARE_REV_SIZE];
|
||||
char hardware_revision[4];
|
||||
} DevInfoSvc;
|
||||
|
||||
static DevInfoSvc* dev_info_svc = NULL;
|
||||
@@ -34,86 +25,8 @@ static const char dev_info_man_name[] = "Flipper Devices Inc.";
|
||||
static const char dev_info_serial_num[] = "1.0";
|
||||
static const char dev_info_rpc_version[] = TOSTRING(PROTOBUF_MAJOR_VERSION.PROTOBUF_MINOR_VERSION);
|
||||
|
||||
static bool dev_info_char_firmware_rev_callback(
|
||||
const void* context,
|
||||
const uint8_t** data,
|
||||
uint16_t* data_len) {
|
||||
const DevInfoSvc* dev_info_svc = *(DevInfoSvc**)context;
|
||||
*data_len = sizeof(dev_info_svc->hardware_revision);
|
||||
if(data) {
|
||||
*data = (const uint8_t*)&dev_info_svc->hardware_revision;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool dev_info_char_software_rev_callback(
|
||||
const void* context,
|
||||
const uint8_t** data,
|
||||
uint16_t* data_len) {
|
||||
const DevInfoSvc* dev_info_svc = *(DevInfoSvc**)context;
|
||||
*data_len = furi_string_size(dev_info_svc->version_string);
|
||||
if(data) {
|
||||
*data = (const uint8_t*)furi_string_get_cstr(dev_info_svc->version_string);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static const FlipperGattCharacteristicParams dev_info_svc_chars[DevInfoSvcGattCharacteristicCount] =
|
||||
{[DevInfoSvcGattCharacteristicMfgName] =
|
||||
{.name = "Manufacturer Name",
|
||||
.data_prop_type = FlipperGattCharacteristicDataFixed,
|
||||
.data.fixed.length = sizeof(dev_info_man_name) - 1,
|
||||
.data.fixed.ptr = (const uint8_t*)&dev_info_man_name,
|
||||
.uuid.Char_UUID_16 = MANUFACTURER_NAME_UUID,
|
||||
.uuid_type = UUID_TYPE_16,
|
||||
.char_properties = CHAR_PROP_READ,
|
||||
.security_permissions = ATTR_PERMISSION_AUTHEN_READ,
|
||||
.gatt_evt_mask = GATT_DONT_NOTIFY_EVENTS,
|
||||
.is_variable = CHAR_VALUE_LEN_CONSTANT},
|
||||
[DevInfoSvcGattCharacteristicSerial] =
|
||||
{.name = "Serial Number",
|
||||
.data_prop_type = FlipperGattCharacteristicDataFixed,
|
||||
.data.fixed.length = sizeof(dev_info_serial_num) - 1,
|
||||
.data.fixed.ptr = (const uint8_t*)&dev_info_serial_num,
|
||||
.uuid.Char_UUID_16 = SERIAL_NUMBER_UUID,
|
||||
.uuid_type = UUID_TYPE_16,
|
||||
.char_properties = CHAR_PROP_READ,
|
||||
.security_permissions = ATTR_PERMISSION_AUTHEN_READ,
|
||||
.gatt_evt_mask = GATT_DONT_NOTIFY_EVENTS,
|
||||
.is_variable = CHAR_VALUE_LEN_CONSTANT},
|
||||
[DevInfoSvcGattCharacteristicFirmwareRev] =
|
||||
{.name = "Firmware Revision",
|
||||
.data_prop_type = FlipperGattCharacteristicDataCallback,
|
||||
.data.callback.context = &dev_info_svc,
|
||||
.data.callback.fn = dev_info_char_firmware_rev_callback,
|
||||
.uuid.Char_UUID_16 = FIRMWARE_REVISION_UUID,
|
||||
.uuid_type = UUID_TYPE_16,
|
||||
.char_properties = CHAR_PROP_READ,
|
||||
.security_permissions = ATTR_PERMISSION_AUTHEN_READ,
|
||||
.gatt_evt_mask = GATT_DONT_NOTIFY_EVENTS,
|
||||
.is_variable = CHAR_VALUE_LEN_CONSTANT},
|
||||
[DevInfoSvcGattCharacteristicSoftwareRev] =
|
||||
{.name = "Software Revision",
|
||||
.data_prop_type = FlipperGattCharacteristicDataCallback,
|
||||
.data.callback.context = &dev_info_svc,
|
||||
.data.callback.fn = dev_info_char_software_rev_callback,
|
||||
.uuid.Char_UUID_16 = SOFTWARE_REVISION_UUID,
|
||||
.uuid_type = UUID_TYPE_16,
|
||||
.char_properties = CHAR_PROP_READ,
|
||||
.security_permissions = ATTR_PERMISSION_AUTHEN_READ,
|
||||
.gatt_evt_mask = GATT_DONT_NOTIFY_EVENTS,
|
||||
.is_variable = CHAR_VALUE_LEN_CONSTANT},
|
||||
[DevInfoSvcGattCharacteristicRpcVersion] = {
|
||||
.name = "RPC Version",
|
||||
.data_prop_type = FlipperGattCharacteristicDataFixed,
|
||||
.data.fixed.length = sizeof(dev_info_rpc_version) - 1,
|
||||
.data.fixed.ptr = (const uint8_t*)&dev_info_rpc_version,
|
||||
.uuid.Char_UUID_128 = DEV_INVO_RPC_VERSION_UID,
|
||||
.uuid_type = UUID_TYPE_128,
|
||||
.char_properties = CHAR_PROP_READ,
|
||||
.security_permissions = ATTR_PERMISSION_AUTHEN_READ,
|
||||
.gatt_evt_mask = GATT_DONT_NOTIFY_EVENTS,
|
||||
.is_variable = CHAR_VALUE_LEN_CONSTANT}};
|
||||
static const uint8_t dev_info_rpc_version_uuid[] =
|
||||
{0x33, 0xa9, 0xb5, 0x3e, 0x87, 0x5d, 0x1a, 0x8e, 0xc8, 0x47, 0x5e, 0xae, 0x6d, 0x66, 0xf6, 0x03};
|
||||
|
||||
void dev_info_svc_start() {
|
||||
dev_info_svc = malloc(sizeof(DevInfoSvc));
|
||||
@@ -133,22 +46,132 @@ void dev_info_svc_start() {
|
||||
// Add Device Information Service
|
||||
uint16_t uuid = DEVICE_INFORMATION_SERVICE_UUID;
|
||||
status = aci_gatt_add_service(
|
||||
UUID_TYPE_16,
|
||||
(Service_UUID_t*)&uuid,
|
||||
PRIMARY_SERVICE,
|
||||
1 + 2 * DevInfoSvcGattCharacteristicCount,
|
||||
&dev_info_svc->service_handle);
|
||||
UUID_TYPE_16, (Service_UUID_t*)&uuid, PRIMARY_SERVICE, 11, &dev_info_svc->service_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to add Device Information Service: %d", status);
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < DevInfoSvcGattCharacteristicCount; i++) {
|
||||
flipper_gatt_characteristic_init(
|
||||
dev_info_svc->service_handle,
|
||||
&dev_info_svc_chars[i],
|
||||
&dev_info_svc->characteristics[i]);
|
||||
flipper_gatt_characteristic_update(
|
||||
dev_info_svc->service_handle, &dev_info_svc->characteristics[i], NULL);
|
||||
// Add characteristics
|
||||
uuid = MANUFACTURER_NAME_UUID;
|
||||
status = aci_gatt_add_char(
|
||||
dev_info_svc->service_handle,
|
||||
UUID_TYPE_16,
|
||||
(Char_UUID_t*)&uuid,
|
||||
strlen(dev_info_man_name),
|
||||
CHAR_PROP_READ,
|
||||
ATTR_PERMISSION_AUTHEN_READ,
|
||||
GATT_DONT_NOTIFY_EVENTS,
|
||||
10,
|
||||
CHAR_VALUE_LEN_CONSTANT,
|
||||
&dev_info_svc->man_name_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to add manufacturer name char: %d", status);
|
||||
}
|
||||
uuid = SERIAL_NUMBER_UUID;
|
||||
status = aci_gatt_add_char(
|
||||
dev_info_svc->service_handle,
|
||||
UUID_TYPE_16,
|
||||
(Char_UUID_t*)&uuid,
|
||||
strlen(dev_info_serial_num),
|
||||
CHAR_PROP_READ,
|
||||
ATTR_PERMISSION_AUTHEN_READ,
|
||||
GATT_DONT_NOTIFY_EVENTS,
|
||||
10,
|
||||
CHAR_VALUE_LEN_CONSTANT,
|
||||
&dev_info_svc->serial_num_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to add serial number char: %d", status);
|
||||
}
|
||||
uuid = FIRMWARE_REVISION_UUID;
|
||||
status = aci_gatt_add_char(
|
||||
dev_info_svc->service_handle,
|
||||
UUID_TYPE_16,
|
||||
(Char_UUID_t*)&uuid,
|
||||
strlen(dev_info_svc->hardware_revision),
|
||||
CHAR_PROP_READ,
|
||||
ATTR_PERMISSION_AUTHEN_READ,
|
||||
GATT_DONT_NOTIFY_EVENTS,
|
||||
10,
|
||||
CHAR_VALUE_LEN_CONSTANT,
|
||||
&dev_info_svc->firmware_rev_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to add firmware revision char: %d", status);
|
||||
}
|
||||
uuid = SOFTWARE_REVISION_UUID;
|
||||
status = aci_gatt_add_char(
|
||||
dev_info_svc->service_handle,
|
||||
UUID_TYPE_16,
|
||||
(Char_UUID_t*)&uuid,
|
||||
furi_string_size(dev_info_svc->version_string),
|
||||
CHAR_PROP_READ,
|
||||
ATTR_PERMISSION_AUTHEN_READ,
|
||||
GATT_DONT_NOTIFY_EVENTS,
|
||||
10,
|
||||
CHAR_VALUE_LEN_CONSTANT,
|
||||
&dev_info_svc->software_rev_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to add software revision char: %d", status);
|
||||
}
|
||||
status = aci_gatt_add_char(
|
||||
dev_info_svc->service_handle,
|
||||
UUID_TYPE_128,
|
||||
(const Char_UUID_t*)dev_info_rpc_version_uuid,
|
||||
strlen(dev_info_rpc_version),
|
||||
CHAR_PROP_READ,
|
||||
ATTR_PERMISSION_AUTHEN_READ,
|
||||
GATT_DONT_NOTIFY_EVENTS,
|
||||
10,
|
||||
CHAR_VALUE_LEN_CONSTANT,
|
||||
&dev_info_svc->rpc_version_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to add rpc version characteristic: %d", status);
|
||||
}
|
||||
|
||||
// Update characteristics
|
||||
status = aci_gatt_update_char_value(
|
||||
dev_info_svc->service_handle,
|
||||
dev_info_svc->man_name_char_handle,
|
||||
0,
|
||||
strlen(dev_info_man_name),
|
||||
(uint8_t*)dev_info_man_name);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to update manufacturer name char: %d", status);
|
||||
}
|
||||
status = aci_gatt_update_char_value(
|
||||
dev_info_svc->service_handle,
|
||||
dev_info_svc->serial_num_char_handle,
|
||||
0,
|
||||
strlen(dev_info_serial_num),
|
||||
(uint8_t*)dev_info_serial_num);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to update serial number char: %d", status);
|
||||
}
|
||||
status = aci_gatt_update_char_value(
|
||||
dev_info_svc->service_handle,
|
||||
dev_info_svc->firmware_rev_char_handle,
|
||||
0,
|
||||
strlen(dev_info_svc->hardware_revision),
|
||||
(uint8_t*)dev_info_svc->hardware_revision);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to update firmware revision char: %d", status);
|
||||
}
|
||||
status = aci_gatt_update_char_value(
|
||||
dev_info_svc->service_handle,
|
||||
dev_info_svc->software_rev_char_handle,
|
||||
0,
|
||||
furi_string_size(dev_info_svc->version_string),
|
||||
(uint8_t*)furi_string_get_cstr(dev_info_svc->version_string));
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to update software revision char: %d", status);
|
||||
}
|
||||
status = aci_gatt_update_char_value(
|
||||
dev_info_svc->service_handle,
|
||||
dev_info_svc->rpc_version_char_handle,
|
||||
0,
|
||||
strlen(dev_info_rpc_version),
|
||||
(uint8_t*)dev_info_rpc_version);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to update rpc version char: %d", status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,9 +180,30 @@ void dev_info_svc_stop() {
|
||||
if(dev_info_svc) {
|
||||
furi_string_free(dev_info_svc->version_string);
|
||||
// Delete service characteristics
|
||||
for(size_t i = 0; i < DevInfoSvcGattCharacteristicCount; i++) {
|
||||
flipper_gatt_characteristic_delete(
|
||||
dev_info_svc->service_handle, &dev_info_svc->characteristics[i]);
|
||||
status =
|
||||
aci_gatt_del_char(dev_info_svc->service_handle, dev_info_svc->man_name_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to delete manufacturer name char: %d", status);
|
||||
}
|
||||
status =
|
||||
aci_gatt_del_char(dev_info_svc->service_handle, dev_info_svc->serial_num_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to delete serial number char: %d", status);
|
||||
}
|
||||
status = aci_gatt_del_char(
|
||||
dev_info_svc->service_handle, dev_info_svc->firmware_rev_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to delete firmware revision char: %d", status);
|
||||
}
|
||||
status = aci_gatt_del_char(
|
||||
dev_info_svc->service_handle, dev_info_svc->software_rev_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to delete software revision char: %d", status);
|
||||
}
|
||||
status =
|
||||
aci_gatt_del_char(dev_info_svc->service_handle, dev_info_svc->rpc_version_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(TAG, "Failed to delete rpc version char: %d", status);
|
||||
}
|
||||
// Delete service
|
||||
status = aci_gatt_del_service(dev_info_svc->service_handle);
|
||||
|
||||
@@ -9,7 +9,7 @@ from SCons.Errors import StopError
|
||||
|
||||
def icons_emitter(target, source, env):
|
||||
icons_src = env.GlobRecursive("*.png", env["ICON_SRC_DIR"])
|
||||
icons_src += env.GlobRecursive("frame_rate", env["ICON_SRC_DIR"])
|
||||
icons_src += env.GlobRecursive("**/frame_rate", env["ICON_SRC_DIR"])
|
||||
|
||||
target = [
|
||||
target[0].File(env.subst("${ICON_FILE_NAME}.c")),
|
||||
|
||||
@@ -157,6 +157,11 @@ class AppBuilder:
|
||||
for source_type in self.app.sources
|
||||
)
|
||||
)
|
||||
if not app_sources:
|
||||
raise UserError(f"No source files found for {self.app.appid}")
|
||||
|
||||
## Uncomment for debug
|
||||
# print(f"App sources for {self.app.appid}: {list(f.path for f in app_sources)}")
|
||||
|
||||
app_artifacts = FlipperExternalAppInfo(self.app)
|
||||
app_artifacts.debug = self.app_env.Program(
|
||||
@@ -239,9 +244,10 @@ class AppBuilder:
|
||||
|
||||
# Add dependencies on file assets
|
||||
for assets_dir in self.app._assets_dirs:
|
||||
glob_res = self.app_env.GlobRecursive("*", assets_dir)
|
||||
self.app_env.Depends(
|
||||
app_artifacts.compact,
|
||||
(assets_dir, self.app_env.GlobRecursive("*", assets_dir)),
|
||||
(*glob_res, assets_dir),
|
||||
)
|
||||
|
||||
# Always run the validator for the app's binary when building the app
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import SCons
|
||||
from fbt.util import GLOB_FILE_EXCLUSION
|
||||
from SCons.Script import Flatten
|
||||
from SCons.Node.FS import has_glob_magic
|
||||
|
||||
|
||||
def GlobRecursive(env, pattern, node=".", exclude=[]):
|
||||
@@ -9,14 +10,20 @@ def GlobRecursive(env, pattern, node=".", exclude=[]):
|
||||
results = []
|
||||
if isinstance(node, str):
|
||||
node = env.Dir(node)
|
||||
for f in node.glob("*", source=True, exclude=exclude):
|
||||
if isinstance(f, SCons.Node.FS.Dir):
|
||||
results += env.GlobRecursive(pattern, f, exclude)
|
||||
results += node.glob(
|
||||
pattern,
|
||||
source=True,
|
||||
exclude=exclude,
|
||||
)
|
||||
# Only initiate actual recursion if special symbols can be found in 'pattern'
|
||||
if has_glob_magic(pattern):
|
||||
for f in node.glob("*", source=True, exclude=exclude):
|
||||
if isinstance(f, SCons.Node.FS.Dir):
|
||||
results += env.GlobRecursive(pattern, f, exclude)
|
||||
results += node.glob(
|
||||
pattern,
|
||||
source=True,
|
||||
exclude=exclude,
|
||||
)
|
||||
# Otherwise, just check if that's an existing file path
|
||||
# NB: still creates "virtual" nodes as part of existence check
|
||||
elif (file_node := node.File(pattern)).exists() or file_node.rexists():
|
||||
results.append(file_node)
|
||||
# print(f"Glob result for {pattern} from {node}: {results}")
|
||||
return results
|
||||
|
||||
|
||||
Reference in New Issue
Block a user