From 0997e44254c3bffd4427dfd85981437a24a272e6 Mon Sep 17 00:00:00 2001 From: Pablo Romero Date: Thu, 25 Jul 2024 20:01:28 -0600 Subject: [PATCH] Update Contents.m automatically with version and date data. --- buildUtilities/releaseTask.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/buildUtilities/releaseTask.m b/buildUtilities/releaseTask.m index 9065dca..4414fdc 100644 --- a/buildUtilities/releaseTask.m +++ b/buildUtilities/releaseTask.m @@ -10,13 +10,13 @@ projObj = currentProject; % Remove v from toolboxVersion -options.toolboxVersion = erase(toolboxVersion,"v"); +toolboxVersion = erase(toolboxVersion,"v"); % Toolbox Parameter Configuration toolboxOptions = matlab.addons.toolbox.ToolboxOptions(fullfile(projObj.RootFolder,"toolbox"), "71e8748d-9f0b-4242-b8f1-1d61b60aa4dc"); toolboxOptions.ToolboxName = "BOSSdevice API Toolbox"; -toolboxOptions.ToolboxVersion = options.toolboxVersion; +toolboxOptions.ToolboxVersion = toolboxVersion; toolboxOptions.Summary = projObj.Description; toolboxOptions.Description = "For a more detailed description refer to the toolbox README.md file. ↵↵ Contact email: support@sync2brain.com"; toolboxOptions.AuthorName = authorName; @@ -37,6 +37,15 @@ toolboxOptions.SupportedPlatforms.MatlabOnline = false; toolboxOptions.SupportedPlatforms.Win64 = true; +% Update Contents.m +contentsFilepath = fullfile(projObj.RootFolder,"toolbox","Contents.m"); +toolboxContent = fileread(contentsFilepath); +toolboxContent = regexprep(toolboxContent, '\', char(toolboxVersion)); +toolboxContent = regexprep(toolboxContent, '\', char(datetime('now', 'Format', 'dd-MMM-yyyy'))); +fid = fopen(contentsFilepath, 'w'); +fwrite(fid, toolboxContent); +fclose(fid); + % Required Additional Software % TODO: Automate download and installation of bossdevice firmware. DownloadURL must point to a ZIP file (MLDATX firmware fiel) in the downloads section of sync2brain % toolboxOptions.RequiredAdditionalSoftware = ...