-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbuildgaimc.m
87 lines (82 loc) · 2.5 KB
/
buildgaimc.m
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
%% build the gaimc distribution
function buildgaimc(varargin)
if ~isempty(strmatch('all',varargin))
buildlist = {'test','pages','zip'};
else
buildlist = varargin;
end
tobuild = @(type,buidlist) ~isempty(strmatch(type,buildlist));
gaimcversion = '1.0';
mypath = fileparts(mfilename('fullpath'));
oldpath = pwd;
matlablpath=path;
try
if tobuild('test',buildlist)
fprintf('Running tests...\n\n');
cd(mypath) % move to where we think we are
cd ../ % in main gaimc directory
addpath(pwd); % add it to the path
cd test % run tests
try
test_main
catch ME
fprintf('*************\n')
fprintf('Tests failed!\n');
fprintf('*************\n')
fprintf('\n');
fprintf('Build halted.\n');
fprintf('\n');
fprintf('Test error:\n');
rethrow(ME);
end
end
if tobuild('pages',buildlist)
fprintf('Building demos...\n\n');
cd(mypath) % move to where we think we are
cd ../ % in main gaimc directory
addpath(pwd); % add it to the path
cd demo
try
publish('demo');
publish('airports');
publish('performance_comparison_simple');
if tobuild('pages_fullperf')
publish('performance_comparison');
end
catch ME
fprintf('******************\n')
fprintf('Publishing failed!\n');
fprintf('******************\n')
fprintf('\n');
fprintf('Build halted.\n');
fprintf('\n');
fprintf('Test error:\n');
rethrow(ME);
end
end
if tobuild('zip',buildlist)
cd(mypath) % move to where we think we are
try
cd ../../
[status,result] = system(...
sprintf('zip -r gaimc/build/gaimc-%s.zip gaimc/*.m gaimc/demo gaimc/test gaimc/graphs',...
gaimcversion));
result
catch ME
fprintf('******************\n')
fprintf('Zipping failed!\n');
fprintf('******************\n')
fprintf('\n');
fprintf('Build halted.\n');
fprintf('\n');
fprintf('Error:\n');
rethrow(ME);
end
end
catch ME
cd(oldpath); % move to where we think we are
path(matlabpath);
rethrow(ME)
end
cd(oldpath);
path(matlabpath);