-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathwtPackageRelease.m
More file actions
89 lines (55 loc) · 2.21 KB
/
Copy pathwtPackageRelease.m
File metadata and controls
89 lines (55 loc) · 2.21 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
% Package a Toolbox Release
% Copyright 2025 The MathWorks, Inc.
%% Increment Version Number?
% Increment the last part of the version number in wtDeployVersion.txt for
% the next release
wt.deploy.incrementVersionNumber();
%% Get paths
% Project root
proj = currentProject;
projectRoot = proj.RootFolder;
docInputPath = fullfile(projectRoot,"widgets","doc");
docOutputPath = fullfile(projectRoot,"widgets","doc");
examplesInputPath = fullfile(projectRoot,"widgets","examples");
examplesOutputPath = fullfile(projectRoot,"widgets","doc");
gettingStartedInputPath = fullfile(projectRoot,"widgets","doc","GettingStarted.mlx");
gettingStartedOutputPath = fullfile(projectRoot,"widgets","doc");
%% Run unit tests
[testSuite, testResult] = runTestSuite;
if ~all([testResult.Passed])
error("Unit tests failed. Aborting package release.");
end
%% Publish doc and examples mlx as html
% Find the doc input ".mlx" files
docInputInfo = what(docInputPath);
docInputFiles = docInputInfo.mlx;
docInputFiles = fullfile(docInputPath, docInputFiles);
% Publish these to HTML output
wt.deploy.publishLiveScriptToHtml(docInputFiles, docOutputPath)
%% Publish examples as html
% Find the examples ".mlx" files
examplesInputInfo = what(examplesInputPath);
examplesInputFiles = examplesInputInfo.mlx;
examplesInputFiles = fullfile(examplesInputPath, examplesInputFiles);
% Publish these to HTML output
wt.deploy.publishLiveScriptToHtml(examplesInputFiles, examplesOutputPath)
%% Publish GettingStarted.mlx as html
% Publish to HTML output
wt.deploy.publishLiveScriptToHtml(gettingStartedInputPath, gettingStartedOutputPath)
%% Build search database
% Create v3 for/from R2021a - R2021b
% Create v4 for/from R2022a and later
builddocsearchdb(docOutputPath)
%% Package the Release
% Increment the last part of the version number in version.txt
toolboxVersion = wt.deploy.readVersionNumber();
% Read in the package options
opts = wt.deploy.getPackageOptions(projectRoot, toolboxVersion);
outputFile = opts.OutputFile;
% Perform the packaging
matlab.addons.toolbox.packageToolbox(opts);
% Add the installer to the project
proj.addFile(outputFile)
%% Open the release folder
releaseFolder = fullfile(projectRoot,"release");
winopen(releaseFolder);