-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathgetPackageOptions.m
More file actions
149 lines (107 loc) · 4.9 KB
/
Copy pathgetPackageOptions.m
File metadata and controls
149 lines (107 loc) · 4.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
function opts = getPackageOptions(projectRoot, toolboxVersion)
% Returns the toolbox packaging options
% Copyright 2025-2026 The MathWorks, Inc.
arguments %(Input)
projectRoot (1,1) string {mustBeFolder}
toolboxVersion (1,1) string
end
% arguments (Output)
% opts (1,1) matlab.addons.toolbox.ToolboxOptions
% end
%% Define paths
% Get the root folder
toolboxFolder = fullfile(projectRoot,"widgets");
docFolder = fullfile(toolboxFolder,"doc");
% UUID for Widgets Toolbox 2.x on File Exchange
identifier = "78895307-cc36-4970-8b66-0697da8f9352";
%% Prepare options
opts = matlab.addons.toolbox.ToolboxOptions(toolboxFolder, identifier);
%% Requirements
% Maintainers build the toolbox in the latest MATLAB release, but the
% packaged toolbox output continues to support MATLAB R2021a and later.
opts.MinimumMatlabRelease = "R2021a";
opts.MaximumMatlabRelease = "";
opts.SupportedPlatforms.Win64 = true;
opts.SupportedPlatforms.Glnxa64 = true;
opts.SupportedPlatforms.Mac = true;
opts.SupportedPlatforms.MatlabOnline = true;
% opts.RequiredAddons
% opts.RequiredAdditionalSoftware
%% Output
opts.ToolboxVersion = toolboxVersion;
outFileName = sprintf("Widgets Toolbox %s.mltbx", toolboxVersion);
opts.OutputFile = fullfile(projectRoot,"release",outFileName);
%% Define file contents / paths
% Toolbox file contents paths - This should be set automatically
% opts.ToolboxFiles
% Folders to add to the MATLAB path
relativePaths = [
""
"doc"
"examples"
"icons"
];
opts.ToolboxMatlabPath = fullfile(toolboxFolder, relativePaths);
% opts.ToolboxMatlabPath = [
% ""
% "doc"
% "examples"
% "icons"
% ];
% Java path for toolbox
% opts.ToolboxJavaPath
% Files to add to the app gallery
opts.AppGalleryFiles = ...
fullfile(toolboxFolder, "examples", "WidgetsExampleApp.mlapp");
% Path to the getting started guide
opts.ToolboxGettingStartedGuide = fullfile(toolboxFolder,...
"doc","GettingStarted.mlx");
%% Remove doc files except GettingStarted.mlx
% Define patterns
docFilePattern = docFolder + filesep + alphanumericsPattern + ".mlx";
gsFileStr = fullfile(docFolder,"GettingStarted.mlx");
% Find matches
isMatch = matches(opts.ToolboxFiles, docFilePattern) & ...
~matches(opts.ToolboxFiles, gsFileStr);
% Remove the files
opts.ToolboxFiles(isMatch) = [];
%% Metadata
opts.ToolboxName = "Widgets Toolbox - App Designer and Advanced App Components";
opts.Summary = "Additional app building components to efficiently " + ...
"develop advanced user interfaces in MATLAB";
opts.Description = join([
"Widgets Toolbox helps you efficiently develop advanced user interfaces in MATLAB and App Designer. Widgets combine existing control functionalities together into larger, reusable, common functionality to accelerate development of graphical user interfaces."
""
"Components include:"
""
" - Grid of buttons grouped together"
" - List of checkboxes and labels grouped together"
" - Color selector control"
" - Date and time selector"
" - File selection control, consisting of a label, edit field, and browse button"
" - Listbox control combined with a label and a set of buttons for managing the list composition and ordering"
" - Password field with hidden text"
" - Progress bar indicator with time remaining and cancel button"
" - Slider control group with labels and enable/disable checkboxes"
" - Slider control linked to a numeric spinner and edit field"
" - List of tasks with icons indicating status (pass, fail, running, complete, etc.)"
" - Toolbar with advanced layout functionality that can appear like a toolstrip"
" - Contextual pane that can switch contents (similar to card panel, tab panel, uitab)"
""
"Additional object-oriented code components provide enable you to work more efficiently developing advanced apps using a modular hand-code approach. You can use model-view-controller or a similar separated presentation architecture."
""
" - Application superclasses for managing single or multiple session files"
" - Preference management"
" - Superclasses for model-view-controller implementation"
""
"This version of Widgets Toolbox is intended for NEW development of uifigure or App Designer apps starting from R2021a or newer releases."
""
"If you have an existing MATLAB app using Widgets Toolbox 1.x content, you may also need 'Widgets Toolbox (Compatibility Support)'."
"https://www.mathworks.com/matlabcentral/fileexchange/66235-widgets-toolbox"
""
"Planning a complex or business-critical app? MathWorks Consulting can advise you on design and architecture: https://www.mathworks.com/services/consulting/proven-solutions/software-development-with-matlab.html"
], newline);
opts.AuthorName = "Robyn Jackey (MathWorks Consulting)";
opts.AuthorEmail = "";
opts.AuthorCompany = "MathWorks Consulting";
opts.ToolboxImageFile = fullfile(projectRoot,"deploy","wtLogo.png");