diff --git a/Template/MyCustomDevice_platformio.ini b/Template/MyCustomDevice_platformio.ini index 93edc09..74a957a 100644 --- a/Template/MyCustomDevice_platformio.ini +++ b/Template/MyCustomDevice_platformio.ini @@ -16,8 +16,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_source_folder = Template ; path to your Custom Device Sources, replace "Template" by your folder name -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 file +custom_community_project = YourProject ; Folder name inside zip file, also ZIP file name if "custom_zip_filename" is not changed +custom_zip_filename = ${env_template.custom_community_project} ; Name of the ZIP file, overwrite it to define an other ZIP file name ; Build settings for the Arduino Mega with Custom Firmware Template [env:mobiflight_template_mega] @@ -42,7 +42,7 @@ extra_scripts = custom_core_firmware_version = ${env_template.custom_core_firmware_version} ; don't change this one! custom_community_project = ${env_template.custom_community_project} ; don't change this one! custom_source_folder = ${env_template.custom_source_folder} ; don't change this one! -custom_community_folder = ${env_template.custom_community_folder} ; don't change this one! +custom_zip_filename = ${env_template.custom_zip_filename} ; don't change this one! ; Build settings for the Arduino ProMicro with Custom Firmware Template [env:mobiflight_template_micro] @@ -66,7 +66,8 @@ extra_scripts = ${env.extra_scripts} ; don't change this one! custom_core_firmware_version = ${env_template.custom_core_firmware_version} ; don't change this one! custom_community_project = ${env_template.custom_community_project} ; don't change this one! -custom_device_folder = ${env_template.custom_device_folder} ; don't change this one! +custom_source_folder = ${env_template.custom_source_folder} ; don't change this one! +custom_zip_filename = ${env_template.custom_zip_filename} ; don't change this one! ; Build settings for the Arduino Uno with Custom Firmware Template @@ -91,7 +92,8 @@ extra_scripts = ${env.extra_scripts} ; don't change this one! custom_core_firmware_version = ${env_template.custom_core_firmware_version} ; don't change this one! custom_community_project = ${env_template.custom_community_project} ; don't change this one! -custom_device_folder = ${env_template.custom_device_folder} ; don't change this one! +custom_source_folder = ${env_template.custom_source_folder} ; don't change this one! +custom_zip_filename = ${env_template.custom_zip_filename} ; don't change this one! ; Build settings for the Arduino Nano with Custom Firmware Template @@ -116,7 +118,8 @@ extra_scripts = ${env.extra_scripts} ; don't change this one! custom_core_firmware_version = ${env_template.custom_core_firmware_version} ; don't change this one! custom_community_project = ${env_template.custom_community_project} ; don't change this one! -custom_device_folder = ${env_template.custom_device_folder} ; don't change this one! +custom_source_folder = ${env_template.custom_source_folder} ; don't change this one! +custom_zip_filename = ${env_template.custom_zip_filename} ; don't change this one! ; Build settings for the Raspberry Pico with Custom Firmware Template @@ -146,4 +149,4 @@ extra_scripts = custom_core_firmware_version = ${env_template.custom_core_firmware_version} ; don't change this one! custom_community_project = ${env_template.custom_community_project} ; don't change this one! custom_source_folder = ${env_template.custom_source_folder} ; don't change this one! -custom_community_folder = ${env_template.custom_community_folder} ; don't change this one! +custom_zip_filename = ${env_template.custom_zip_filename} ; don't change this one! diff --git a/copy_fw_files.py b/copy_fw_files.py index 623c9cb..07ebb09 100644 --- a/copy_fw_files.py +++ b/copy_fw_files.py @@ -16,7 +16,7 @@ custom_source_folder = env.GetProjectOption('custom_source_folder', "") # Get the foldername inside the zip file from the build environment. -community_folder = env.GetProjectOption('custom_community_folder', "") +zip_filename = env.GetProjectOption('custom_zip_filename', "") platform = env.BoardConfig().get("platform", {}) @@ -34,10 +34,9 @@ def copy_fw_files (source, target, env): print("Copying community folder") shutil.copy(fw_file_name, "./_build/" + custom_source_folder + "/Community/firmware") original_folder_path = "./_build/" + custom_source_folder + "/Community" - zip_file_path = './_dist/' + community_project + '_' + firmware_version + '.zip' - new_folder_in_zip = community_folder + zip_file_path = './_dist/' + zip_filename + '_' + firmware_version + '.zip' print("Creating zip file") - createZIP(original_folder_path, zip_file_path, new_folder_in_zip) + createZIP(original_folder_path, zip_file_path, community_project) def createZIP(original_folder_path, zip_file_path, new_folder_name): if os.path.exists("./_dist") == False: