Skip to content

Commit efb8c6c

Browse files
author
Ludovic Marcotte
committed
(feat) enabled custom builds, added sogo-demo as example and improved doc
1 parent 60b60c3 commit efb8c6c

File tree

5 files changed

+121
-28
lines changed

5 files changed

+121
-28
lines changed

Makefile

+35-22
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
PACKAGE = sogo-connector
22
GIT_REV = $(shell git rev-parse --verify HEAD | cut -c1-10)
33

4-
#ifeq ($(shell uname),Darwin)
5-
#VERSION = $(shell grep em:version install.rdf | sed -E 's@(em:version=|"| )@@g')
6-
#else
7-
#VERSION = $(shell grep em:version install.rdf | sed -e 's@\(em:version=\|\"\|\ \)@@g')
8-
#endif
9-
VERSION=68.0.0
4+
ifeq ($(shell uname),Darwin)
5+
VERSION = $(shell grep em:version install.rdf | sed -E 's@(em:version=|"| )@@g')
6+
else
7+
VERSION = $(shell grep em:version install.rdf | sed -e 's@\(em:version=\|\"\|\ \)@@g')
8+
endif
109

10+
FIND_FILTER = ! -path './custom/*' -type f
1111
XPI_ARCHIVE = $(PACKAGE)-$(VERSION)-$(GIT_REV).xpi
1212

1313
SHELL = /bin/bash
@@ -17,6 +17,16 @@ FILENAMES = $(shell cat MANIFEST)
1717

1818
all: MANIFEST-pre MANIFEST rest
1919

20+
custom-build:
21+
@if test "x$$build" == "x"; then \
22+
echo "Building package with default settings."; \
23+
else \
24+
echo "Building package with custom settings for '$$build'."; \
25+
if ! test -d custom/$$build; then \
26+
echo "Custom build '$$build' does not exist"; \
27+
exit 1; \
28+
fi; fi
29+
2030
MANIFEST: MANIFEST-pre
2131
@if ! cmp MANIFEST MANIFEST-pre >& /dev/null; then \
2232
mv -f MANIFEST-pre MANIFEST; \
@@ -26,25 +36,24 @@ MANIFEST: MANIFEST-pre
2636
fi;
2737

2838
MANIFEST-pre:
29-
# @echo install.rdf > $@
3039
@echo manifest.json > $@
3140
@echo COPYING >> $@
3241
@echo ChangeLog.old >> $@
33-
@find . -type f -name "*.manifest" >> $@
34-
@find . -type f -name "*.xul" >> $@
35-
@find . -type f -name "*.xml" >> $@
36-
@find . -type f -name "*.dtd" >> $@
37-
@find . -type f -name "*.idl" >> $@
38-
@find . -type f -name "*.js" >> $@
39-
@find . -type f -name "*.jsm" >> $@
40-
@find . -type f -name "*.css" >> $@
41-
@find . -type f -name "*.png" >> $@
42-
@find . -type f -name "*.gif" >> $@
43-
@find . -type f -name "*.jpg" >> $@
44-
@find . -type f -name "*.xpt" >> $@
45-
@find . -type f -name "*.properties" >> $@
46-
@find . -type f -name "*.rdf" >> $@
47-
@find . -type f -name "RELEASE-NOTES" >> $@
42+
@find . $(FIND_FILTER) -name "*.manifest" >> $@
43+
@find . $(FIND_FILTER) -name "*.xul" >> $@
44+
@find . $(FIND_FILTER) -name "*.xml" >> $@
45+
@find . $(FIND_FILTER) -name "*.dtd" >> $@
46+
@find . $(FIND_FILTER) -name "*.idl" >> $@
47+
@find . $(FIND_FILTER) -name "*.js" >> $@
48+
@find . $(FIND_FILTER) -name "*.jsm" >> $@
49+
@find . $(FIND_FILTER) -name "*.css" >> $@
50+
@find . $(FIND_FILTER) -name "*.png" >> $@
51+
@find . $(FIND_FILTER) -name "*.gif" >> $@
52+
@find . $(FIND_FILTER) -name "*.jpg" >> $@
53+
@find . $(FIND_FILTER) -name "*.xpt" >> $@
54+
@find . $(FIND_FILTER) -name "*.properties" >> $@
55+
@find . $(FIND_FILTER) -name "*.rdf" >> $@
56+
@find . $(FIND_FILTER) -name "RELEASE-NOTES" >> $@
4857

4958
rest: MANIFEST
5059
@+make $(XPI_ARCHIVE)
@@ -53,6 +62,10 @@ $(XPI_ARCHIVE): $(FILENAMES)
5362
@echo Generating $(XPI_ARCHIVE)...
5463
@rm -f $(XPI_ARCHIVE)
5564
@$(ZIP) -9r $(XPI_ARCHIVE) $(FILENAMES) > /dev/null
65+
@if test "x$$build" != "x"; then \
66+
cd custom/$$build; \
67+
$(ZIP) -9r ../../$(XPI_ARCHIVE) * > /dev/null; \
68+
fi
5669

5770
clean:
5871
rm -f MANIFEST-pre $(XPI_ARCHIVE)

README

+54-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
=====================================================
22
To package the extension
33
=====================================================
4-
edit <em:version> in install.rdf
5-
run make
4+
5+
First create a directory structure in custom/ that corresponds to your site
6+
name. Use "sogo-demo" as an example. You can do so by doing:
7+
8+
cp -a custom/sogo-demo custom/mysite
9+
10+
Then customize the following files:
11+
12+
custom/mysite/defaults/preferences/site.js
13+
custom/mysite/chrome/content/sogo-connector/global/extensions.rdf
14+
15+
If you want to force-push preferences upon each startup, modify:
16+
17+
custom/mysite//chrome/content/sogo-connector/general/custom-preferences.js
18+
19+
To build the extension, do:
20+
21+
% make distclean
22+
% make build=mysite
623

724
========================================================
825
Logging
@@ -11,8 +28,7 @@ run make
1128
For development enable debug messages
1229
-------------------------------------
1330

14-
Taken from:
15-
http://brainflush.wordpress.com/2008/01/17/mozilla-thunderbird-extension-development-environment-setup/
31+
Taken from: http://brainflush.wordpress.com/2008/01/17/mozilla-thunderbird-extension-development-environment-setup/
1632

1733
javascript.options.showInConsole = true.
1834
Logs errors in chrome files to the Error Console.
@@ -26,13 +42,18 @@ browser.dom.window.dump.enabled = true.
2642
javascript.options.strict = true.
2743
Enables strict JavaScript warnings in the Error Console. Note that since many people have this setting turned off when developing, you will see lots of warnings for problems with their code in addition to warnings for your own extension. You can filter those with Console2.
2844

45+
You can do so automatically by setting these preferences in site.js:
46+
47+
pref("javascript.options.showInConsole", true);
48+
pref("nglayout.debug.disable_xul_cache", true);
49+
pref("browser.dom.window.dump.enabled", true);
50+
pref("javascript.options.strict", true);
2951

3052

3153
Making the standard output console visible
3254
-------------------------------------------
3355

34-
Taken from:
35-
https://developer.mozilla.org/en-US/docs/DOM/window.dump?redirectlocale=en-US&redirectslug=DOM%3Awindow.dump
56+
Taken from: https://developer.mozilla.org/en-US/docs/DOM/window.dump?redirectlocale=en-US&redirectslug=DOM%3Awindow.dump
3657

3758
On Windows, you will need a console to actually see anything. If you don't have one already, closing the application and re-opening it with the command line parameter -console should create the console. On other operating systems, it's enough to launch the application from a terminal.
3859

@@ -67,3 +88,30 @@ Modifications to Lightning (such as methods overwrite) are done within
6788
// INVERSE - BEGIN
6889

6990
// INVERSE - END
91+
92+
93+
========================================================
94+
Migrating to Thunderbird v68
95+
========================================================
96+
97+
First of all, SOGo Integrator is no longer needed.
98+
99+
All SOGo Integrator preferences have been renamed to
100+
"sogo-connector". For example:
101+
102+
sogo-integrator.disable-calendaring
103+
104+
was renamed to:
105+
106+
sogo-connector.disable-calendaring
107+
108+
Here is the list of renamed preference keys:
109+
110+
sogo-integrator.autocomplete.server.urlid
111+
sogo-integrator.disable-calendaring
112+
sogo-integrator.disable-send-invitations-checkbox
113+
114+
115+
All SOGo Connector preferences:
116+
117+
sogo-connector.autoComplete.commentAttribute
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
force_int_pref("calendar.autorefresh.timeout", 30);
2+
force_int_pref("calendar.invitations.autorefresh.timeout", 30);
3+
force_bool_pref("sogo-connector.disable-send-invitations-checkbox", false);
4+
force_char_pref("sogo-connector.autoComplete.commentAttribute, "JobTitle");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE RDF>
3+
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4+
xmlns:isi="http://inverse.ca/sogo-connector/"
5+
xmlns:em="http://www.mozilla.org/2004/em-rdf#"
6+
xmlns:NC="http://home.netscape.com/NC-rdf#">
7+
<Seq about="http://inverse.ca/sogo-connector/extensions"
8+
isi:updateURL="http://sogo-demo.inverse.ca/plugins/updates.php?plugin=%ITEM_ID%&amp;version=%ITEM_VERSION%&amp;platform=%PLATFORM%">
9+
<li>
10+
<Description
11+
12+
em:name="SOGo Connector"/>
13+
</li>
14+
</Seq>
15+
</RDF>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
pref("app.update.auto", false);
2+
pref("app.update.enabled", false);
3+
pref("autoupdate.enabled", false);
4+
pref("extensions.update.auto", false);
5+
pref("extensions.update.enabled", false);
6+
pref("mail.imap.mime_parts_on_demand_threshold", 300000);
7+
pref("mail.inline_attachments", true);
8+
pref("mail.mdn.report.not_in_to_cc", 0);
9+
pref("mail.strictly_mime.parm_folding", 0);
10+
pref("calendar.alarms.showmissed", false);
11+
pref("calendar.caldav.sched.enabled", true);
12+
pref("calendar.timezone.local", "/mozilla.org/20070129_1/America/Montreal");
13+
pref("sogo-connector.autocomplete.server.urlid", "public");

0 commit comments

Comments
 (0)