Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 {%- macro str_or_real(value) -%} | |
2 {%- if value is number -%} | |
3 <real>{{ value }}</real> | |
4 {%- else -%} | |
5 <string>{{ value }}</string> | |
6 {%- endif -%} | |
7 {%- endmacro -%} | |
8 | |
1 <?xml version="1.0" encoding="UTF-8"?> | 9 <?xml version="1.0" encoding="UTF-8"?> |
2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/ PropertyList-1.0.dtd"> | 10 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/ PropertyList-1.0.dtd"> |
3 <plist version="1.0"> | 11 <plist version="1.0"> |
4 <dict> | 12 <dict> |
5 » <key>CFBundleDisplayName</key> | 13 <key>CFBundleDisplayName</key> |
Wladimir Palant
2013/09/10 10:15:27
Nit: We generally use two spaces for indentation,
| |
6 » <string>{{ name }}</string> | 14 <string>{{ name }}</string> |
7 » <key>CFBundleIdentifier</key> | 15 <key>CFBundleIdentifier</key> |
8 » <string>{{ identifier }}</string> | 16 <string>org.adblockplus.{{ basename }}</string> |
Wladimir Palant
2013/09/10 10:15:27
I suggest generating the identifier automatically
Sebastian Noack
2013/09/10 12:40:43
I assumed that the templates (or buildtools in gen
Wladimir Palant
2013/09/10 14:02:12
Well, we hardcode the devbuild URLs already so the
| |
9 » <key>CFBundleInfoDictionaryVersion</key> | 17 <key>CFBundleInfoDictionaryVersion</key> |
10 » <string>6.0</string> | 18 <string>6.0</string> |
11 » <key>CFBundleShortVersionString</key> | 19 <key>CFBundleShortVersionString</key> |
12 » <string>{{ version }}</string> | 20 <string>{{ shortVersion }}</string> |
Wladimir Palant
2013/09/10 10:15:27
According to Apple documentation we shouldn't be u
| |
13 » <key>CFBundleVersion</key> | 21 <key>CFBundleVersion</key> |
14 » <string>{{ version }}</string> | 22 <string>{{ version }}</string> |
15 » <key>Chrome</key> | 23 <key>Chrome</key> |
16 » <dict> | 24 <dict> |
17 » » <key>Database Quota</key> | 25 <key>Database Quota</key> |
18 » » <real>104857600</real> | 26 <real>104857600</real> |
19 » » <key>Global Page</key> | 27 <key>Global Page</key> |
20 » » <string>background.html</string> | 28 <string>background.html</string> |
21 {%- if menus %} | 29 {%- if menus %} |
22 » » <key>Menus</key> | 30 <key>Menus</key> |
23 » » <array> | 31 <array> |
24 {%- for identifier, items in menus.iteritems() %} | 32 {%- for identifier, items in menus.iteritems() %} |
25 » » » <dict> | 33 <dict> |
26 » » » » <key>Identifier</key> | 34 <key>Identifier</key> |
27 » » » » <string>{{ identifier }}</string> | 35 <string>{{ identifier }}</string> |
28 » » » » <key>Menu Items</key> | 36 <key>Menu Items</key> |
29 » » » » <array> | 37 <array> |
30 {%- for identifier, props in items.iteritems() %} | 38 {%- for identifier, props in items.iteritems() %} |
31 » » » » » <dict> | 39 <dict> |
32 » » » » » » <key>Identifier</key> | 40 <key>Identifier</key> |
33 » » » » » » <string>{{ identifier }}</string > | 41 <string>{{ identifier }}</string> |
34 {%- for key, value in props.iteritems() %} | 42 {%- for key, value in props.iteritems() %} |
35 » » » » » » <key>{{ key }}</key> | 43 <key>{{ key }}</key> |
36 » » » » » » {{ value }} | 44 {{ str_or_real(value) }} |
37 {%- endfor %} | 45 {%- endfor %} |
38 » » » » » </dict> | 46 </dict> |
39 {%- endfor %} | 47 {%- endfor %} |
40 » » » » </array> | 48 </array> |
41 » » » </dict> | 49 </dict> |
42 {%- endfor %} | 50 {%- endfor %} |
43 » » </array> | 51 </array> |
44 {%- endif %} | 52 {%- endif %} |
45 {%- if popovers %} | 53 {%- if popovers %} |
46 » » <key>Popovers</key> | 54 <key>Popovers</key> |
47 » » <array> | 55 <array> |
48 {%- for identifier, props in popovers.iteritems() %} | 56 {%- for identifier, props in popovers.iteritems() %} |
49 » » » <dict> | 57 <dict> |
50 » » » » <key>Identifier</key> | 58 <key>Identifier</key> |
51 » » » » <string>{{ identifier }}</string> | 59 <string>{{ identifier }}</string> |
52 {%- for key, value in props.iteritems() %} | 60 {%- for key, value in props.iteritems() %} |
53 » » » » <key>{{ key }}</key> | 61 <key>{{ key }}</key> |
54 » » » » {{ value }} | 62 {{ str_or_real(value) }} |
55 {%- endfor %} | 63 {%- endfor %} |
56 » » » </dict> | 64 </dict> |
57 {%- endfor %} | 65 {%- endfor %} |
58 » » </array> | 66 </array> |
59 {%- endif %} | 67 {%- endif %} |
60 {%- if toolbarItems %} | 68 {%- if toolbarItems %} |
61 » » <key>Toolbar Items</key> | 69 <key>Toolbar Items</key> |
62 » » <array> | 70 <array> |
63 {%- for identifier, props in toolbarItems.iteritems() %} | 71 {%- for identifier, props in toolbarItems.iteritems() %} |
64 » » » <dict> | 72 <dict> |
65 » » » » <key>Identifier</key> | 73 <key>Identifier</key> |
66 » » » » <string>{{ identifier }}</string> | 74 <string>{{ identifier }}</string> |
67 {%- for key, value in props.iteritems() %} | 75 {%- for key, value in props.iteritems() %} |
Wladimir Palant
2013/09/10 10:15:27
Having Jinja tags unindented makes the whole thing
| |
68 » » » » <key>{{ key }}</key> | 76 <key>{{ key }}</key> |
69 » » » » {{ value }} | 77 {{ str_or_real(value) }} |
70 {%- endfor %} | 78 {%- endfor %} |
71 » » » </dict> | 79 </dict> |
72 {%- endfor %} | 80 {%- endfor %} |
73 » » </array> | 81 </array> |
74 {%- endif %} | 82 {%- endif %} |
75 » </dict> | 83 </dict> |
76 » <key>Content</key> | 84 {%- if startScripts or endScripts %} |
77 » <dict> | 85 <key>Content</key> |
78 » » <key>Scripts</key> | 86 <dict> |
79 » » <dict> | 87 <key>Scripts</key> |
80 » » » <key>End</key> | 88 <dict> |
81 » » » <array> | 89 {%- if startScripts %} |
82 {%- for script in contentScripts.end %} | 90 <key>Start</key> |
83 » » » » <string>{{ script }}</string> | 91 <array> |
84 {%- endfor %} | 92 {%- for script in startScripts %} |
85 » » » </array> | 93 <string>{{ script }}</string> |
86 » » » <key>Start</key> | 94 {%- endfor %} |
87 » » » <array> | 95 </array> |
88 {%- for script in contentScripts.start %} | 96 {%- endif %} |
89 » » » » <string>{{ script }}</string> | 97 {%- if endScripts %} |
90 {%- endfor %} | 98 <key>End</key> |
91 » » » </array> | 99 <array> |
92 » » </dict> | 100 {%- for script in endScripts %} |
93 » </dict> | 101 <string>{{ script }}</string> |
94 » <key>ExtensionInfoDictionaryVersion</key> | 102 {%- endfor %} |
95 » <string>1.0</string> | 103 </array> |
96 » <key>Permissions</key> | 104 {%- endif %} |
97 » <dict> | 105 </dict> |
98 » » <key>Website Access</key> | 106 </dict> |
99 » » <dict> | 107 {%- endif %} |
100 {%- if allowedDomains and not allowAllDomains %} | 108 <key>ExtensionInfoDictionaryVersion</key> |
101 » » » <key>Allowed Domains</key> | 109 <string>1.0</string> |
102 » » » <array> | 110 <key>Permissions</key> |
103 {%- for domain in allowedDomains %} | 111 <dict> |
104 » » » » <string>{{ domain }}</string> | 112 <key>Website Access</key> |
105 {%- endfor %} | 113 <dict> |
106 » » » </array> | 114 {%- if allowedDomains and not allowAllDomains %} |
107 {%- endif %} | 115 <key>Allowed Domains</key> |
108 » » » <key>Include Secure Pages</key> | 116 <array> |
109 {%- if allowSecurePages %} | 117 {%- for domain in allowedDomains %} |
110 » » » <true/> | 118 <string>{{ domain }}</string> |
111 {%- else %} | 119 {%- endfor %} |
112 » » » <false/> | 120 </array> |
113 {%- endif %} | 121 {%- endif %} |
114 » » » <key>Level</key> | 122 <key>Include Secure Pages</key> |
115 {%- if allowAllDomains %} | 123 {%- if allowSecurePages %} |
116 » » » <string>All</string> | 124 <true/> |
117 {%- elif allowedDomains %} | 125 {%- else %} |
118 » » » <string>Some</string> | 126 <false/> |
119 {%- else %} | 127 {%- endif %} |
120 » » » <string>None</string> | 128 <key>Level</key> |
121 {%- endif %} | 129 {%- if allowAllDomains %} |
122 » » </dict> | 130 <string>All</string> |
123 » </dict> | 131 {%- elif allowedDomains %} |
124 » <key>Description</key> | 132 <string>Some</string> |
125 » <string>{{ description }}</string> | 133 {%- else %} |
126 {%- if author %} | 134 <string>None</string> |
127 » <key>Author</key> | 135 {%- endif %} |
128 » <string>{{ author }}</string> | 136 </dict> |
129 {%- endif %} | 137 </dict> |
130 {%- if website %} | 138 <key>Description</key> |
131 » <key>Website</key> | 139 <string>{{ description }}</string> |
132 » <string>{{ website }}</string> | 140 {%- if author %} |
133 {%- endif %} | 141 <key>Author</key> |
134 {%- if updateURL %} | 142 <string>{{ author }}</string> |
135 » <key>Update Manifest URL</key> | 143 {%- endif %} |
136 » <string>{{ updateURL }}</string> | 144 {%- if homepage %} |
137 {%- endif %} | 145 <key>Website</key> |
Wladimir Palant
2013/09/10 10:15:27
There should always be an update URL for developme
| |
146 <string>{{ homepage }}</string> | |
147 {%- endif %} | |
148 {%- if not releaseBuild or updateURL %} | |
149 <key>Update Manifest URL</key> | |
150 <string> | |
151 {%- if not releaseBuild -%} | |
152 https://adblockplus.org/devbuilds/{{ basename }}/updates.plist | |
153 {%- else -%} | |
154 {{ updateURL }} | |
155 {%- endif -%} | |
156 </string> | |
157 {%- endif %} | |
138 </dict> | 158 </dict> |
139 </plist> | 159 </plist> |
LEFT | RIGHT |