Skip to content

Commit d1885f8

Browse files
committed
build(fix): do not remove package from path in buildfile
1 parent 90f88b9 commit d1885f8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

buildfile.m

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55

66
if isMATLABReleaseOlderThan("R2025a")
77

8+
warning("mag:buildtool:path", "MATLAB release ""%s"" not supported for development purposes." + ...
9+
"Adding all folders to the path for testing purposes.", matlabRelease().Release);
10+
811
% Brute-force add all folders to the path.
9-
originalPath = addpath(genpath(plan.RootFolder));
10-
restorePath = onCleanup(@() path(originalPath));
12+
addpath(genpath(plan.RootFolder));
1113
else
1214

1315
% Open package if not already open.
1416
package = matlab.mpm.Package(plan.RootFolder);
1517

1618
if ~package.Installed
17-
18-
originalPath = addpath(join(fullfile(plan.RootFolder, [package.Folders.Path]), pathsep()));
19-
restorePath = onCleanup(@() path(originalPath));
19+
mpminstall(package, Authoring = true, Temporary = true, Prompt = false);
2020
end
2121
end
2222

@@ -36,6 +36,10 @@
3636
TestResults = fullfile("artifacts/results.xml"), ...
3737
CodeCoverageResults = fullfile("artifacts/coverage.xml"));
3838

39+
if ~isMATLABReleaseOlderThan("R2025a")
40+
plan("test").RunOnlyImpactedTests = true;
41+
end
42+
3943
% Add the "package" task to create toolbox.
4044
plan("package") = mag.buildtool.task.PackageTask(Description = "Package code into toolbox", ...
4145
PackageRoot = plan.RootFolder, ...

0 commit comments

Comments
 (0)