forked from adblockplus/buildtools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.rdf.tmpl
103 lines (92 loc) · 4 KB
/
install.rdf.tmpl
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
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
{%- macro meta() -%}
<em:creator>{{metadata.get('general', 'author')}}</em:creator>
{%- for contributor in contributors -%}
<em:contributor>{{contributor}}</em:contributor>
{%- endfor -%}
{%- endmacro %}
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>{{metadata.get('general', 'id')}}</em:id>
<em:version>{{version}}</em:version>
<em:name>{{localeMetadata[defaultLocale].name}}</em:name>
<em:description>{{localeMetadata[defaultLocale].description}}</em:description>
{{ meta() }}
{%- if metadata.has_option('homepage', 'default') %}
<em:homepageURL>{{metadata.get('homepage', 'default')}}</em:homepageURL>
{%- endif %}
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
{%- if not releaseBuild or metadata.has_option('general', 'updateURL') %}
<em:updateURL>
{{- metadata.get('general', 'updateURL') if releaseBuild else 'https://adblockplus.org/devbuilds/%s/update.rdf' % metadata.get('general', 'basename') -}}
{{- '?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%' -}}
</em:updateURL>
{%- endif %}
{%- if metadata.has_option('general', 'icon') %}
<em:iconURL>{{metadata.get('general', 'icon')}}</em:iconURL>
{%- endif %}
{%- if metadata.has_option('general', 'about') %}
<em:aboutURL>{{metadata.get('general', 'about')}}</em:aboutURL>
{%- endif %}
{%- if metadata.has_option('general', 'options') %}
<em:optionsURL>{{metadata.get('general', 'options')}}</em:optionsURL>
{%- endif %}
{%- if metadata.has_option('general', 'optionsType') %}
<em:optionsType>{{metadata.get('general', 'optionsType')}}</em:optionsType>
{%- endif %}
{%- for localeCode in localeMetadata.keys()|sort %}
{%- set locale = localeMetadata[localeCode] %}
<em:localized>
<Description>
<em:locale>{{localeCode}}</em:locale>
{{ meta() }}
<em:name>
{%- if 'name' in locale -%}
{{locale.name}}
{%- else -%}
{{localeMetadata[defaultLocale].name}}
{%- endif -%}
</em:name>
<em:description>
{%- if 'description' in locale -%}
{{locale.description}}
{%- else -%}
{{localeMetadata[defaultLocale].description}}
{%- endif -%}
</em:description>
{%- if metadata.has_option('homepage', 'default') %}
<em:homepageURL>
{%- if metadata.has_option('homepage', localeCode) -%}
{{- metadata.get('homepage', localeCode) -}}
{%- elif metadata.has_option('homepage', localeCode.split('-')[0]) -%}
{{- metadata.get('homepage', localeCode.split('-')[0]) -}}
{%- else -%}
{{- metadata.get('homepage', 'default') -}}
{%- endif -%}
</em:homepageURL>
{%- endif %}
{%- for translator in locale.translators %}
<em:translator>{{translator}}</em:translator>
{%- endfor %}
</Description>
</em:localized>
{%- endfor %}
{%- for appName in metadata.options('compat')|sort %}
{%- if appName in KNOWN_APPS %}
<em:targetApplication>
<Description>
<!-- {{appName}} -->
<em:id>{{KNOWN_APPS[appName]}}</em:id>
<em:minVersion>{{metadata.get('compat', appName).split('/')[0]}}</em:minVersion>
<em:maxVersion>{{metadata.get('compat', appName).split('/')[1]}}</em:maxVersion>
</Description>
</em:targetApplication>
{%- endif %}
{%- endfor %}
</Description>
</RDF>