Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FL-2481] Renamed assets->resources; enforcing Manifest build if it does not exist #1135

Merged
merged 9 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
with:
run: |
set -e
make assets_manifest
make assets_rebuild assets_manifest
git diff --quiet || ( echo "Assets recompilation required."; exit 255 )

- name: 'Build the firmware in docker'
Expand Down
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ ifeq ($(FORCE), 1)
endif
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) flash


.PHONY: updater
updater:
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) RAM_EXEC=1 all
Expand All @@ -97,14 +96,16 @@ updater_package_bin: firmware_all updater
@$(PROJECT_ROOT)/scripts/dist.py copy -t $(TARGET) -p firmware updater -s $(DIST_SUFFIX) --bundlever "$(VERSION_STRING)"

.PHONY: updater_package
updater_package: firmware_all updater
@$(PROJECT_ROOT)/scripts/dist.py copy -t $(TARGET) -p firmware updater -s $(DIST_SUFFIX) -a assets/resources --bundlever "$(VERSION_STRING)"
updater_package: firmware_all updater assets_manifest
@$(PROJECT_ROOT)/scripts/dist.py copy -t $(TARGET) -p firmware updater -s $(DIST_SUFFIX) -r $(PROJECT_ROOT)/assets/resources --bundlever "$(VERSION_STRING)"

.PHONY: assets_manifest
assets_manifest:
@$(MAKE) -C $(PROJECT_ROOT)/assets clean
@$(MAKE) -C $(PROJECT_ROOT)/assets
@$(PROJECT_ROOT)/scripts/assets.py manifest assets/resources
@$(MAKE) -C $(PROJECT_ROOT)/assets manifest

.PHONY: assets_rebuild
assets_rebuild:
@$(MAKE) -C $(PROJECT_ROOT)/assets clean all

.PHONY: flash_radio
flash_radio:
Expand All @@ -124,8 +125,8 @@ flash_radio_fus:

.PHONY: flash_radio_fus_please_i_m_not_going_to_complain
flash_radio_fus_please_i_m_not_going_to_complain:
@$(PROJECT_ROOT)/scripts/flash.py core2fus 0x080EC000 --statement=AGREE_TO_LOOSE_FLIPPER_FEATURES_THAT_USES_CRYPTO_ENCLAVE $(COPRO_DIR)/stm32wb5x_FUS_fw_for_fus_0_5_3.bin
@$(PROJECT_ROOT)/scripts/flash.py core2fus 0x080EC000 --statement=AGREE_TO_LOOSE_FLIPPER_FEATURES_THAT_USES_CRYPTO_ENCLAVE $(COPRO_DIR)/stm32wb5x_FUS_fw.bin
@$(PROJECT_ROOT)/scripts/flash.py core2fus 0x080EC000 --statement=AGREE_TO_LOSE_FLIPPER_FEATURES_THAT_USE_CRYPTO_ENCLAVE $(COPRO_DIR)/stm32wb5x_FUS_fw_for_fus_0_5_3.bin
@$(PROJECT_ROOT)/scripts/flash.py core2fus 0x080EC000 --statement=AGREE_TO_LOSE_FLIPPER_FEATURES_THAT_USE_CRYPTO_ENCLAVE $(COPRO_DIR)/stm32wb5x_FUS_fw.bin
@$(PROJECT_ROOT)/scripts/ob.py set

.PHONY: lint
Expand Down
2 changes: 1 addition & 1 deletion applications/updater/util/update_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static const char* update_task_stage_descr[] = {
[UpdateTaskStageRadioCommit] = "Applying radio stack",
[UpdateTaskStageLfsBackup] = "Backing up LFS",
[UpdateTaskStageLfsRestore] = "Restoring LFS",
[UpdateTaskStageAssetsUpdate] = "Updating assets",
[UpdateTaskStageResourcesUpdate] = "Updating resources",
[UpdateTaskStageCompleted] = "Completed!",
[UpdateTaskStageError] = "Error",
};
Expand Down
2 changes: 1 addition & 1 deletion applications/updater/util/update_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ typedef enum {
UpdateTaskStageRadioCommit,
UpdateTaskStageLfsBackup,
UpdateTaskStageLfsRestore,
UpdateTaskStageAssetsUpdate,
UpdateTaskStageResourcesUpdate,
UpdateTaskStageCompleted,
UpdateTaskStageError,
} UpdateTaskStage;
Expand Down
3 changes: 1 addition & 2 deletions applications/updater/util/update_task_workers.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,13 @@ static bool update_task_post_update(UpdateTask* update_task) {
.total_files = 0,
.processed_files = 0,
};
update_task_set_progress(update_task, UpdateTaskStageAssetsUpdate, 0);
update_task_set_progress(update_task, UpdateTaskStageResourcesUpdate, 0);

path_concat(
string_get_cstr(update_task->update_path),
string_get_cstr(update_task->manifest->resource_bundle),
file_path);

update_task_set_progress(update_task, UpdateTaskStageProgress, 0);
TarArchive* archive = tar_archive_alloc(update_task->storage);
tar_archive_set_file_callback(archive, update_task_resource_unpack_cb, &progress);
success = tar_archive_open(archive, string_get_cstr(file_path), TAR_OPEN_MODE_READ);
Expand Down
2 changes: 1 addition & 1 deletion assets/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/headers
/headers
16 changes: 10 additions & 6 deletions assets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ PROJECT_ROOT = $(abspath $(dir $(abspath $(firstword $(MAKEFILE_LIST))))..)
include $(PROJECT_ROOT)/assets/assets.mk

.PHONY: all
all: icons protobuf dolphin
all: icons protobuf dolphin manifest

$(ASSETS): $(ASSETS_SOURCES) $(ASSETS_COMPILLER)
$(ASSETS): $(ASSETS_SOURCES) $(ASSETS_COMPILER)
@echo "\tASSETS\t\t" $@
@$(ASSETS_COMPILLER) icons "$(ASSETS_SOURCE_DIR)" "$(ASSETS_COMPILED_DIR)"
@$(ASSETS_COMPILER) icons "$(ASSETS_SOURCE_DIR)" "$(ASSETS_COMPILED_DIR)"

.PHONY: icons
icons: $(ASSETS)
Expand All @@ -22,11 +22,15 @@ protobuf: $(PROTOBUF)

$(DOLPHIN_EXTERNAL_OUTPUT_DIR): $(DOLPHIN_SOURCE_DIR)
@echo "\tDOLPHIN blocking"
@$(ASSETS_COMPILLER) dolphin -s dolphin_blocking "$(DOLPHIN_SOURCE_DIR)/blocking" "$(DOLPHIN_INTERNAL_OUTPUT_DIR)"
@$(ASSETS_COMPILER) dolphin -s dolphin_blocking "$(DOLPHIN_SOURCE_DIR)/blocking" "$(DOLPHIN_INTERNAL_OUTPUT_DIR)"
@echo "\tDOLPHIN internal"
@$(ASSETS_COMPILLER) dolphin -s dolphin_internal "$(DOLPHIN_SOURCE_DIR)/internal" "$(DOLPHIN_INTERNAL_OUTPUT_DIR)"
@$(ASSETS_COMPILER) dolphin -s dolphin_internal "$(DOLPHIN_SOURCE_DIR)/internal" "$(DOLPHIN_INTERNAL_OUTPUT_DIR)"
@echo "\tDOLPHIN external"
@$(ASSETS_COMPILLER) dolphin "$(DOLPHIN_SOURCE_DIR)/external" "$(DOLPHIN_EXTERNAL_OUTPUT_DIR)"
@$(ASSETS_COMPILER) dolphin "$(DOLPHIN_SOURCE_DIR)/external" "$(DOLPHIN_EXTERNAL_OUTPUT_DIR)"

.PHONY: manifest
manifest:
$(ASSETS_COMPILER) manifest $(RESOURCES_DIR)

.PHONY: dolphin
dolphin: $(DOLPHIN_EXTERNAL_OUTPUT_DIR)
Expand Down
6 changes: 5 additions & 1 deletion assets/assets.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
ASSETS_DIR := $(PROJECT_ROOT)/assets
ASSETS_COMPILLER := $(PROJECT_ROOT)/scripts/assets.py
ASSETS_COMPILER := $(PROJECT_ROOT)/scripts/assets.py
ASSETS_COMPILED_DIR := $(ASSETS_DIR)/compiled
ASSETS_SOURCE_DIR := $(ASSETS_DIR)/icons

ASSETS_SOURCES += $(shell find $(ASSETS_SOURCE_DIR) -type f -iname '*.png' -or -iname 'frame_rate')
ASSETS += $(ASSETS_COMPILED_DIR)/assets_icons.c

RESOURCES_DIR := $(ASSETS_DIR)/resources
RESOURCES_MANIFEST := $(RESOURCES_DIR)/Manifest
RESOURCES_FILES := $(shell find $(RESOURCES_DIR) ! -name Manifest -type f)

DOLPHIN_SOURCE_DIR := $(ASSETS_DIR)/dolphin
DOLPHIN_INTERNAL_OUTPUT_DIR := $(ASSETS_COMPILED_DIR)
DOLPHIN_EXTERNAL_OUTPUT_DIR := $(ASSETS_DIR)/resources/dolphin
Expand Down
Loading