author | royt <tathagatar@symbian.org> |
Mon, 14 Sep 2009 15:43:37 +0100 | |
changeset 449 | 0b42c6ee533c |
parent 388 | 2ab990de5a23 |
child 455 | bb24766fdbdc |
permissions | -rw-r--r-- |
108 | 1 |
#!perl -w |
2 |
# Copyright (c) 2009 Symbian Foundation Ltd |
|
3 |
# This component and the accompanying materials are made available |
|
4 |
# under the terms of the License "Eclipse Public License v1.0" |
|
5 |
# which accompanies this distribution, and is available |
|
6 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
# |
|
8 |
# Initial Contributors: |
|
9 |
# Symbian Foundation Ltd - initial contribution. |
|
10 |
# |
|
11 |
# Contributors: |
|
12 |
# |
|
13 |
# Description: |
|
14 |
# Populates the template for packaging src and binaries in the build |
|
15 |
||
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
16 |
use strict; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
17 |
|
89
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
88
diff
changeset
|
18 |
use FindBin; |
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
88
diff
changeset
|
19 |
use lib "$FindBin::Bin/lib"; |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
20 |
use Text::CSV; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
21 |
require XML::Simple; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
22 |
|
84
fcf94a72b33e
Improved zip template generation script, to take a third argument for the required location of the output file.
Simon Howkins <simonh@symbian.org>
parents:
76
diff
changeset
|
23 |
# Raw inputs come in as parameters to the script |
fcf94a72b33e
Improved zip template generation script, to take a third argument for the required location of the output file.
Simon Howkins <simonh@symbian.org>
parents:
76
diff
changeset
|
24 |
# TODO: Use a proper option parsing module |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
25 |
my $sourcesCSV = shift or die "First arg must be source csv file"; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
26 |
my $template = shift or die "Second arg must be template file"; |
84
fcf94a72b33e
Improved zip template generation script, to take a third argument for the required location of the output file.
Simon Howkins <simonh@symbian.org>
parents:
76
diff
changeset
|
27 |
my $ftl = shift or die "Third arg must be output file"; |
247
cfde8b1784f7
Simplified the locations of some generated files, so they are created where they need to be rather than created on one place and moved to another.
Simon Howkins <simonh@symbian.org>
parents:
111
diff
changeset
|
28 |
my $rndExcludes = shift or die "Fourth arg must be rnd-excludes file"; |
313
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
29 |
my $nosource = shift; |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
30 |
if(defined $nosource && $nosource !~ m/--nosource/i) |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
31 |
{ |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
32 |
die "fifth argument can only be \'--nosource\'"; |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
33 |
} |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
34 |
|
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
35 |
# Load CSV |
380
d4dac57985d9
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
372
diff
changeset
|
36 |
open my $csvText, "<", $sourcesCSV or die "Unable to open sources.csv from $sourcesCSV"; |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
37 |
my $csv = Text::CSV->new(); |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
38 |
my @keys; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
39 |
my @packages; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
40 |
while (my $line = <$csvText>) |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
41 |
{ |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
42 |
chomp $line; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
43 |
next unless $line; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
44 |
unless ($csv->parse($line)) |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
45 |
{ |
89
a8aa5d600806
Copy Text::CSV module into source and change to use it, as we can't rely on it appearing in the Perl library when Perl 5.6.1 is installed.
Simon Howkins <simonh@symbian.org>
parents:
88
diff
changeset
|
46 |
my $err = $csv->error_input(); |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
47 |
die "Failed to parse line '$line': $err"; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
48 |
} |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
49 |
|
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
50 |
if (! @keys) |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
51 |
{ |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
52 |
# First line - note the column names |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
53 |
@keys = $csv->fields(); |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
54 |
} |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
55 |
else |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
56 |
{ |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
57 |
# Already got the keys, so get the data |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
58 |
my %package; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
59 |
# Read into a hash slice |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
60 |
@package{@keys} = $csv->fields(); |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
61 |
push @packages, \%package; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
62 |
} |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
63 |
} |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
64 |
close $csvText; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
65 |
|
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
66 |
# This controls how the XML parsing decides what should be tags and what should be attributes |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
67 |
# It's been worked out mostly by trial and error :-( |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
68 |
my $keyAttr = { config => "name", name => "set"}; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
69 |
# Load template |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
70 |
my $xml = XML::Simple->new(); |
372
ea854a4b723d
Bug 289 Issue in populatezip.pl when doing Platform build in step preprocess-zip-config
Simon Howkins <simonh@symbian.org>
parents:
313
diff
changeset
|
71 |
my $zipConfig = $xml->XMLin($template, keyattr => $keyAttr); |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
72 |
my @allRndFiles; |
388
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
73 |
my $miscCount = 0; |
380
d4dac57985d9
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
372
diff
changeset
|
74 |
|
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
75 |
# For each package in CSV... |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
76 |
foreach my $package (@packages) |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
77 |
{ |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
78 |
warn "Warning: Package $package->{dst} does not appear on the local system\n" unless -d $package->{dst}; |
76
a115d49b621f
Include epl/sfl category in zipfile name
Shabe Razvi <shaber@symbian.org>
parents:
73
diff
changeset
|
79 |
$package->{dst} =~ s{^/}{}g; |
102
c2478fad90aa
Fix populateziptemplate.pl to work with new repo structure
Shabe Razvi <shaber@symbian.org>
parents:
94
diff
changeset
|
80 |
if ($package->{source} =~ m{/(sfl|oss)/(MCL|FCL)/sf/([^/]+)/([^/]+)}) |
313
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
81 |
{ |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
82 |
if(!defined $nosource) |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
83 |
{ |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
84 |
push @{$zipConfig->{config}->{config}->{src}->{config}->{$1}->{config}}, |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
85 |
{ |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
86 |
set => |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
87 |
[ |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
88 |
{ |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
89 |
name => "name", |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
90 |
value=> "src_$1_$3_$4", |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
91 |
}, |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
92 |
{ |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
93 |
name => "include", |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
94 |
value => "$package->{dst}/**", |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
95 |
}, |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
96 |
] |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
97 |
}; |
52d855dfda13
Changed 'publish' to 'sf-publish' to only publish the zips, not all logs. Changed behaviour so that 'sf.spec.package.src.enable'=false stops the source repos from getting packaged, but not the RnD ones (which are extracted again in platform builds)
MattD <mattd@symbian.org>
parents:
261
diff
changeset
|
98 |
} |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
99 |
} |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
100 |
elsif ($package->{source} =~ m{/rnd/([^/]+)/([^/]+)}) |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
101 |
{ |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
102 |
# RnD repository |
261
a0e85954c23c
Fix packaging issues. Released zips now delivered in zips\release folder.
Shabe Razvi <shaber@symbian.org>
parents:
247
diff
changeset
|
103 |
my $name = "binaries_$2"; |
a0e85954c23c
Fix packaging issues. Released zips now delivered in zips\release folder.
Shabe Razvi <shaber@symbian.org>
parents:
247
diff
changeset
|
104 |
if ($1 eq "rndonly") { $name="bin_$1_$2";} |
a0e85954c23c
Fix packaging issues. Released zips now delivered in zips\release folder.
Shabe Razvi <shaber@symbian.org>
parents:
247
diff
changeset
|
105 |
|
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
106 |
# Create a zip object |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
107 |
push @{$zipConfig->{config}->{config}->{src}->{config}->{rnd}->{config}}, |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
108 |
{ |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
109 |
set => |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
110 |
[ |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
111 |
{ |
88
28463bb10fde
Package RnD binaries from rnd root location to reduce size of include list
Shabe Razvi <shaber@symbian.org>
parents:
84
diff
changeset
|
112 |
name => "root.dir", |
28463bb10fde
Package RnD binaries from rnd root location to reduce size of include list
Shabe Razvi <shaber@symbian.org>
parents:
84
diff
changeset
|
113 |
value=> "\${build.drive}/$package->{dst}", |
28463bb10fde
Package RnD binaries from rnd root location to reduce size of include list
Shabe Razvi <shaber@symbian.org>
parents:
84
diff
changeset
|
114 |
}, |
28463bb10fde
Package RnD binaries from rnd root location to reduce size of include list
Shabe Razvi <shaber@symbian.org>
parents:
84
diff
changeset
|
115 |
{ |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
116 |
name => "name", |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
117 |
value=> "$name", |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
118 |
}, |
88
28463bb10fde
Package RnD binaries from rnd root location to reduce size of include list
Shabe Razvi <shaber@symbian.org>
parents:
84
diff
changeset
|
119 |
{ |
28463bb10fde
Package RnD binaries from rnd root location to reduce size of include list
Shabe Razvi <shaber@symbian.org>
parents:
84
diff
changeset
|
120 |
name => "include", |
28463bb10fde
Package RnD binaries from rnd root location to reduce size of include list
Shabe Razvi <shaber@symbian.org>
parents:
84
diff
changeset
|
121 |
value=> "/**", |
28463bb10fde
Package RnD binaries from rnd root location to reduce size of include list
Shabe Razvi <shaber@symbian.org>
parents:
84
diff
changeset
|
122 |
}, |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
123 |
] |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
124 |
}; |
90
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
125 |
# Enumerate all the files on the local disk that are in this repository |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
126 |
(my $dosCompatibleDst = $package->{dst}) =~ s{/}{\\}g; |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
127 |
my @files = `dir /b/s/a-d $dosCompatibleDst 2> nul:`; |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
128 |
#print "@files\n"; |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
129 |
next unless @files; |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
130 |
# Add the files to this zip object |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
131 |
@files = grep { |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
132 |
s{\\}{/}g; |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
133 |
s!^[A-Z]:/$package->{dst}/!!i; |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
134 |
m{^epoc32/}i; |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
135 |
} @files; |
5b27412eeaf0
Removed obsolete variable (@includes).
Simon Howkins <simonh@symbian.org>
parents:
89
diff
changeset
|
136 |
push @allRndFiles, @files; |
111
5b0bc2f89660
Add postbuild RnD packaging. Add .whatlog to os tools build.
Shabe Razvi <shaber@symbian.org>
parents:
108
diff
changeset
|
137 |
|
5b0bc2f89660
Add postbuild RnD packaging. Add .whatlog to os tools build.
Shabe Razvi <shaber@symbian.org>
parents:
108
diff
changeset
|
138 |
open FILE, ">", $name ."_includefile.txt" or die "Cannot write includefile!"; |
5b0bc2f89660
Add postbuild RnD packaging. Add .whatlog to os tools build.
Shabe Razvi <shaber@symbian.org>
parents:
108
diff
changeset
|
139 |
print FILE @files; |
5b0bc2f89660
Add postbuild RnD packaging. Add .whatlog to os tools build.
Shabe Razvi <shaber@symbian.org>
parents:
108
diff
changeset
|
140 |
close FILE; |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
141 |
} |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
142 |
else |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
143 |
{ |
388
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
144 |
(my $dest2 = $package->{dst}) =~ s{[\\/]}{_slash_}g; |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
145 |
push @{$zipConfig->{config}->{config}->{src}->{config}->{misc}->{config}}, |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
146 |
{ |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
147 |
set => |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
148 |
[ |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
149 |
{ |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
150 |
name => "name", |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
151 |
value=> "src_misc_$dest2"."_$miscCount", |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
152 |
}, |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
153 |
{ |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
154 |
name => "include", |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
155 |
value => "$package->{dst}/**", |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
156 |
}, |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
157 |
] |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
158 |
}; |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
159 |
$miscCount++; |
2ab990de5a23
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
380
diff
changeset
|
160 |
warn "Warning: Cannot determine license for '$package->{source}' - it will be packaged as 'src_misc_$dest2"."_$miscCount'\n"; |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
161 |
} |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
162 |
} |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
163 |
|
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
164 |
# Turn the RnD source inclusion lists into a binary exclusion list |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
165 |
my @excludes = map { {name => "exclude", value => "$_"} } @allRndFiles; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
166 |
push @{$zipConfig->{config}->{config}->{bin}->{config}->{set}}, @excludes; |
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
167 |
|
372
ea854a4b723d
Bug 289 Issue in populatezip.pl when doing Platform build in step preprocess-zip-config
Simon Howkins <simonh@symbian.org>
parents:
313
diff
changeset
|
168 |
$xml->XMLout($zipConfig, OutputFile => $ftl, XMLDecl => 1, RootName => 'build', keyattr => $keyAttr); |
73
b8d6af733d6d
Add first cut of packaging solution
Shabe Razvi <shaber@symbian.org>
parents:
diff
changeset
|
169 |
|
111
5b0bc2f89660
Add postbuild RnD packaging. Add .whatlog to os tools build.
Shabe Razvi <shaber@symbian.org>
parents:
108
diff
changeset
|
170 |
# Output all rnd files into exclude list for later |
247
cfde8b1784f7
Simplified the locations of some generated files, so they are created where they need to be rather than created on one place and moved to another.
Simon Howkins <simonh@symbian.org>
parents:
111
diff
changeset
|
171 |
open my $fh, ">", $rndExcludes or die "Cannot write exlude file!"; |
cfde8b1784f7
Simplified the locations of some generated files, so they are created where they need to be rather than created on one place and moved to another.
Simon Howkins <simonh@symbian.org>
parents:
111
diff
changeset
|
172 |
print $fh @allRndFiles; |
cfde8b1784f7
Simplified the locations of some generated files, so they are created where they need to be rather than created on one place and moved to another.
Simon Howkins <simonh@symbian.org>
parents:
111
diff
changeset
|
173 |
close $fh; |
380
d4dac57985d9
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Simon Howkins <simonh@symbian.org>
parents:
372
diff
changeset
|
174 |