Merge lp:~mzanetti/reminders-app/run_on_device into lp:reminders-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Michael Zanetti
Approved revision: 20
Merged at revision: 8
Proposed branch: lp:~mzanetti/reminders-app/run_on_device
Merge into: lp:reminders-app
Diff against target: 167 lines (+128/-11)
4 files modified
apparmor/reminders-app.json (+1/-1)
reminders-app.desktop (+4/-4)
reminders-app.json (+0/-6)
run_on_ubuntu_touch.sh (+123/-0)
To merge this branch: bzr merge lp:~mzanetti/reminders-app/run_on_device
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
David Planella Approve
Review via email: mp+196506@code.launchpad.net

This proposal supersedes a proposal from 2013-11-22.

Commit message

add run_on_ubuntu_touch.sh script

Description of the change

This adds a script "run_on_ubuntu_touch.sh" which can be used to directly compile and run the app on the phone.

** You need to have the device in rw mode **

Once (rather every time you reflash) you need to setup the build environment on the phone with:

./run_on_ubuntu_touch.sh -s

After this you can just run the app with

./run_on_ubuntu_touch.sh

To create a click package for uploading to the store, use:

./run_on_ubuntu_touch.sh -c

The click package will be built on the phone and downloaded to the PC.

Additionally this branch fixes the .desktop file to be working with click packaging.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
David Planella (dpm) wrote : Posted in a previous version of this proposal

Looks good to me, thanks!

Just two small nitpicks:

1) Could you add the license header to the .sh file?

2) 23 +Comment=Ubuntu Evernote client

Evernote have asked us not to call the app an Evernote client until they've reviewed the first stable version. Would you mind changing the comment to something along these lines?

"Ubuntu Reminders app, powered by Evernote"

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

> Looks good to me, thanks!
>
> Just two small nitpicks:
>
> 1) Could you add the license header to the .sh file?

Actually we are lacking license headers everywhere... I'll do a separete MR adding those.

>
> 2) 23 +Comment=Ubuntu Evernote client
>
> Evernote have asked us not to call the app an Evernote client until they've
> reviewed the first stable version. Would you mind changing the comment to
> something along these lines?
>
> "Ubuntu Reminders app, powered by Evernote"

fixed.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:19
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mzanetti/reminders-app/run_on_device/+merge/196506/+edit-commit-message

http://91.189.93.70:8080/job/reminders-app-ci/16/
Executed test runs:
    FAILURE: http://91.189.93.70:8080/job/generic-mediumtests-trusty/238/console
    SUCCESS: http://91.189.93.70:8080/job/reminders-app-raring-amd64-ci/16
    SUCCESS: http://91.189.93.70:8080/job/reminders-app-saucy-amd64-ci/16
    SUCCESS: http://91.189.93.70:8080/job/reminders-app-trusty-amd64-ci/16

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/reminders-app-ci/16/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

So testing the app both on the desktop and on the device, I get the same result:

- Authentication works
- No notes are displayed

This seems to do with the change introduced in:

169 === modified file 'src/app/qml/ui/NotesPage.qml

Reverting that change gets the notes displayed again.

review: Needs Fixing
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:20
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mzanetti/reminders-app/run_on_device/+merge/196506/+edit-commit-message

http://91.189.93.70:8080/job/reminders-app-ci/17/
Executed test runs:
    FAILURE: http://91.189.93.70:8080/job/generic-mediumtests-trusty/239/console
    SUCCESS: http://91.189.93.70:8080/job/reminders-app-raring-amd64-ci/17
    SUCCESS: http://91.189.93.70:8080/job/reminders-app-saucy-amd64-ci/17
    SUCCESS: http://91.189.93.70:8080/job/reminders-app-trusty-amd64-ci/17

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/reminders-app-ci/17/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> So testing the app both on the desktop and on the device, I get the same
> result:
>
> - Authentication works
> - No notes are displayed
>
> This seems to do with the change introduced in:
>
> 169 === modified file 'src/app/qml/ui/NotesPage.qml
>
> Reverting that change gets the notes displayed again.

fixed

Revision history for this message
David Planella (dpm) wrote :

Tested the script now, seems to work well: http://ubuntuone.com/4VH3j9ezw4qamOOG9hLugJ

I've noticed a couple of issues while running the app on the phone. They are unrelated to this MP, so I'll just list them as a heads up and point to the separate bugs filed for them:

- On the initial page, when being shown the account to use, it is empty (bug 1254697)
- The notes' background color seems to be transparent (bug 1254700)
- I get frequent disconnects from the Evernote service, meaning that notes can no longer be fetched. It seems another branch improves on this, so I'll wait until further testing before filing a bug

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:19
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mzanetti/reminders-app/run_on_device/+merge/196506/+edit-commit-message

http://91.189.93.70:8080/job/reminders-app-ci/19/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/generic-mediumtests-trusty/257
    SUCCESS: http://91.189.93.70:8080/job/reminders-app-raring-amd64-ci/19
    SUCCESS: http://91.189.93.70:8080/job/reminders-app-saucy-amd64-ci/19
    SUCCESS: http://91.189.93.70:8080/job/reminders-app-trusty-amd64-ci/19

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/reminders-app-ci/19/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apparmor/reminders-app.json'
2--- apparmor/reminders-app.json 2013-11-20 21:49:45 +0000
3+++ apparmor/reminders-app.json 2013-11-25 11:14:06 +0000
4@@ -1,6 +1,6 @@
5 {
6 "policy_groups": [
7- "networking"
8+ "networking", "accounts"
9 ],
10 "policy_version": 1
11 }
12
13=== modified file 'reminders-app.desktop'
14--- reminders-app.desktop 2013-11-20 22:21:37 +0000
15+++ reminders-app.desktop 2013-11-25 11:14:06 +0000
16@@ -1,8 +1,8 @@
17 [Desktop Entry]
18-Name=reminders-app
19-Comment=My project description
20-Exec=/usr/bin/qmlscene $@ /usr/share/reminders-app/reminders-app.qml
21-Icon=/usr/share/ubuntu-clock-app/reminders-app.png
22+Name=Reminders
23+Comment=Ubuntu Reminders app, powered by Evernote
24+Exec=/usr/bin/qmlscene $@ -I . qml/reminders-app.qml
25+Icon=reminders-app.png
26 Terminal=false
27 Type=Application
28 X-Ubuntu-Touch=true
29
30=== removed file 'reminders-app.json'
31--- reminders-app.json 2013-10-23 11:02:37 +0000
32+++ reminders-app.json 1970-01-01 00:00:00 +0000
33@@ -1,6 +0,0 @@
34-{
35- "policy_groups": [
36- "networking"
37- ],
38- "policy_version": 1
39-}
40
41=== added file 'run_on_ubuntu_touch.sh'
42--- run_on_ubuntu_touch.sh 1970-01-01 00:00:00 +0000
43+++ run_on_ubuntu_touch.sh 2013-11-25 11:14:06 +0000
44@@ -0,0 +1,123 @@
45+#!/bin/sh
46+CODE_DIR=reminders-app
47+BUILD_DIR=builddir
48+USER=phablet
49+USER_ID=32011
50+PASSWORD=phablet
51+PACKAGE=reminders-app
52+BINARY=reminders-app
53+TARGET_IP=${TARGET_IP-127.0.0.1}
54+TARGET_SSH_PORT=${TARGET_SSH_PORT-2222}
55+TARGET_DEBUG_PORT=3768
56+RUN_OPTIONS=-qmljsdebugger=port:$TARGET_DEBUG_PORT
57+SETUP=false
58+GDB=false
59+CLICK=false
60+SUDO="echo $PASSWORD | sudo -S"
61+NUM_JOBS='$(( `grep -c ^processor /proc/cpuinfo` + 1 ))'
62+FLIPPED=false
63+DEPS="qt5-default qtbase5-dev qtdeclarative5-dev libboost-dev libssl-dev"
64+
65+exec_with_ssh() {
66+ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -t $USER@$TARGET_IP -p $TARGET_SSH_PORT sudo -u $USER -i bash -ic \"$@\"
67+}
68+
69+exec_with_adb() {
70+ adb shell $@
71+}
72+
73+adb_root() {
74+ adb root
75+ adb wait-for-device
76+}
77+
78+install_ssh_key() {
79+ ssh-keygen -R $TARGET_IP
80+ HOME_DIR="/home/phablet"
81+ adb push ~/.ssh/id_rsa.pub $HOME_DIR/.ssh/authorized_keys
82+ adb shell chown $USER_ID:$USER_ID $HOME_DIR/.ssh
83+ adb shell chown $USER_ID:$USER_ID $HOME_DIR/.ssh/authorized_keys
84+ adb shell chmod 700 $HOME_DIR/.ssh
85+ adb shell chmod 600 $HOME_DIR/.ssh/authorized_keys
86+}
87+
88+setup_adb_forwarding() {
89+ adb shell start ssh
90+ adb forward tcp:$TARGET_SSH_PORT tcp:22
91+ adb forward tcp:$TARGET_DEBUG_PORT tcp:$TARGET_DEBUG_PORT
92+}
93+
94+install_dependencies() {
95+ exec_with_adb apt-get --yes install build-essential $DEPS
96+}
97+
98+sync_code() {
99+ WORK_DIR=`pwd`
100+ [ -e .bzr ] && bzr export --uncommitted --format=dir /tmp/$CODE_DIR
101+ [ -e .git ] && cd /tmp && cp -r $WORK_DIR $CODE_DIR && cd $CODE_DIR && git clean -f -x && rm .git -rf && cd -
102+ rsync -crlOzv --delete --exclude builddir -e "ssh -p $TARGET_SSH_PORT -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" /tmp/$CODE_DIR/ $USER@$TARGET_IP:$CODE_DIR/
103+ rm -rf /tmp/$CODE_DIR
104+}
105+
106+build() {
107+ exec_with_ssh mkdir -p $CODE_DIR/$BUILD_DIR
108+ exec_with_ssh PATH=/usr/lib/ccache:$PATH "cd $CODE_DIR/$BUILD_DIR && PATH=/usr/lib/ccache:$PATH qmake --version"
109+ exec_with_ssh PATH=/usr/lib/ccache:$PATH "cd $CODE_DIR/$BUILD_DIR && PATH=/usr/lib/ccache:$PATH QT_SELECT=qt5 qmake .."
110+ exec_with_ssh PATH=/usr/lib/ccache:$PATH "cd $CODE_DIR/$BUILD_DIR && PATH=/usr/lib/ccache:$PATH make -j2"
111+}
112+
113+build_click_package() {
114+ exec_with_ssh mkdir -p $CODE_DIR/$BUILD_DIR/install
115+ exec_with_ssh rm -rf $CODE_DIR/$BUILD_DIR/install/*
116+ exec_with_ssh cp -r $CODE_DIR/src/app/qml $CODE_DIR/$BUILD_DIR/install
117+ exec_with_ssh cp $CODE_DIR/*.json $CODE_DIR/$BUILD_DIR/install
118+ exec_with_ssh cp $CODE_DIR/apparmor/*.json $CODE_DIR/$BUILD_DIR/install
119+ exec_with_ssh cp $CODE_DIR/$PACKAGE.desktop $CODE_DIR/$BUILD_DIR/install
120+ exec_with_ssh cp $CODE_DIR/$PACKAGE.png $CODE_DIR/$BUILD_DIR/install
121+ exec_with_ssh cp -r $CODE_DIR/$BUILD_DIR/src/plugin/Evernote $CODE_DIR/$BUILD_DIR/install/
122+ exec_with_ssh click build $CODE_DIR/$BUILD_DIR/install
123+ scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P $TARGET_SSH_PORT $USER@$TARGET_IP:/home/phablet/com.ubuntu*$PACKAGE*.click .
124+}
125+
126+run() {
127+ exec_with_ssh "cd $CODE_DIR/$BUILD_DIR/src/app/ && ./$BINARY --desktop_file_hint=$CODE_DIR/reminders-app.desktop"
128+}
129+
130+set -- `getopt -n$0 -u -a --longoptions="setup,gdb,click,help" "sgch" "$@"`
131+
132+# FIXME: giving incorrect arguments does not call usage and exit
133+while [ $# -gt 0 ]
134+do
135+ case "$1" in
136+ -s|--setup) SETUP=true;;
137+ -g|--gdb) GDB=true;;
138+ -c|--click) CLICK=true;;
139+ -h|--help) usage;;
140+ --) shift;break;;
141+ esac
142+ shift
143+done
144+
145+
146+adb_root
147+[ "${TARGET_IP}" = "127.0.0.1" ] && setup_adb_forwarding
148+
149+echo "Transferring code.."
150+sync_code
151+
152+if $SETUP; then
153+ echo "Setting up environment for building $PACKAGE..."
154+ install_ssh_key
155+ install_dependencies
156+ sync_code
157+else
158+ echo "Building.."
159+ build
160+ if $CLICK; then
161+ echo "Building click package..."
162+ build_click_package
163+ else
164+ echo "Running.."
165+ run
166+ fi
167+fi

Subscribers

People subscribed via source and target branches