-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_release.m
136 lines (96 loc) · 3.15 KB
/
make_release.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
% function make_release(flag_make_doc=0, flag_clean=1, flag_delete_fuzzy=1, flag_delete_soframework=0)
%
% This is a MATLAB script created to make a new release of IRootLab.
%
% It will create a directory outside the "root" folder (where this file is in),
% Called "../irootlab-<version>", where <version> will be picked by executing the file "irootlab_version.m" inside the "trunk" folder
%
% The steps are:
% 1 Copy the whole "trunk" folder to "../irootlab-"<version>
% 2 Call Doxygen to make fresh documentation (should update the contents of the "../last-generated-doc" directory)
% 3 Copy whatever is inside "../last-generated-doc" to "../irootlab-<version>/doc"
% 4 Zips the folder into "../irootlab-"<version> "../../irootlab_releases"
%
% Parameters:
% flag_make_doc=0 - whether to perform steps 2 and 3 above
% flag_clean=1 - whether to delete the folder created in step 1 after copying the zip file
% flag_delete_fuzzy=1 - whether to delete the folder containing the fuzzy classifier files
% flag_delete_soframework=0 - whether to delete the "classes/soframework" folder
function make_release(flag_make_doc, flag_clean, flag_delete_fuzzy, flag_delete_soframework)
if nargin < 1 || isempty(flag_make_doc)
flag_make_doc = 0;
end;
if nargin < 2 || isempty(flag_clean)
flag_clean = 1;
end;
if nargin < 3 || isempty(flag_delete_fuzzy)
flag_delete_fuzzy = ~any(strfind(irootlab_version, 'julio'));
end;
if nargin < 4 || isempty(flag_delete_soframework)
flag_delete_soframework = 0;
end;
addpath('./m'); % To call irootlab_version;
sversion = irootlab_version();
basename = ['irootlab-', sversion, iif(flag_make_doc, '', '-nodoc')];
sdir = ['../../', basename];
disp(['Version is "', sversion, '"']);
% Step 0.1 - recompiles CLASSMAP.mat
classmap_compile();
% Step 0.2 - remakes classcreator.m
make_classcreator();
% Step 1
disp('Copying IRootLab m folder...');
copyfile('./m', sdir);
% Step 1.1 - removing all the ".svn" directories
disp('Removing ".svn" folders...');
tmp = pwd();
cd(sdir);
dirs = getdirs(pwd, {pwd});
for i = 1:numel(dirs)
cd(dirs{i});
if exist('.svn')
rmdir('.svn', 's');
end;
end;
cd(tmp);
% % Step 1.5 - encrypt Fuzzy classifier
% disp('Encrypting fuzzy classifier...');
% tmp = pwd();
% cd([sdir, '/classes/block/clssr/frbm']);
% pcode('*.m');
% delete('*.m');
% cd(tmp);
% Step 1.5 - delete Fuzzy classifier files
if flag_delete_fuzzy
tmp = pwd();
cd([sdir, '/classes/block/clssr/frbm']);
pcode('*.m');
delete('*.m');
cd(tmp);
end;
% Step 1.6 - deletes the soframework
if flag_delete_soframework
tmp = pwd();
cd([sdir, '/classes/soframework']);
delete('*.m');
cd(tmp);
end;
if flag_make_doc
% Step 2
disp('Running Doxygen...');
cd('doxy');
!doxygen
cd('..');
% Step 3
disp('Copying IRootLab documentation folder...');
copyfile('../../last-generated-doc', [sdir, '/doc']);
end;
% Step 4
zipfile = ['../../../../../irootlab_releases/', basename, '.zip'];
disp(['Creating zip file ', zipfile, '...']);
zip(zipfile, basename, '../..');
if flag_clean
disp(['Deleting directory ', sdir, ' ...']);
rmdir(sdir, 's');
end;
disp('Finished!');