0
|
1 |
#
|
|
2 |
# Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
# All rights reserved.
|
|
4 |
# This component and the accompanying materials are made available
|
|
5 |
# under the terms of "Eclipse Public License v1.0"
|
|
6 |
# which accompanies this distribution, and is available
|
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
#
|
|
9 |
# Initial Contributors:
|
|
10 |
# Nokia Corporation - initial contribution.
|
|
11 |
#
|
|
12 |
# Contributors:
|
|
13 |
#
|
|
14 |
# Description:
|
|
15 |
#
|
|
16 |
|
|
17 |
package SDK_vars;
|
|
18 |
use strict;
|
|
19 |
no strict "subs";
|
|
20 |
use Exporter;
|
|
21 |
use Cwd;
|
|
22 |
|
|
23 |
our ($VERSION, @ISA, @EXPORT, %iniH, %common_comp, %common_comp2, %common_comp3, %lib_dirs_to_collect_from_platform,
|
|
24 |
$sdk_root, $repository_area, @remove_lists, $blacklist, $common_graylist, $cpp_graylist, $java_graylist,
|
|
25 |
$symbianlist, %sdk_lang_codes, %extra_lang_codes, $IFs, @ecmt_dirs,@emu_src_dirs, @tools_src_dirs, @java_dirs, @dirs_to_dbgstrip, $body,
|
|
26 |
%final_dest_dirsH, %Java_final_dest_dirsH, %final_dest_dirsH2,
|
|
27 |
%root_levelH3, $sms_receivers, @sub_roots, $init_dir, @RnD_dirs,%lang_names );
|
|
28 |
|
|
29 |
$VERSION = 1.00;
|
|
30 |
@ISA = qw(Exporter);
|
|
31 |
@EXPORT = qw(parse_ini_file
|
|
32 |
%iniH %common_comp %common_comp2 %common_comp3 %lib_dirs_to_collect_from_platform $sdk_root
|
|
33 |
$repository_area @remove_lists $blacklist $common_graylist $cpp_graylist $java_graylist %sdk_lang_codes %extra_lang_codes
|
|
34 |
$IFs $symbianlist @ecmt_dirs @emu_src_dirs @tools_src_dirs @java_dirs @dirs_to_dbgstrip $body
|
|
35 |
%final_dest_dirsH %Java_final_dest_dirsH %final_dest_dirsH2
|
|
36 |
%root_levelH3 $sms_receivers @sub_roots $init_dir @RnD_dirs %lang_names %lib_collect_dirs );
|
|
37 |
|
|
38 |
#These will be executed every time
|
|
39 |
($init_dir = Cwd::cwd())=~ tr [/][\\];
|
|
40 |
|
|
41 |
initialize_start_dir($init_dir);
|
|
42 |
|
|
43 |
|
|
44 |
parse_ini_file("sdk.ini", \%iniH);
|
|
45 |
if (-f "cmd.ini"){
|
|
46 |
parse_ini_file("cmd.ini", \%iniH);
|
|
47 |
}
|
|
48 |
set_sdk_name();
|
|
49 |
|
|
50 |
my $tmp_path=$init_dir."\\tools;".$ENV{PATH};
|
|
51 |
$ENV{PATH}=$tmp_path;
|
|
52 |
|
|
53 |
|
|
54 |
if ($iniH{Output_Base_substed}){
|
|
55 |
`subst $iniH{Output_Base_substed} /d` ;
|
|
56 |
system ("subst $iniH{Output_Base_substed} $iniH{Output_Base}");
|
|
57 |
}
|
|
58 |
|
|
59 |
my $substs = `subst`;
|
|
60 |
print $substs;
|
|
61 |
print "\nSubstitutions vs Start_time or Sdk_root mismatch!!!\n$substs\n$iniH{S60_Root} $iniH{Start_time} \n\n" unless ($substs =~ /$iniH{S60_Root}\\: =>.+$iniH{Start_time}/);
|
|
62 |
|
|
63 |
#Global variables
|
|
64 |
$repository_area = "$iniH{S60_Root}\\sce\\Repository_area";
|
|
65 |
$blacklist = "$repository_area\\Common_Blacklist\\black_list.txt";
|
|
66 |
$common_graylist = "$repository_area\\Common_Graylist\\common_graylist.txt";
|
|
67 |
$cpp_graylist = "$repository_area\\CPP_Graylist\\graylistcpp.txt";
|
|
68 |
$java_graylist = "$repository_area\\Java_Graylist\\Java_graylist.txt";
|
|
69 |
$IFs = "\\IFs";
|
|
70 |
@remove_lists = ($blacklist, $common_graylist, $cpp_graylist, $java_graylist);
|
|
71 |
|
|
72 |
#The set of sub root directories including include itself (=empty)!
|
|
73 |
@sub_roots = qw ( \\ \\middleware\\ \\osextensions\\ \\applications\\);
|
|
74 |
# Following line commented by ngv to ensure more apis are included
|
|
75 |
|
|
76 |
|
|
77 |
#Copy components from repositories to repository_area
|
|
78 |
#If it contains . then only that pattern is copied. Otherwise all subdirectories are copied as well.
|
|
79 |
#NB. Complemantary localisation files are copied only if they are in *_localisation.zip.
|
|
80 |
|
|
81 |
# Platform_Patch => [qw(\\*S60_3_1_200614_SP1.zip)],
|
|
82 |
# Languages_Patch => [qw(\\*.zip)],
|
|
83 |
# Common_Tools => [""],
|
|
84 |
|
|
85 |
%common_comp = (
|
|
86 |
Beatnik => [""],
|
|
87 |
Capas => [""],
|
|
88 |
Common_Blacklist => [qw(\\black_list.txt)],
|
|
89 |
Common_Graylist => [qw(\\common_graylist.txt)],
|
|
90 |
Common_Patch => [""],
|
|
91 |
Common_S60Tools => [""],
|
|
92 |
SDK_Installer => [""],
|
|
93 |
Doc_Browser => [""],
|
|
94 |
Doc_General => [""],
|
|
95 |
Doc_Carbide_Plugin => [""],
|
|
96 |
Doc_External => [""],
|
|
97 |
Doc_Licensee => [""],
|
|
98 |
Doc_Eclipse_Plugin => [""],
|
|
99 |
Doc_NetBeans_Plugin => [qw(\\*.nbm)],
|
|
100 |
CPP_Doc_APIRef => [""],
|
|
101 |
CPP_Carbide_Manifest => [""],
|
|
102 |
CPP_CarbideVS_Descriptor => [""],
|
|
103 |
CPP_API => [""],
|
|
104 |
CPP_Examples => [""],
|
|
105 |
CPP_Graylist => [qw(\\graylistcpp.txt)],
|
|
106 |
CPP_Patch => [""],
|
|
107 |
CPP_Commonfilestools => [""],
|
|
108 |
CPP_Symbian_Ex => [""],
|
|
109 |
#CPP_S60Tools => [""],
|
|
110 |
CPP_Tools => [""],
|
|
111 |
CPP_Tools_build => [""],
|
|
112 |
Java_Examples => [qw(\\examples)],
|
|
113 |
Java_Graylist => [qw(\\Java_graylist.txt)],
|
|
114 |
Java_Patch => [""],
|
|
115 |
Java_SDK => [qw(\\emulator.exe \\prefs.exe \\preverify2.exe \\preverify.exe)],
|
|
116 |
#Java_S60Tools => [""],
|
|
117 |
Java_Toolchain => [qw(\\nei.jar)],
|
|
118 |
Java_Tools_build => [""],
|
|
119 |
Java_NUMC => [""],
|
|
120 |
Widget_Examples => [""],
|
|
121 |
Vista_GCCEPatch_Plugin => [""],
|
|
122 |
CPP_OpenC_Plugin => [qw(\\glib.zip)],
|
|
123 |
Sdk_Lang_Extra_Readme => [""],
|
|
124 |
OOMMonitorAPI => [""],
|
|
125 |
);
|
|
126 |
|
|
127 |
%lib_dirs_to_collect_from_platform = (
|
|
128 |
'2.8' => {
|
|
129 |
armi => [qw(urel)],
|
|
130 |
thumb => [qw(urel)],
|
|
131 |
winscw => [qw(udeb)]
|
|
132 |
},
|
|
133 |
'3.0' => {
|
|
134 |
armi => [qw(urel)],
|
|
135 |
armv5 => [qw(lib urel udeb)],
|
|
136 |
thumb => [qw(urel)],
|
|
137 |
winscw => [qw(udeb)]
|
|
138 |
},
|
|
139 |
'9.9' => {
|
|
140 |
armv5 => [qw(lib urel udeb)],
|
|
141 |
winscw => [qw(udeb)]
|
|
142 |
},
|
|
143 |
);
|
|
144 |
|
|
145 |
%sdk_lang_codes = (
|
|
146 |
zh_CN => [qw( 31 159)],
|
|
147 |
en_US => [qw( 01 10)],
|
|
148 |
# ja_JP => [qw( 32 160)], /Commented to remove the japanese lang from N97 SDK
|
|
149 |
);
|
|
150 |
%extra_lang_codes = (
|
|
151 |
## tr_TR => [qw( 14 )],
|
|
152 |
## th_TH => [qw( 33 161)],
|
|
153 |
## ar_SA => [qw( 37 )],
|
|
154 |
## fa_IR => [qw( 50 )],
|
|
155 |
## el_GR => [qw( 54 )],
|
|
156 |
## he_IL => [qw( 57 )],
|
|
157 |
## hi_IN => [qw( 58 )],
|
|
158 |
## uk_UA => [qw( 93 )],
|
|
159 |
## ur_PK => [qw( 94 )],
|
|
160 |
);
|
|
161 |
#Update this hash to create FN specific extra lang zips
|
|
162 |
%lang_names=(
|
|
163 |
ar_SA=>"Arabic",
|
|
164 |
ur_PK=>"Urdu"
|
|
165 |
);
|
|
166 |
$body = "";
|
|
167 |
$sms_receivers = "";
|
|
168 |
|
|
169 |
#Blacklist and dbgstrip applied to these
|
|
170 |
%common_comp2 = (
|
|
171 |
Beatnik => "\\sdk_wa\\",
|
|
172 |
);
|
|
173 |
#Patches et al. These are copied at phase 2 ie. after blacklist but before dbgstrip
|
|
174 |
%common_comp3 = (
|
|
175 |
Common_Patch => "\\sdk_wa\\",
|
|
176 |
);
|
|
177 |
|
|
178 |
%final_dest_dirsH = (
|
|
179 |
CPP_CarbideVS_Descriptor => "\\SDK_files\\CarbideVS_Descriptor\\",
|
|
180 |
CPP_Carbide_Manifest => "\\SDK_files\\carbide_manifest\\epoc32\\kit\\",
|
|
181 |
CPP_Doc_APIRef => "\\SDK_files\\docs\\",
|
|
182 |
Doc_Carbide_Plugin => "\\SDK_files\\carbide_docplugin\\epoc32\\kit\\",
|
|
183 |
Doc_General => "\\SDK_files\\docs\\",
|
|
184 |
Doc_Browser => "\\SDK_files\\docs\\",
|
|
185 |
Doc_Licensee => "\\SDK_files\\docs\\Terms\\",
|
|
186 |
Doc_Eclipse_Plugin => "\\SDK_files\\Eclipse_Plugin\\",
|
|
187 |
SDK_Installer => "\\installer\\",
|
|
188 |
CPP_Symbian_Ex => "\\SDK_files\\Examples\\Symbian\\",
|
|
189 |
CPP_Examples => "\\SDK_files\\Examples\\CPP\\",
|
|
190 |
CPP_Commonfilestools => "\\SDK_files\\Commonfilestools\\",
|
|
191 |
Java_API => "\\SDK_files\\lib\\",
|
|
192 |
#Java_Doc_Examples => "\\SDK_files\\S60examples\\",
|
|
193 |
Java_Examples => "\\SDK_files\\Examples\\MIDP\\",
|
|
194 |
Java_Patch => "\\SDK_files\\",
|
|
195 |
SDK_Installer => "\\SDK_installer\\",
|
|
196 |
Java_NUMC => "\\SDK_files\\Java_NUMC\\",
|
|
197 |
Java_SDK => "\\SDK_files\\bin\\",
|
|
198 |
Java_Toolchain => "\\SDK_files\\epoc32_toolchain_common\\epoc32\\tools\\ecmt\\",
|
|
199 |
Widget_Examples => "\\SDK_files\\Examples\\Widget\\",
|
|
200 |
Vista_GCCEPatch_Plugin => "\\SDK_files\\Vista_GCCEPatch_Plugin\\",
|
|
201 |
);
|
|
202 |
|
|
203 |
|
|
204 |
%final_dest_dirsH2 = (
|
|
205 |
Capas => "\\SDK_files\\epoc32_emu\\",
|
|
206 |
CPP_Patch => "\\SDK_files\\", #These may go to epoc32_emu eventually
|
|
207 |
#CPP_S60Tools => "\\SDK_files\\S60Tools\\",
|
|
208 |
CPP_Tools => "\\SDK_files\\",
|
|
209 |
CPP_Tools_build => "\\SDK_files\\S60Tools\\Ecmt\\",
|
|
210 |
Common_S60Tools => "\\SDK_files\\S60Tools\\",
|
|
211 |
Java_Patch => "\\SDK_files\\",
|
|
212 |
#Java_S60Tools => "\\SDK_Java\\SDK_files\\S60tools\\",
|
|
213 |
Java_Tools_build => "\\SDK_files\\S60tools\\Ecmt",
|
|
214 |
CPP_OpenC_Plugin => "\\SDK_files\\OpenC_Plugin\\",
|
|
215 |
);
|
|
216 |
|
|
217 |
|
|
218 |
%root_levelH3 = (
|
|
219 |
Doc_External => ".\\",
|
|
220 |
#Doc_NetBeans_Plugin => ".\\",
|
|
221 |
);
|
|
222 |
|
|
223 |
#These are copied from SDK platform -> sdk_wa
|
|
224 |
@emu_src_dirs = qw (data release\\winscw\\udeb winscw);
|
|
225 |
@ecmt_dirs = qw (tools\\ecmt);
|
|
226 |
|
|
227 |
#These are copied from SDK platform -> sdk_wa
|
|
228 |
@tools_src_dirs = qw (release\\winc\\urel\\*.dll
|
|
229 |
release\\winc\\urel\\*.exe
|
|
230 |
release\\winc\\urel\\*.fsy
|
|
231 |
tools gcc cshlpcmp_template);
|
|
232 |
|
|
233 |
#These dirs are copied from sdk_wa\epoc32 -> Java sdk
|
|
234 |
@java_dirs = qw (data release\\winscw tools\\ecmt tools\\java tools\\SipServer winscw);
|
|
235 |
|
|
236 |
@RnD_dirs = qw ( data
|
|
237 |
cshlpcmp_template
|
|
238 |
gcc
|
|
239 |
include
|
|
240 |
release\\winscw\\udeb
|
|
241 |
release\\winc\\urel\\*.dll
|
|
242 |
release\\winc\\urel\\*.exe
|
|
243 |
release\\winc\\urel\\*.fsy
|
|
244 |
tools
|
|
245 |
winscw
|
|
246 |
);
|
|
247 |
|
|
248 |
#These directories are stripped on work_area
|
|
249 |
@dirs_to_dbgstrip = qw (epoc32\release\winscw\udeb
|
|
250 |
epoc32\release\winscw\urel
|
|
251 |
epoc32\tools);
|
|
252 |
|
|
253 |
|
|
254 |
|
|
255 |
sub parse_ini_file {
|
|
256 |
my $regex_var = qr{
|
|
257 |
\$ # dollar sign
|
|
258 |
(\{)? # $1: optional opening curly
|
|
259 |
([a-zA-Z_]\w*) # $2: capturing variable name
|
|
260 |
(?(1)\}) # $3: if there's the opening curly... match closing curly
|
|
261 |
}x;
|
|
262 |
my $regex_sub = qr{
|
|
263 |
sub #
|
|
264 |
\s* # potential blanko(s)
|
|
265 |
(\{)? # $1: optional opening curly
|
|
266 |
\s*
|
|
267 |
(.+) # $2: capturing variable name
|
|
268 |
(?(1)\}) # $3: if there's the opening curly... match closing curly
|
|
269 |
}x;
|
|
270 |
|
|
271 |
my ($ini_file, $href) = @_;
|
|
272 |
open(INI, "<$ini_file") or die "Cannot read $ini_file: $!\n";
|
|
273 |
|
|
274 |
while( <INI> ) {
|
|
275 |
chomp;
|
|
276 |
s/\s#.*//; # Remove comments
|
|
277 |
s/\s+$//; # and traling spaces
|
|
278 |
s/^\[.*\]// ; # and sections
|
|
279 |
next unless length; # anything left?
|
|
280 |
my ($key, $value ) = split /\s*=\s?/; #Don't comsume more than 1 blanko after =
|
|
281 |
while ($value =~/$regex_var/ && defined ($$href{$2})){ #interpolate only if the variable is defined earlier in the inifile
|
|
282 |
$value =~ s/$regex_var/$$href{$2}/;
|
|
283 |
}
|
|
284 |
|
|
285 |
if ($value =~ s/$regex_sub/$2/){ #Evaluate if the value starts with 'sub{'
|
|
286 |
$value =~ s/\$/esc_dollar_/g; #\$ -> esc_dollar
|
|
287 |
$value = eval $value;
|
|
288 |
$value =~ s/esc_dollar_/\$/g;
|
|
289 |
}
|
|
290 |
$$href{ $key } = $value;
|
|
291 |
}
|
|
292 |
close INI;
|
|
293 |
}
|
|
294 |
|
|
295 |
sub set_sdk_name {
|
|
296 |
|
|
297 |
my %Phases = ('a' => 'Alpha',
|
|
298 |
'b' => 'Beta',
|
|
299 |
'f' => '1.0',
|
|
300 |
'h' => 'Herald',);
|
|
301 |
|
|
302 |
# Following section was added by ngv on 08/08/2008 due to changes in SDK naming
|
|
303 |
$iniH{ Kit_ID } = "$iniH{Kit_ID}_$iniH{Start_Menu2}";
|
|
304 |
$iniH{ SDK_Short_name } = "$iniH{SDK_Short_name} $iniH{Start_Menu2}";
|
|
305 |
$iniH{ SDK_Product_name } = "$iniH{ SDK_Product_name } $iniH{Start_Menu2}";
|
|
306 |
$iniH{ Build_ID } = "-";
|
|
307 |
$iniH{ Start_Menu2 } = "$iniH{Start_Menu2}";
|
|
308 |
|
|
309 |
if ( $iniH{Support_pack} ) {
|
|
310 |
$iniH{SDK_Product_name} = "$iniH{SDK_Product_name}, $iniH{Support_pack}";
|
|
311 |
$iniH{sdkApiRefFullName} = "$iniH{SDK_Product_name}";
|
|
312 |
}
|
|
313 |
}
|
|
314 |
|
|
315 |
sub initialize_start_dir {
|
|
316 |
|
|
317 |
|
|
318 |
my $curr_dir = Cwd::cwd();
|
|
319 |
$curr_dir =~ s/\//\\\//g; # forward slashes in dir name
|
|
320 |
|
|
321 |
|
|
322 |
print "curr_dir = $curr_dir\n";
|
|
323 |
#Put the curr_dir to sdk.ini
|
|
324 |
my $TargetFile = "sdk.ini";
|
|
325 |
system ("perl -pi.old -e\"s/(StartDir\\s+=).*/StartDir = $curr_dir/;\" $TargetFile");
|
|
326 |
|
|
327 |
$TargetFile .= ".old";
|
|
328 |
system ("del /F $TargetFile");
|
|
329 |
}
|
|
330 |
1;
|