on 7.85+14.04.20140416-0ubuntu1 help sign in
unity8/CODING
197 lines 5.7 kB history raw
1Building Unity 8
2================
4Only Ubuntu 14.04 (trusty) is supported as a developement environment.
6download source
7---------------
8- create a parent folder to not pollute your setup. so that you can have different unity
9 branches there (trunk, WIP etc)
11 $ mkdir ~/unity8
13- fetch Unity 8 source
14 $ sudo apt-get install bzr
15 $ bzr branch lp:unity8 ~/unity8/trunk
16 $ cd ~/unity8/trunk
18install dependencies
19--------------------
20If its your first time, install build dependencies
22$ cd ~/unity8/trunk
23$ ./build --setup
25 this will:
26 - install the required dependencies to build, as well as run on the desktop
27 - it should also install unity-scope-home and unity-lens-application which
28 are technically "recommends", not strict dependencies
30build Unity 8
31-------------
33$ cd ~/unity8/trunk
34$ ./build
36You may also rebuild with the -c for clean, which just deletes the build
37directory.
40Running Unity 8 on your desktop
41===============================
43run the Unity 8 shell
44---------------------
45$ cd ~/unity8/trunk
46$ ./run
48Options can be passed to test the lock screen
49$ ./run -p OR -k
51-p is for pin lock, for which the default prompt answer is "1234"
52-k is for keylock passphrase, for which the default prompt answer is "password"
54Notes
55-----
56- to navigate, utilize the mouse left button as you would your finger
57- to get the translations work, currently you have to do make install to
58 put the *.mo files into correct structure. We'll look for a better solution
59 later.
60 $ cd builddir; make install
61- if you wish to populate contacts
62 $ sudo apt-get install gir1.2-ebook-1.2
63 $ manage-address-book.py create
64 this will:
65 - Create an EDS address book
66 - Populate the address book with sample data
69Running Unity 8 on devices
70==========================
71- Ubuntu Touch builds are currently only available in 14.04 flavour
72- supported hardware should match one of those listed here
73 https://wiki.ubuntu.com/Touch/Devices#Running_fine
74- follow the Ubuntu Touch install instructions for your chosen device
75 https://wiki.ubuntu.com/Touch/Install
76- make sure your device is connected to a network
77- also make sure you have your SSH key in ~/.ssh/id_rsa.pub (or install one
78 on the device yourself)
80$ cd ~/unity/trunk
81$ ./run_on_device --setup
82 this will:
83 - install your public SSH key on the device
84 - install the needed dependencies
86$ ./run_on_device
87 this will:
88 - rsync the code to the device
89 - build on the device
90 - replace the running shell
92Options can be passed to test the lock screen
93$ ./run_on_device -p OR -k
95-p is for pin lock, for which the default prompt answer is "1234"
96-k is for keylock passphrase, for which the default prompt answer is "password"
98Notes
99-----
100- using adb over TCP has some advantages, Google will be of help here
101 - NOTE: this is not yet available for flipped images
102 - TL;DR: `adb tcpip 5555; adb connect $your_device_ip`
103 - you can persist the above via `adb shell setprop persist.adb.tcp.port 5555`
104 - it's unsafe - anyone can connect to your device
105 - with TCP the Nexus 10 doesn't drop the adb connection when locking
106 the screen
107- exporting ANDROID_SERIAL=$your_device_serial or
108 ANDROID_SERIAL=$your_device_ip:5555 will make adb not complain about
109 multiple devices
110- you can export TARGET_IP=$your_device_ip TARGET_SSH_PORT=22 for run_on_device
111 to not use adb forwarding - useful if you use multiple devices
112- using Ninja (package ninja-build - run_on_device -s installs this now)
113 will improve build times (especially in the nothing-to-build case)
116Coding guidelines
117=================
118The work-in-progress coding guidelines are available under:
119https://launchpad.net/canonical-client-development-guidelines
122Development Environment
123=======================
124QtCreator (available via the Software Center) is the best IDE to hack on
125Unity 8.
127If using VIM, make sure you install some syntax highlighting for QML, like
128https://github.com/peterhoeg/vim-qml
130Running tests
131=============
133Tests are run from the build directory (which will be ./builddir if you used
134the ./build script).
136To run the tests that do not require any graphical capability and therefore
137are pretty fast run:
139$ make test
141or, alternatively:
143$ ctest
145To run all graphical tests, which can take a couple of minutes:
147$ make qmluitests
149To run the tests for a single component/class:
151$ make testComponentName
153So, for the DragHandle component that would be:
155$ make testDragHandle
157To run a test application that allow you to manually test or to simply try out
158a given component:
160$ make tryComponentName
162So to try out, for instance, the DragHandle component, you would do:
164$ make tryDragHandle
166NB: Manual test or interation doesn't make sense for all components or classes,
167particularly the non-graphical ones. In such cases no "tryFoo" make target is
168provided.
170NB: The tests expect the locale to be the C locale, they may fail if run
171under a different locale, if you get failures others can not reproduce
172prepend 'LC_ALL=C' to the 'make test' command
174Running autopilot tests
175=======================
177Autopilot tests are run from the build directory (which will be ./builddir if you used
178the ./build script).
180$ make autopilot
182If you want you can also run tests individually, for that you need to install first,
183otherwise the tests will run on the system-installed version
185$ make install
187To see the list of existing autopilot tests you can do
189$ PYTHONPATH=../tests/autopilot autopilot list unity8
191And then run a single test with
193$ PYTHONPATH=../tests/autopilot autopilot run unity8.some.very.long.test.name
195or run them all with
197$ PYTHONPATH=../tests/autopilot autopilot run unity8