-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.m
More file actions
38 lines (33 loc) · 1.04 KB
/
build.m
File metadata and controls
38 lines (33 loc) · 1.04 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
%% build: Build the plot checker
%
% build will build the plot checker
%
% build() builds the plot checker, zipping it as well
function build
orig = cd(fileparts(mfilename('fullpath')));
cleaner = onCleanup(@()(cd(orig)));
status = tester();
if ~all([status.status])
throw(MException('PLOTCHECKER:build:testFailed', ...
'Some unit tests fail'));
end
delete(['.' filesep 'release' filesep '*']);
% pcode Plot
pcode('Plot.m');
pcode('Segment.m');
pcode('Point.m');
pcode('checkPlots.m');
movefile('*.p', ['.' filesep 'release']);
% create docs
fid = fopen('checkPlots.m', 'rt');
code = char(fread(fid)');
fclose(fid);
data = mtree(code);
code = strsplit(code, newline, 'CollapseDelimiters', false);
code = code(1:(min(data.getlastexecutableline) - 1));
fid = fopen(['.' filesep 'release' filesep 'checkPlots.m'], 'wt');
fwrite(fid, strjoin(code, newline));
fclose(fid);
% zip up
zip('release.zip', ['release' filesep '*']);
end