Merge lp:~dpm/reminders-app/account-click into lp:reminders-app

Proposed by David Planella on 2014-08-14
Status: Merged
Approved by: Nicholas Skaggs on 2014-10-02
Approved revision: 238
Merged at revision: 261
Proposed branch: lp:~dpm/reminders-app/account-click
Merge into: lp:reminders-app
Diff against target: 429 lines (+114/-107)
13 files modified
CMakeLists.txt (+12/-0)
com.ubuntu.reminders_reminders.application.in (+2/-2)
debian/account-plugin-evernote-sandbox.install (+2/-2)
debian/account-plugin-evernote.install (+2/-2)
debian/control (+13/-13)
debian/reminders-app-autopilot.install (+1/-1)
debian/rules (+0/-4)
manifest.json.in (+19/-6)
src/CMakeLists.txt (+0/-2)
src/account-plugin/CMakeLists.txt (+53/-69)
src/app/qml/reminders.qml (+2/-2)
tests/autopilot/reminders/credentials.py (+4/-2)
tests/autopilot/reminders/tests/test_credentials.py (+4/-2)
To merge this branch: bzr merge lp:~dpm/reminders-app/account-click
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2014-10-01
Nicholas Skaggs (community) Needs Fixing on 2014-10-01
Michael Zanetti (community) code review 2014-08-14 Approve on 2014-10-01
Chris Wayne 2014-08-14 Approve on 2014-09-12
Alberto Mardegan (community) 2014-08-14 Approve on 2014-09-12
Review via email: mp+230768@code.launchpad.net

Commit message

Move the account plugin to the click package

Description of the change

Now that there is support for account plugins as click packages, I'd like to move away from the .deb package the app requires on the phone to have a self-contained click package that contains the app and the account plugin.

This will allow us as well to replace the Evernote API key behind Jenkins, while we can leave the current one in the code.

# Notes

- The click reviewers tools show validation errors: bug 1357211
- Click package available for testing at: http://people.canonical.com/~dpm/click/com.ubuntu.reminders_0.5.230_armhf.click
- The layout of the click package is as follows: http://pastebin.ubuntu.com/8044356/ - I'm not too sure about where the authentication plugin expects the account icon to be
- The layout of the installed click package: http://pastebin.ubuntu.com/8044350/
- The upload to the store should be coordinated with the removal of the Evernote account plugin from the seeds

To post a comment you must log in.
Chris Wayne (cwayne18) wrote :

IIRC the .service file should actually technically be included in the app itself, rather than the account-plugin click. I'm not sure how much it matters since it's all 1 click package, but it may still be a good thing to change

I tested this out on device and had an error. Talking to Mardy, he suggested:-

14:53 <mardy> ah, right the manifest.json is wrong
14:53 <mardy> it says "account-qml-plugin": "@ACCOUNT_SERVICE_DIR@/evernote",
14:54 <popey> what should it be?
14:54 <mardy> s/ACCOUNT_SERVICE_DIR/ACCOUNT_QML_PLUGIN_DIR/
14:55 <mardy> if I can read the CMakeLists.txt correctly

lp:~dpm/reminders-app/account-click updated on 2014-09-09
221. By David Planella on 2014-09-09

Fixed manifest path for account qml plugin

lp:~dpm/reminders-app/account-click updated on 2014-09-09
222. By David Planella on 2014-09-09

Changed the manifest hooks according to jdstrand's feedback

David Planella (dpm) wrote :

Chris, I've changed the hooks in the manifest as per jdstrand's feedback. Does that address your comment? Or were you suggesting any other changes?

Alberto Mardegan (mardy) wrote :

Hi! I finally spotted what is the issue (sorry, I should have thought of it earlier, as it's quite obvious!): now that the .provider and qml files are shipped via a click package, their name is not just "evernote". The hooks we run will rename them to <click-package_application-name>.

So, in your case you should update the evernote code (the parts where you use the AccountServiceModel and the Setup elements) to use this as provider: "com.ubuntu.reminders_evernote-account-plugin".

lp:~dpm/reminders-app/account-click updated on 2014-09-12
223. By David Planella on 2014-09-12

Added changes recommended by mardy

lp:~dpm/reminders-app/account-click updated on 2014-09-12
224. By David Planella on 2014-09-12

Added ability to switch between account providers

David Planella (dpm) wrote :

Ok, I've added all the changes recommended by mardy:

http://bazaar.launchpad.net/~dpm/reminders-app/account-click/revision/223

Except for one, which is not essential and I will address separately to keep the changes to a minimum:

- Rename the provider file to com.ubuntu.reminders_evernote-account-plugin in the deb as well, to simplify the building

There is now a new .click package available for testing at: http://people.canonical.com/~dpm/click/com.ubuntu.reminders_0.5.224_armhf.click

lp:~dpm/reminders-app/account-click updated on 2014-09-12
225. By David Planella on 2014-09-12

Merged from trunk, fixed manifest file conflict

Alberto Mardegan (mardy) wrote :

This looks correct :-)

review: Approve
Chris Wayne (cwayne18) wrote :

LGTM

review: Approve
David Planella (dpm) wrote :

#blocked by bug 1368763

David Planella (dpm) wrote :

#blocked by bug 1369941

lp:~dpm/reminders-app/account-click updated on 2014-09-23
226. By David Planella on 2014-09-23

Merged from trunk

David Planella (dpm) wrote :

So the app now works, but its .deb packaged version used by Jenkins fails the tests.

I can't figure out what's different and could be causing the .deb packages to fail. Unlike the click counterpart, the .deb packaging has remained the same, and only some ids have been redefined.

Here's a diff of the changes in the .deb packages:

http://pastebin.ubuntu.com/8417102/

lp:~dpm/reminders-app/account-click updated on 2014-09-24
227. By David Planella on 2014-09-24

Renamed .service and .provider files to make the desktop version work

228. By David Planella on 2014-09-24

Fixed installation names in the debian packaging

229. By David Planella on 2014-09-24

Updated service and provider names in the manifest file

lp:~dpm/reminders-app/account-click updated on 2014-09-24
230. By David Planella on 2014-09-24

Fixed names of services

lp:~dpm/reminders-app/account-click updated on 2014-09-25
231. By David Planella on 2014-09-25

Fixed the service file path in the manifest

232. By David Planella on 2014-09-25

Really really really fix the manifest now

Nicholas Skaggs (nskaggs) wrote :

I'll note this works fine locally after dpm's latest tweaks, but fails at this step in jenkins:

        session = Signon.AuthSession.new(identity, method)
        session.process(
            session_data, mechanism, self._on_login_processed, None)

Nicholas Skaggs (nskaggs) wrote :

We can see a bit more detail here about what's happening locally (which works) and what is happening in jenkins:

http://paste.ubuntu.com/8467742/

In short, the authentication data is blank because it appears the initial account creation

        account = self._manager.create_account('evernote-sandbox')

is blank, instead of having the oauth details and keys.

Nicholas Skaggs (nskaggs) wrote :

I can confirm I can recreate what is occurring in jenkins locally but using the installed binaries instead of the local build. This rules out something specific to jenkins.

This points to something in the cmake or debian build as the potential issue.

David Planella (dpm) wrote :

Thanks a lot Nick. Do you think you could create a small python file to
reproduce the failure?

I'd then test the file with locally installed packages: first the ones from
trunk, and then the ones from this branch. I'd use this to point mardy to
the failure (rather than having to start the test suite to reproduce).

On Tue, Sep 30, 2014 at 9:51 PM, Nicholas Skaggs <
<email address hidden>> wrote:

> I can confirm I can recreate what is occurring in jenkins locally but
> using the installed binaries instead of the local build. This rules out
> something specific to jenkins.
>
> This points to something in the cmake or debian build as the potential
> issue.
> --
> https://code.launchpad.net/~dpm/reminders-app/account-click/+merge/230768
> You are the owner of lp:~dpm/reminders-app/account-click.
>

Alberto Mardegan (mardy) wrote :

At least one reason for the failure is quite obvious: the provider was renamed from "evernote-sandbox" to "com.ubuntu.reminders_evernote-account-plugin-sandbox".

lp:~dpm/reminders-app/account-click updated on 2014-10-01
233. By David Planella on 2014-10-01

Updated provider and service IDs in the tests too

David Planella (dpm) wrote :

Ok, updated the tests to use the right service and provider IDs now. Fingers crossed!

lp:~dpm/reminders-app/account-click updated on 2014-10-01
234. By David Planella on 2014-10-01

Added -sandbox suffix to service ID in the tests

lp:~dpm/reminders-app/account-click updated on 2014-10-01
235. By David Planella on 2014-10-01

Make flake8 happy

lp:~dpm/reminders-app/account-click updated on 2014-10-01
236. By David Planella on 2014-10-01

Fixed typo in variable name

Michael Zanetti (mzanetti) wrote :

code changes look ok to me, didn't test it though

review: Approve (code review)
Nicholas Skaggs (nskaggs) wrote :

Can you wrap-and-sort the debian/control file David? I notice there is some duplicated depends in the list. account-plugin-evernote-sandbox is listed twice for instance under reminders-app-autopilot

review: Needs Fixing
David Planella (dpm) wrote :

It now works for me on the RTM images too. As per mardy's instructions, I needed to uninstall and reinstall the app after the u-s-s-o-a package got updated in my system. So I think that's finally good to go.

lp:~dpm/reminders-app/account-click updated on 2014-10-01
237. By David Planella on 2014-10-01

Added CMake command to determine the bzr revno upon build

238. By David Planella on 2014-10-01

Ran wrap-and-sort on debian files

David Planella (dpm) wrote :

On Wed, Oct 1, 2014 at 5:18 PM, Nicholas Skaggs <
<email address hidden>> wrote:

> Review: Needs Fixing
>
> Can you wrap-and-sort the debian/control file David? I notice there is
> some duplicated depends in the list. account-plugin-evernote-sandbox is
> listed twice for instance under reminders-app-autopilot
>

Done, thanks for the review and the hint at wrap-and-sort!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-09-28 09:10:46 +0000
3+++ CMakeLists.txt 2014-10-01 20:48:08 +0000
4@@ -22,6 +22,11 @@
5 set(EXEC "reminders")
6 set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
7
8+set(ACCOUNT_ICON_DIR ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
9+set(ACCOUNT_PROVIDER_DIR ${CMAKE_INSTALL_DATADIR}/accounts/providers)
10+set(ACCOUNT_SERVICE_DIR ${CMAKE_INSTALL_DATADIR}/accounts/services)
11+set(ACCOUNT_QML_PLUGIN_DIR ${CMAKE_INSTALL_DATADIR}/accounts/qml-plugins)
12+
13 if(CLICK_MODE)
14 if(NOT DEFINED BZR_SOURCE)
15 set(BZR_SOURCE "lp:${APP_HARDCODE}")
16@@ -38,6 +43,13 @@
17 set(DATA_DIR /)
18 set(DESKTOP_DIR ${DATA_DIR})
19 set(APPLICATION_DIR ${DATA_DIR})
20+
21+ # Sets BZR_REVNO
22+ execute_process(
23+ COMMAND bzr revno ${CMAKE_SOURCE_DIR}
24+ OUTPUT_VARIABLE BZR_REVNO
25+ OUTPUT_STRIP_TRAILING_WHITESPACE
26+ )
27 if(NOT BZR_REVNO)
28 set(BZR_REVNO "latest")
29 endif(NOT BZR_REVNO)
30
31=== modified file 'com.ubuntu.reminders_reminders.application.in'
32--- com.ubuntu.reminders_reminders.application.in 2014-06-27 14:32:32 +0000
33+++ com.ubuntu.reminders_reminders.application.in 2014-10-01 20:48:08 +0000
34@@ -4,10 +4,10 @@
35 <description>Reminders</description>
36
37 <services>
38- <service id="evernote">
39+ <service id="com.ubuntu.reminders_reminders">
40 <description>Synchronize your notes with Evernote</description>
41 </service>
42- <service id="evernote-sandbox">
43+ <service id="com.ubuntu.reminders_reminders-sandbox">
44 <description>Synchronize your notes with the Evernote Sandbox</description>
45 </service>
46 </services>
47
48=== modified file 'debian/account-plugin-evernote-sandbox.install'
49--- debian/account-plugin-evernote-sandbox.install 2014-06-27 17:26:38 +0000
50+++ debian/account-plugin-evernote-sandbox.install 2014-10-01 20:48:08 +0000
51@@ -1,4 +1,4 @@
52-usr/share/accounts/providers/evernote-sandbox.provider
53+usr/share/accounts/providers/com.ubuntu.reminders_evernote-account-plugin-sandbox.provider
54 usr/share/accounts/qml-plugins/evernote-sandbox/Main.qml
55-usr/share/accounts/services/evernote-sandbox.service
56+usr/share/accounts/services/com.ubuntu.reminders_reminders-sandbox.service
57 usr/share/icons/hicolor/32x32/apps/evernote-sandbox.png
58
59=== modified file 'debian/account-plugin-evernote.install'
60--- debian/account-plugin-evernote.install 2014-06-27 15:57:59 +0000
61+++ debian/account-plugin-evernote.install 2014-10-01 20:48:08 +0000
62@@ -1,7 +1,7 @@
63 #!/usr/bin/dh-exec
64
65-usr/share/accounts/providers/evernote.provider
66+usr/share/accounts/providers/com.ubuntu.reminders_evernote-account-plugin.provider
67 usr/share/accounts/qml-plugins/evernote/Main.qml
68-usr/share/accounts/services/evernote.service
69+usr/share/accounts/services/com.ubuntu.reminders_reminders.service
70 usr/share/icons/hicolor/32x32/apps/evernote.png
71 usr/lib/*/qt5/qml/Evernote usr/lib/${DEB_HOST_MULTIARCH}/ubuntu-system-settings/private
72
73=== modified file 'debian/control'
74--- debian/control 2014-09-28 08:31:38 +0000
75+++ debian/control 2014-10-01 20:48:08 +0000
76@@ -10,7 +10,7 @@
77 libssl-dev,
78 python3-all,
79 qt5-default,
80- qtdeclarative5-dev,
81+ qtdeclarative5-dev
82 Standards-Version: 3.9.5
83 Section: misc
84 Homepage: https://launchpad.net/reminders-app
85@@ -18,24 +18,24 @@
86
87 Package: reminders-app
88 Architecture: any
89-Depends: ${misc:Depends}, ${shlibs:Depends},
90- account-plugin-evernote,
91+Depends: account-plugin-evernote,
92 qtdeclarative5-accounts-plugin,
93 qtdeclarative5-evernote0.1,
94- qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
95 qtdeclarative5-localstorage-plugin,
96 qtdeclarative5-online-accounts-client0.1 (>= 0.3+14.10.20140506),
97+ qtdeclarative5-qtquick2-plugin,
98 qtdeclarative5-quicklayouts-plugin,
99- qtdeclarative5-qtquick2-plugin,
100+ qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
101 signon-plugin-oauth2 (>= 0.19-0~57~),
102 suru-icon-theme | ubuntu-mobile-icons,
103+ ${misc:Depends},
104+ ${shlibs:Depends}
105 Description: Reminders application
106 Note taking application powered by Evernote
107
108 Package: qtdeclarative5-evernote0.1
109 Architecture: any
110-Depends: ${misc:Depends},
111- ${shlibs:Depends},
112+Depends: ${misc:Depends}, ${shlibs:Depends}
113 Description: Expose the Evernote API to QML applications
114 This module provides access to the Evernote API from QML applications.
115
116@@ -44,7 +44,7 @@
117 Depends: libaccount-plugin-generic-oauth,
118 qtdeclarative5-online-accounts-client0.1,
119 ${misc:Depends},
120- ${shlibs:Depends},
121+ ${shlibs:Depends}
122 Description: Allow Ubuntu applications to access Evernote accounts
123 This plugin enables users to authenticate to their Evernote accounts,
124 providing syncing of Evernote notes across Ubuntu devices.
125@@ -55,16 +55,14 @@
126 libaccount-plugin-generic-oauth,
127 qtdeclarative5-online-accounts-client0.1,
128 ${misc:Depends},
129- ${shlibs:Depends},
130+ ${shlibs:Depends}
131 Description: Allow Ubuntu applications to access Evernote sandbox accounts
132 This plugin enables developers to authenticate to their Evernote developer
133 sandbox account, which allows syncing of Evernote notes across Ubuntu devices.
134
135 Package: reminders-app-autopilot
136 Architecture: all
137-Depends: ${misc:Depends},
138- reminders-app (>= ${source:Version}), reminders-app (<< ${source:Version}.1~),
139- account-plugin-evernote-sandbox,
140+Depends: account-plugin-evernote-sandbox,
141 libautopilot-qt,
142 libclick-0.4-0,
143 libqt5test5,
144@@ -73,7 +71,9 @@
145 python3-fixtures,
146 python3-oauthlib,
147 python3-requests-oauthlib,
148+ reminders-app (<< ${source:Version}.1~),
149+ reminders-app (>= ${source:Version}),
150 ubuntu-ui-toolkit-autopilot,
151- account-plugin-evernote-sandbox
152+ ${misc:Depends}
153 Description: Test package for the Reminders app
154 Autopilot tests for the Reminders app package
155
156=== modified file 'debian/reminders-app-autopilot.install'
157--- debian/reminders-app-autopilot.install 2014-06-26 15:43:02 +0000
158+++ debian/reminders-app-autopilot.install 2014-10-01 20:48:08 +0000
159@@ -1,3 +1,3 @@
160+usr/lib/*/dist-packages/evernote/
161 usr/lib/*/dist-packages/reminders/
162 usr/lib/*/dist-packages/thrift/
163-usr/lib/*/dist-packages/evernote/
164
165=== modified file 'debian/rules'
166--- debian/rules 2014-09-08 15:39:00 +0000
167+++ debian/rules 2014-10-01 20:48:08 +0000
168@@ -9,10 +9,6 @@
169
170 override_dh_auto_configure:
171 dh_auto_configure -- \
172- -DEVERNOTE_SANDBOX_CONSUMER_KEY="ubuntu" \
173- -DEVERNOTE_SANDBOX_CONSUMER_SECRET="44f8ee81a8359500" \
174- -DEVERNOTE_CONSUMER_KEY="canonicalis" \
175- -DEVERNOTE_CONSUMER_SECRET="174a72ce5bffbcad" \
176 -DCLICK_MODE=OFF
177
178 override_dh_install:
179
180=== modified file 'manifest.json.in'
181--- manifest.json.in 2014-09-23 07:35:24 +0000
182+++ manifest.json.in 2014-10-01 20:48:08 +0000
183@@ -5,8 +5,13 @@
184 "hooks": {
185 "reminders": {
186 "account-application": "com.ubuntu.reminders_reminders.application",
187+ "account-service": "@ACCOUNT_SERVICE_DIR@/com.ubuntu.reminders_reminders.service",
188 "apparmor": "reminders.apparmor",
189 "desktop": "com.ubuntu.reminders.desktop"
190+ },
191+ "evernote-account-plugin": {
192+ "account-qml-plugin": "@ACCOUNT_QML_PLUGIN_DIR@/evernote",
193+ "account-provider": "@ACCOUNT_PROVIDER_DIR@/com.ubuntu.reminders_evernote-account-plugin.provider"
194 }
195 },
196 "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>",
197@@ -17,10 +22,18 @@
198 "vcs-bzr": "lp:reminders-app",
199 "vcs-bzr-revno": "@BZR_REVNO@"
200 },
201- "x-test": {
202- "autopilot": {
203- "autopilot_module": "@AUTOPILOT_DIR@",
204- "depends": ["account-plugin-evernote-sandbox", "libclick-0.4-0", "python3-dbus", "python3-dbusmock", "python3-fixtures", "python3-oauthlib", "python3-requests-oauthlib"]
205- }
206- }
207+ "x-test": {
208+ "autopilot": {
209+ "autopilot_module": "@AUTOPILOT_DIR@",
210+ "depends": [
211+ "account-plugin-evernote-sandbox",
212+ "libclick-0.4-0",
213+ "python3-dbus",
214+ "python3-dbusmock",
215+ "python3-fixtures",
216+ "python3-oauthlib",
217+ "python3-requests-oauthlib"
218+ ]
219+ }
220+ }
221 }
222
223=== modified file 'src/CMakeLists.txt'
224--- src/CMakeLists.txt 2014-01-30 13:53:15 +0000
225+++ src/CMakeLists.txt 2014-10-01 20:48:08 +0000
226@@ -1,5 +1,3 @@
227-if(NOT CLICK_MODE)
228 add_subdirectory(account-plugin)
229-endif(NOT CLICK_MODE)
230 add_subdirectory(plugin)
231 add_subdirectory(app)
232
233=== modified file 'src/account-plugin/CMakeLists.txt'
234--- src/account-plugin/CMakeLists.txt 2014-07-01 13:27:32 +0000
235+++ src/account-plugin/CMakeLists.txt 2014-10-01 20:48:08 +0000
236@@ -1,70 +1,54 @@
237+set(EVERNOTE_SANDBOX_CONSUMER_KEY "ubuntu")
238+set(EVERNOTE_SANDBOX_CONSUMER_SECRET "44f8ee81a8359500")
239+set(EVERNOTE_CONSUMER_KEY "canonicalis")
240+set(EVERNOTE_CONSUMER_SECRET "174a72ce5bffbcad")
241+
242+function(EvernoteOnlineAccountSetup account_display_name account_name provider_id service_id hostname consumer_key consumer_secret)
243+
244+ set(EVERNOTE_DATA_FILENAME evernote)
245+ set(EVERNOTE_CONSUMER_KEY ${consumer_key})
246+ set(EVERNOTE_CONSUMER_SECRET ${consumer_secret})
247+
248+ set(EVERNOTE_ACCOUNT_DISPLAY_NAME ${account_display_name})
249+ set(EVERNOTE_ACCOUNT_NAME ${account_name})
250+ set(EVERNOTE_HOSTNAME ${hostname})
251+
252+ set(EVERNOTE_PROVIDER_ID ${provider_id})
253+ set(EVERNOTE_SERVICE_ID ${service_id})
254+ set(EVERNOTE_ICON_NAME ${account_name})
255+
256+ set(ICON_FILE data/icons/${EVERNOTE_ICON_NAME}.png)
257+ set(PROVIDER_FILE_IN data/providers/${EVERNOTE_DATA_FILENAME}.provider.in)
258+ set(SERVICE_FILE_IN data/services/${EVERNOTE_DATA_FILENAME}.service.in)
259+ set(QML_PLUGIN_FILE_IN qml/${EVERNOTE_DATA_FILENAME}/Main.qml.in)
260+
261+ set(PROVIDER_FILE data/providers/${EVERNOTE_PROVIDER_ID}.provider)
262+ set(SERVICE_FILE data/services/${EVERNOTE_SERVICE_ID}.service)
263+ set(QML_PLUGIN_FILE qml/${account_name}/Main.qml)
264+
265+ install(FILES ${ICON_FILE} DESTINATION ${ACCOUNT_ICON_DIR})
266+
267+ configure_file(${PROVIDER_FILE_IN} ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE})
268+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE}
269+ DESTINATION ${ACCOUNT_PROVIDER_DIR})
270+
271+ configure_file(${SERVICE_FILE_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_FILE})
272+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_FILE}
273+ DESTINATION ${ACCOUNT_SERVICE_DIR})
274+
275+ configure_file(${QML_PLUGIN_FILE_IN} ${CMAKE_CURRENT_BINARY_DIR}/${QML_PLUGIN_FILE})
276+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${QML_PLUGIN_FILE}
277+ DESTINATION ${ACCOUNT_QML_PLUGIN_DIR}/${EVERNOTE_ACCOUNT_NAME})
278+
279+endfunction()
280+
281 # Build and install the files for the production plugin
282-
283-set(EVERNOTE_ACCOUNT_DISPLAY_NAME Evernote)
284-set(EVERNOTE_ACCOUNT_NAME evernote)
285-set(EVERNOTE_HOSTNAME www.evernote.com)
286-
287-set(EVERNOTE_PROVIDER_ID ${EVERNOTE_ACCOUNT_NAME})
288-set(EVERNOTE_SERVICE_ID ${EVERNOTE_ACCOUNT_NAME})
289-set(EVERNOTE_ICON_NAME ${EVERNOTE_ACCOUNT_NAME})
290-
291-set(ICON data/icons/${EVERNOTE_ICON_NAME}.png)
292-set(PROVIDER_FILE data/providers/${EVERNOTE_ACCOUNT_NAME}.provider)
293-set(SERVICE_FILE data/services/${EVERNOTE_ACCOUNT_NAME}.service)
294-set(QML_PLUGIN_FILE qml/${EVERNOTE_ACCOUNT_NAME}/Main.qml)
295-set(QML_PLUGIN_DIR ${CMAKE_INSTALL_DATADIR}/accounts/qml-plugins)
296-
297-set(ICON_DIR ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
298-set(PROVIDER_DIR ${CMAKE_INSTALL_DATADIR}/accounts/providers)
299-set(SERVICE_DIR ${CMAKE_INSTALL_DATADIR}/accounts/services)
300-
301-install(FILES ${ICON} DESTINATION ${ICON_DIR})
302-
303-configure_file(${PROVIDER_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE})
304-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE}
305- DESTINATION ${PROVIDER_DIR})
306-
307-configure_file(${SERVICE_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_FILE})
308-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_FILE}
309- DESTINATION ${SERVICE_DIR})
310-
311-configure_file(${QML_PLUGIN_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${QML_PLUGIN_FILE})
312-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${QML_PLUGIN_FILE}
313- DESTINATION ${QML_PLUGIN_DIR}/${EVERNOTE_ACCOUNT_NAME})
314-
315-# Build and install the files for the sandbox plugin
316-
317-set(EVERNOTE_ACCOUNT_DISPLAY_NAME "Evernote Developer Sandbox")
318-set(EVERNOTE_ACCOUNT_NAME evernote-sandbox)
319-set(EVERNOTE_HOSTNAME sandbox.evernote.com)
320-set(EVERNOTE_CONSUMER_KEY ${EVERNOTE_SANDBOX_CONSUMER_KEY})
321-set(EVERNOTE_CONSUMER_SECRET ${EVERNOTE_SANDBOX_CONSUMER_SECRET})
322-
323-set(EVERNOTE_PROVIDER_ID ${EVERNOTE_ACCOUNT_NAME})
324-set(EVERNOTE_SERVICE_ID ${EVERNOTE_ACCOUNT_NAME})
325-set(EVERNOTE_ICON_NAME ${EVERNOTE_ACCOUNT_NAME})
326-
327-set(PROVIDER_FILE_SANDBOX data/providers/${EVERNOTE_ACCOUNT_NAME}.provider)
328-set(SERVICE_FILE_SANDBOX data/services/${EVERNOTE_ACCOUNT_NAME}.service)
329-set(QML_PLUGIN_FILE_SANDBOX qml/${EVERNOTE_ACCOUNT_NAME}/Main.qml)
330-set(QML_PLUGIN_DIR ${CMAKE_INSTALL_DATADIR}/accounts/qml-plugins)
331-
332-install(FILES ${ICON}
333- DESTINATION ${ICON_DIR}
334- RENAME ${EVERNOTE_ACCOUNT_NAME}.png)
335-
336-configure_file(${PROVIDER_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE_SANDBOX})
337-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE_SANDBOX}
338- DESTINATION ${PROVIDER_DIR})
339-
340-configure_file(${PROVIDER_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE_SANDBOX})
341-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE_SANDBOX}
342- DESTINATION ${PROVIDER_DIR})
343-
344-configure_file(${SERVICE_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_FILE_SANDBOX})
345-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_FILE_SANDBOX}
346- DESTINATION ${SERVICE_DIR})
347-
348-configure_file(${QML_PLUGIN_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${QML_PLUGIN_FILE_SANDBOX})
349-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${QML_PLUGIN_FILE_SANDBOX}
350- DESTINATION ${QML_PLUGIN_DIR}/${EVERNOTE_ACCOUNT_NAME})
351+EvernoteOnlineAccountSetup(Evernote evernote com.ubuntu.reminders_evernote-account-plugin com.ubuntu.reminders_reminders www.evernote.com
352+ ${EVERNOTE_CONSUMER_KEY} ${EVERNOTE_CONSUMER_SECRET})
353+
354+if(NOT CLICK_MODE)
355+ # Build and install the files for the sandbox plugin
356+ # We're only building it as a .deb package for Jenkins, we don't need it in the click package
357+ EvernoteOnlineAccountSetup("Evernote Developer Sandbox" evernote-sandbox com.ubuntu.reminders_evernote-account-plugin-sandbox com.ubuntu.reminders_reminders-sandbox sandbox.evernote.com
358+ ${EVERNOTE_SANDBOX_CONSUMER_KEY} ${EVERNOTE_SANDBOX_CONSUMER_SECRET})
359+endif(NOT CLICK_MODE)
360
361=== added file 'src/account-plugin/data/icons/evernote-sandbox.png'
362Binary files src/account-plugin/data/icons/evernote-sandbox.png 1970-01-01 00:00:00 +0000 and src/account-plugin/data/icons/evernote-sandbox.png 2014-10-01 20:48:08 +0000 differ
363=== modified file 'src/app/qml/reminders.qml'
364--- src/app/qml/reminders.qml 2014-09-23 12:39:27 +0000
365+++ src/app/qml/reminders.qml 2014-10-01 20:48:08 +0000
366@@ -130,7 +130,7 @@
367
368 AccountServiceModel {
369 id: accounts
370- service: useSandbox ? "evernote-sandbox" : "evernote"
371+ applicationId: "com.ubuntu.reminders_reminders"
372 }
373
374 AccountService {
375@@ -336,7 +336,7 @@
376 Setup {
377 id: setup
378 applicationId: "com.ubuntu.reminders_reminders"
379- providerId: "evernote"
380+ providerId: useSandbox ? "com.ubuntu.reminders_evernote-account-plugin-sandbox" : "com.ubuntu.reminders_evernote-account-plugin"
381 }
382
383 Button {
384
385=== modified file 'tests/autopilot/reminders/credentials.py'
386--- tests/autopilot/reminders/credentials.py 2014-09-01 23:10:54 +0000
387+++ tests/autopilot/reminders/credentials.py 2014-10-01 20:48:08 +0000
388@@ -81,7 +81,8 @@
389
390 def _create_account(self):
391 logger.debug('Creating the Evernote account.')
392- account = self._manager.create_account('evernote-sandbox')
393+ provider_id = 'com.ubuntu.reminders_evernote-account-plugin-sandbox'
394+ account = self._manager.create_account(provider_id)
395 account.set_enabled(True)
396 account.store(self._on_account_created, None)
397 return account
398@@ -143,7 +144,8 @@
399
400 def _enable_evernote_service(self, account):
401 logger.debug('Enabling evernote service.')
402- service = self._manager.get_service('evernote-sandbox')
403+ service_id = 'com.ubuntu.reminders_reminders-sandbox'
404+ service = self._manager.get_service(service_id)
405 account.select_service(service)
406 account.set_enabled(True)
407 account.store(self._on_service_enabled, None)
408
409=== modified file 'tests/autopilot/reminders/tests/test_credentials.py'
410--- tests/autopilot/reminders/tests/test_credentials.py 2014-07-30 17:23:26 +0000
411+++ tests/autopilot/reminders/tests/test_credentials.py 2014-10-01 20:48:08 +0000
412@@ -51,14 +51,16 @@
413 def test_add_evernote_account_must_set_provider(self):
414 account = self.add_evernote_account()
415
416- self.assertEqual(account.get_provider_name(), 'evernote-sandbox')
417+ provider_id = 'com.ubuntu.reminders_evernote-account-plugin-sandbox'
418+ self.assertEqual(account.get_provider_name(), provider_id)
419
420 def test_add_evernote_account_must_enable_evernote_service(self):
421 account = self.add_evernote_account()
422 services = account.list_services()
423
424 self.assertThat(services, HasLength(1))
425- self.assertEqual(services[0].get_name(), 'evernote-sandbox')
426+ service_id = 'com.ubuntu.reminders_reminders-sandbox'
427+ self.assertEqual(services[0].get_name(), service_id)
428 service = Accounts.AccountService.new(account, services[0])
429 self.assertTrue(service.get_enabled())
430

Subscribers

People subscribed via source and target branches