From 2aaa0a359b20ab7d135181892852f48a4a89a1ad Mon Sep 17 00:00:00 2001 From: elral <3263285+elral@users.noreply.github.com> Date: Sat, 20 Apr 2024 10:38:33 +0200 Subject: [PATCH] own define for folder name within zip file --- Template/MyCustomDevice_platformio.ini | 4 ++-- copy_fw_files.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Template/MyCustomDevice_platformio.ini b/Template/MyCustomDevice_platformio.ini index 9ba1df4..4957f43 100644 --- a/Template/MyCustomDevice_platformio.ini +++ b/Template/MyCustomDevice_platformio.ini @@ -15,8 +15,8 @@ build_src_filter = lib_deps = ; You can add additional libraries if required custom_core_firmware_version = 2.5.1 ; define the version from the core firmware files your build should base on custom_device_folder = Template ; path to your Custom Device Sources, replace "Template" by your folder name -custom_community_project = Your_Project ; Should match "Project" from section "Community" within the board.json file, it's the name of the ZIP file - +custom_community_project = Your_Project ; name of the ZIP file, revision will be added during build process +custom_community_folder = Your_Folder_Name ; Folder name inside zip fileShould match "Project" from section "Community" within the board.json file ; Build settings for the Arduino Mega with Custom Firmware Template [env:mobiflight_template_mega] diff --git a/copy_fw_files.py b/copy_fw_files.py index f69aee4..bcfec29 100644 --- a/copy_fw_files.py +++ b/copy_fw_files.py @@ -15,6 +15,9 @@ # Get the custom folder from the build environment. custom_device_folder = env.GetProjectOption('custom_device_folder', "") +# Get the foldername inside the zip file from the build environment. +community_folder = env.GetProjectOption('custom_community_folder', "") + def copy_fw_files (source, target, env): fw_file_name=str(target[0]) @@ -33,7 +36,7 @@ def copy_fw_files (source, target, env): def createCommunityZipFile(source, target, env): original_folder_path = "./_build/" + custom_device_folder + "/Community" zip_file_path = './_dist/' + community_project + '_' + firmware_version + '.zip' - new_folder_in_zip = community_project + new_folder_in_zip = community_folder createZIP(original_folder_path, zip_file_path, new_folder_in_zip) def createZIP(original_folder_path, zip_file_path, new_folder_name):