This repository has been archived by the owner on Oct 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
build.py
117 lines (91 loc) · 3.8 KB
/
build.py
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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/.
import build_tools
import sys
if len(sys.argv) > 1:
changeset = sys.argv[1]
else:
changeset = None
b = build_tools.BuildExtension("src", "build")
b.add_binary("icon.png")
b.add_binary("content/favicon.ico")
b.add_binary("content/icon.png")
b.add_binary("content/logo-about.png")
b.add_text("install.rdf")
b.add_text("chrome.manifest")
b.add_text("bootstrap.js")
b.add_text("options.xul")
b.add_text("content/about-multifox.html")
b.add_text("content/about-multifox.js")
b.add_text("content/button.css")
b.add_text("modules/new-window.js")
b.add_text("modules/main.js")
b.add_text("modules/menus.js")
b.add_text("modules/commands.js")
b.add_locale("en-US")
b.add_locale("de")
b.add_locale("pl")
b.add_locale("pt-BR")
b.add_locale("ru")
b.add_locale("sr")
b.add_locale("sv-SE")
b.add_locale("zh-CN")
b.add_locale("zh-TW")
b.add_text("locale/${locale}/options.dtd")
b.add_text("locale/${locale}/extension.properties")
b.add_text("locale/${locale}/about-multifox.properties")
b.set_var("EXT_VERSION", "3.2.3")
verEx = build_tools.getVersionedString(changeset, b.get_var("EXT_VERSION"))
if changeset == None:
b.set_var("SOURCE_URL", "https://github.com/hultmann/multifox/tree/master/src")
b.set_var("EXT_VERSION", verEx)
else:
b.set_var("SOURCE_URL", "https://github.com/hultmann/multifox/tree/" + changeset)
b.set_var("EXT_ID", "multifox@hultmann")
b.set_var("EXT_NAME", "Multifox")
b.set_var("EXT_SITE", "https://addons.mozilla.org/firefox/addon/multifox/")
b.set_var("URL_CONTACT", "https://github.com/hultmann/multifox/issues")
b.set_var("APP_MIN_VERSION", "47.0")
b.set_var("APP_MAX_VERSION", "49.*")
b.set_var("CHROME_NAME", "multifox")
b.set_var("EXT_HOST", "multifox-" + verEx)
b.set_var("PATH_CONTENT", "chrome://" + b.get_var("EXT_HOST") + "/content")
b.set_var("PATH_LOCALE", "chrome://" + b.get_var("EXT_HOST") + "/locale")
b.set_var("PATH_MODULE", "resource://" + b.get_var("EXT_HOST"))
b.set_var("BASE_DOM_ID", "multifox-dom")
b.set_var("PROFILE_SESSION", "multifox-dom-identity-id-session")
b.set_var("PROFILE_BROWSER_ATTR", "multifox-dom-identity-id-browser")
b.set_var("PROFILE_DISABLED_ATTR", "multifox-dom-identity-id-disabled")
b.set_var("PROFILE_DEPRECATED_DISABLED", "multifox-dom-identity-id-tmp")
b.set_var("PROFILE_DEPRECATED_SESSION", "multifox-dom-identity-id")
b.set_var("XPCOM_ABOUT_CLASS", "{347c41b6-1417-411c-b87a-422bcfc1899a}")
b.set_var("XPCOM_ABOUT_CONTRACT", "@mozilla.org/network/protocol/about;1?what=multifox")
xpi = b.get_var("CHROME_NAME") + "-" + b.get_var("EXT_VERSION")
b.copy_files()
# AMO
b.set_var("UPDATE_DATA", "")
b.build_xpi(xpi + ".xpi")
# website
b.set_var("UPDATE_DATA", (
" <em:updateURL><![CDATA[https://getmultifox.com/update/"
"?reqVersion=%REQ_VERSION%"
"&extId=%ITEM_ID%"
"&extVersion=%ITEM_VERSION%"
"&extMaxappversion=%ITEM_MAXAPPVERSION%"
"&extStatus=%ITEM_STATUS%"
"&appId=%APP_ID%"
"&appVersion=%APP_VERSION%"
"&appOs=%APP_OS%"
"&appAbi=%APP_ABI%"
"&appLocale=%APP_LOCALE%]]>"
"</em:updateURL>\n"
" <em:updateKey>\n"
" MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDeQmBgnA27cxcxXMlSA4QGaY41UKOXi8Ps\n"
" J6IitDvvXsp9ZTzjdwDIdvJ7oB9dyycXlHZL9tKcatOwhXbUN0jt28hv8sYGxlj2oxIt5sOQ\n"
" C0q/P2KHU5OAHMl/eRJIe8QINCBGI5CEr84ArnhJ7g+DYOFQfVtop3sNBYI78nEQ2wIDAQAB\n"
" </em:updateKey>\n"))
b.build_xpi(xpi + "-with-update-url.xpi")
b.create_update_rdf(xpi + ".xpi")