Skip to content

Commit 527aa3d

Browse files
committed
updates to build process
1 parent 31ea795 commit 527aa3d

3 files changed

Lines changed: 17 additions & 31 deletions

File tree

buildfile.m

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@
2929
plan("publishGettingStarted").Dependencies = "prepareRelease";
3030
plan("buildDocSearchDb").Dependencies = ...
3131
["publishDocHtml","publishExampleHtml","publishGettingStarted"];
32-
plan("package").Dependencies = ["check","buildDocSearchDb"];
33-
plan("finalizeRelease").Dependencies = "package";
3432

3533
% Top-level release aggregation task
36-
plan("archive").Dependencies = "finalizeRelease";
34+
plan("archive").Dependencies = ["check","buildDocSearchDb"];
3735

3836
% Set default tasks
3937
plan.DefaultTasks = ["check","test"];
@@ -52,11 +50,10 @@ function testTask(context)
5250

5351

5452
function prepareReleaseTask(context)
55-
% Increment the deploy version for the next packaged release.
53+
% Perform release preparation ahead of documentation generation.
5654

5755
rootFolder = string(context.Plan.RootFolder);
5856
ensureProjectLoaded(rootFolder);
59-
wt.deploy.incrementVersionNumber();
6057

6158
end
6259

@@ -101,31 +98,14 @@ function buildDocSearchDbTask(context)
10198
end
10299

103100

104-
function packageTask(context)
105-
% Build the .mltbx release artifact.
106-
107-
rootFolder = string(context.Plan.RootFolder);
108-
ensureProjectLoaded(rootFolder);
109-
wt.deploy.packageRelease(rootFolder);
110-
111-
end
112-
113-
114-
function finalizeReleaseTask(context)
115-
% Perform legacy release finalization side effects.
116-
117-
rootFolder = string(context.Plan.RootFolder);
118-
ensureProjectLoaded(rootFolder);
119-
wt.deploy.finalizeRelease(rootFolder);
120-
121-
end
122-
123-
124101
function archiveTask(context)
125-
% Aggregate the full release workflow under a single entry point.
102+
% Package the toolbox and perform legacy release finalization.
126103

127104
rootFolder = string(context.Plan.RootFolder);
128105
ensureProjectLoaded(rootFolder);
106+
wt.deploy.incrementVersionNumber();
107+
outputFile = wt.deploy.packageRelease(rootFolder);
108+
wt.deploy.finalizeRelease(rootFolder, outputFile);
129109

130110
end
131111

deploy/+wt/+deploy/finalizeRelease.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
function finalizeRelease(projectRoot)
1+
function finalizeRelease(projectRoot, outputFile)
22
% Add the packaged toolbox to the project and open the release folder.
33
%
44
% Copyright 2026 The MathWorks, Inc.
55

66
arguments
77
projectRoot (1,1) string {mustBeFolder}
8+
outputFile (1,1) string {mustBeFile}
89
end
910

1011

11-
% Resolve the packaged output file using the current deploy version.
12+
% Resolve the release context for project and folder side effects.
1213
releaseContext = wt.deploy.getReleaseContext(projectRoot);
13-
toolboxVersion = wt.deploy.readVersionNumber();
14-
opts = wt.deploy.getPackageOptions(projectRoot, toolboxVersion);
1514

1615

1716
% Keep the legacy project update behavior for generated installers.
@@ -20,7 +19,7 @@ function finalizeRelease(projectRoot)
2019
error("wt:deploy:ProjectRequired", ...
2120
"Open WidgetsToolbox.prj before finalizing the release.");
2221
end
23-
project.addFile(opts.OutputFile);
22+
project.addFile(outputFile);
2423

2524

2625
% Preserve the legacy UI behavior after packaging completes.

deploy/+wt/+deploy/packageRelease.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@
1414
outputFile = opts.OutputFile;
1515
matlab.addons.toolbox.packageToolbox(opts);
1616

17+
18+
% Fail immediately if packaging did not create the expected artifact.
19+
if ~isfile(outputFile)
20+
error("wt:deploy:PackageNotCreated", ...
21+
"Toolbox packaging completed without creating %s.", outputFile);
22+
end
23+
1724
end

0 commit comments

Comments
 (0)