Update contrib.
2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 # This component and the accompanying materials are made available
5 # under the terms of the License "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".
9 # Initial Contributors:
10 # Nokia Corporation - initial contribution.
18 open PIPE, "dir /b /ad \\ |";
23 unless (/^epoc32$/i) {
24 $dir="\\".$dir."\\*.bld";
31 foreach $dir (@rootdirs) {
33 open PIPE, "dir /s /b $dir 2>NUL |";
36 $bldfileprops{'fullname'}=lc $_;
39 $bldfileprops{'name'}=$name;
40 if (defined $bldfiles{$name}) {
41 die "Duplicate build file name $name\n";
43 $bldfiles{$name}=\%bldfileprops;
51 foreach $bld (keys %bldfiles) {
52 my $ref=$bldfiles{$bld};
53 my $filename=$$ref{'fullname'};
57 open FILE, $filename or die "Could not open file $filename\n";
61 } elsif (/^\<option/i) {
68 $$ref{'options'}=\@options;
69 $$ref{'components'}=\@components;
70 if (!$$ref{'explicit'}) {
73 if ($$ref{'compulsory'}) {
74 if ($$ref{'explicit'}) {
75 die "File $filename: can't be COMPULSORY and EXPLICIT\n";
77 push @compulsory, $bld;
84 my $nargs=scalar(@ARGV);
88 @todo_temp=@compulsory;
89 for ($i=0; $i<$nargs; ++$i) {
90 my $name=lc($ARGV[$i]);
92 foreach $bld (@defaults) {
93 push @todo_temp, $bld if (!grep {$bld eq $_} @todo_temp);
95 } elsif ($name=~/^\-(\w+)$/) {
96 if (defined $bldfiles{$1}) {
97 my $ref=$bldfiles{$1};
98 if ($$ref{'compulsory'}) {
99 die "Cannot omit $1\n";
101 push @omit, $1 if (!grep {$1 eq $_} @omit);
103 die "Unrecognised build $1\n";
105 } elsif (defined $bldfiles{$name}) {
106 push @todo_temp, $name if (!grep {$name eq $_} @todo_temp);
108 die "Unrecognised build $name\n";
113 #print join "\n",@todo_temp;
117 foreach $bld (@todo_temp) {
118 push @todo, $bld if (!grep {$bld eq $_} @omit);
121 #print join "\n",@todo;
127 foreach $bld (@todo) {
128 my $ref=$bldfiles{$bld};
129 next if ($nargs==0 && $$ref{'explicit'});
130 ++$nvariants if (!$$ref{'incremental'});
131 my $optref=$$ref{'options'};
132 my $compref=$$ref{'components'};
135 foreach $option (@$optref) {
137 if (!grep {$_ eq $option} @output1) {
138 push @output1, $option;
141 foreach $component (@$compref) {
142 $component=~s/\s+/ /;
143 if (!grep {$_ eq $component} @output2) {
144 push @output2, $component;
150 die "No variants specified for building\n";
153 @output1=sort @output1;
154 @output2=sort @output2;