author | MattD <mattd@symbian.org> |
Fri, 09 Oct 2009 17:03:29 +0100 | |
changeset 638 | 84fc7d5ec18f |
parent 601 | 3489a650c6fa |
child 693 | 9f583ada8e4e |
permissions | -rw-r--r-- |
601
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
1 |
#! perl -w |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
2 |
# Copyright (c) 2009 Symbian Foundation Ltd |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
3 |
# This component and the accompanying materials are made available |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
4 |
# under the terms of the License "Eclipse Public License v1.0" |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
5 |
# which accompanies this distribution, and is available |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
6 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
7 |
# |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
8 |
# Initial Contributors: |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
9 |
# Symbian Foundation Ltd - initial contribution. |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
10 |
# |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
11 |
# Contributors: |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
12 |
# |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
13 |
# Description: |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
14 |
# Generate an XML file in the Diamonds format to upload build tags to Diamonds |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
15 |
|
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
16 |
use strict; |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
17 |
|
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
18 |
use Getopt::Long; |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
19 |
|
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
20 |
my $taglist = 0; |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
21 |
my $outputfile = 0; |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
22 |
my $help = 0; |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
23 |
GetOptions(( |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
24 |
'tags:s' => \$taglist, |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
25 |
'output:s' => \$outputfile, |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
26 |
'help!' => \$help, |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
27 |
)); |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
28 |
|
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
29 |
if ($help or !$outputfile) |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
30 |
{ |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
31 |
print "Usage: perl generate_diamonds_tags_xml.pl --tags COMMA_SEPARATED_TAG_LIST --output OUTPUT_FILE\n"; |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
32 |
} |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
33 |
|
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
34 |
open(FILE, ">$outputfile"); |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
35 |
|
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
36 |
print FILE <<_END_HEADER; |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
37 |
<?xml version=\"1.0\" encoding=\"utf-8\"?> |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
38 |
<diamonds-build> |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
39 |
<schema>13</schema> |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
40 |
<tags> |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
41 |
_END_HEADER |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
42 |
|
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
43 |
my @tags = split(/,/, $taglist); |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
44 |
for (@tags) |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
45 |
{ |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
46 |
print FILE " <tag>$_</tag>\n"; |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
47 |
} |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
48 |
|
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
49 |
print FILE <<_END_TRAILER; |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
50 |
</tags> |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
51 |
</diamonds-build> |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
52 |
_END_TRAILER |
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
53 |
|
3489a650c6fa
Upload codeline and sf.spec.diamonds.tag as Diamonds tags
Dario Sestito <darios@symbian.org>
parents:
diff
changeset
|
54 |
close(FILE); |