|
5 | 5 |
|
6 | 6 | pkg_name = "+stdlib"; |
7 | 7 |
|
8 | | -if ~isMATLABReleaseOlderThan("R2023b") |
| 8 | +addpath(plan.RootFolder) |
| 9 | + |
| 10 | +if isMATLABReleaseOlderThan("R2023b") |
| 11 | + plan("test") = matlab.buildtool.Task(Actions=@legacyTestTask); |
| 12 | +else |
9 | 13 | plan("check") = matlab.buildtool.tasks.CodeIssuesTask(pkg_name, IncludeSubfolders=true); |
| 14 | + plan("test") = matlab.buildtool.tasks.TestTask("test", Strict=true); |
10 | 15 | end |
11 | 16 |
|
12 | | -if ~isMATLABReleaseOlderThan("R2024b") |
13 | 17 |
|
| 18 | +if isMATLABReleaseOlderThan("R2024b") |
| 19 | + plan("mex") = matlab.buildtool.Task(Actions=@legacyMexTask); |
| 20 | +else |
14 | 21 | plan("clean") = matlab.buildtool.tasks.CleanTask; |
15 | 22 |
|
16 | 23 | [compiler_id, compiler_opt] = get_compiler_options(); |
|
33 | 40 |
|
34 | 41 |
|
35 | 42 | function legacyMexTask(context) |
36 | | - |
37 | | -pkg_name = "+stdlib"; |
38 | | - |
39 | | -legacy_mex_build(context.Plan.RootFolder, fullfile(context.Plan.RootFolder, pkg_name)) |
40 | | - |
| 43 | +legacy_mex_build(context.Plan.RootFolder, fullfile(context.Plan.RootFolder, "+stdlib")) |
41 | 44 | end |
42 | 45 |
|
43 | 46 |
|
44 | | -function testTask(context) |
| 47 | +function legacyTestTask(context) |
| 48 | +r = runtests(fullfile(context.Plan.RootFolder, "test"), Strict=true); |
| 49 | +% Parallel Computing Toolbox takes more time to startup than is worth it for this task |
45 | 50 |
|
46 | | - addpath(context.Plan.RootFolder) |
47 | | - |
48 | | - r = runtests("test", ... |
49 | | - IncludeSubfolders=true, ... |
50 | | - strict=true, ... |
51 | | - UseParallel=false); |
52 | | - % Parallel Computing Toolbox takes more time to startup than is worth it for this task |
53 | | - |
54 | | - assert(~isempty(r), "No tests were run") |
55 | | - assertSuccess(r) |
| 51 | +assert(~isempty(r), "No tests were run") |
| 52 | +assertSuccess(r) |
56 | 53 | end |
57 | 54 |
|
58 | 55 |
|
59 | 56 | function coverageTask(context) |
60 | | - |
61 | | - coverage_run("stdlib", fullfile(context.Plan.RootFolder, "test")) |
| 57 | +coverage_run("stdlib", fullfile(context.Plan.RootFolder, "test")) |
62 | 58 | end |
63 | 59 |
|
64 | 60 |
|
65 | 61 | function publishTask(context) |
| 62 | +outdir = fullfile(context.Plan.RootFolder, "docs"); |
66 | 63 |
|
67 | | - outdir = fullfile(context.Plan.RootFolder, "docs"); |
68 | | - |
69 | | - publish_gen_index_html("stdlib", ... |
70 | | - "A standard library of functions for Matlab.", ... |
71 | | - "https://github.com/geospace-code/matlab-stdlib", ... |
72 | | - outdir) |
| 64 | +publish_gen_index_html("stdlib", ... |
| 65 | + "A standard library of functions for Matlab.", ... |
| 66 | + "https://github.com/geospace-code/matlab-stdlib", ... |
| 67 | + outdir) |
73 | 68 | end |
0 commit comments