on 8.12+16.10.20160527-0ubuntu1 help sign in
unity8/CODING
203 lines 5.9 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.sh --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.sh
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.sh
48Options can be passed to test the lock screen
49$ ./run.sh -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- a three point drag (for side stage operations) can be performed by using
58 the Shift+Control+Alt (all together) keyboard modifiers while using the mouse.
59- to get the translations work, currently you have to do make install to
60 put the *.mo files into correct structure. We'll look for a better solution
61 later.
62 $ cd builddir; make install
63- if you wish to populate contacts
64 $ sudo apt-get install gir1.2-ebook-1.2
65 $ manage-address-book.py create
66 this will:
67 - Create an EDS address book
68 - Populate the address book with sample data
71Running Unity 8 on devices
72==========================
73- Ubuntu Touch builds are currently only available in 14.04 flavour
74- supported hardware should match one of those listed here
75 https://wiki.ubuntu.com/Touch/Devices#Running_fine
76- follow the Ubuntu Touch install instructions for your chosen device
77 https://wiki.ubuntu.com/Touch/Install
78- make sure your device is connected to a network
79- also make sure you have your SSH key in ~/.ssh/id_rsa.pub (or install one
80 on the device yourself)
82$ cd ~/unity/trunk
83$ ./run_on_device.sh --setup
84 this will:
85 - install your public SSH key on the device
86 - install the needed dependencies
88$ ./run_on_device.sh
89 this will:
90 - rsync the code to the device
91 - build on the device
92 - replace the running shell
94Options can be passed to test the lock screen
95$ ./run_on_device.sh -p OR -k
97-p is for pin lock, for which the default prompt answer is "1234"
98-k is for keylock passphrase, for which the default prompt answer is "password"
100Notes
101-----
102- using adb over TCP has some advantages, Google will be of help here
103 - NOTE: this is not yet available for flipped images
104 - TL;DR: `adb tcpip 5555; adb connect $your_device_ip`
105 - you can persist the above via `adb shell setprop persist.adb.tcp.port 5555`
106 - it's unsafe - anyone can connect to your device
107 - with TCP the Nexus 10 doesn't drop the adb connection when locking
108 the screen
109- exporting ANDROID_SERIAL=$your_device_serial or
110 ANDROID_SERIAL=$your_device_ip:5555 will make adb not complain about
111 multiple devices
112- you can export TARGET_IP=$your_device_ip TARGET_SSH_PORT=22 for run_on_device.sh
113 to not use adb forwarding - useful if you use multiple devices
114- using Ninja (package ninja-build - run_on_device.sh -s installs this now)
115 will improve build times (especially in the nothing-to-build case)
118Coding guidelines
119=================
120The work-in-progress coding guidelines are available under:
121https://launchpad.net/canonical-client-development-guidelines
124Development Environment
125=======================
126QtCreator (available via the Software Center) is the best IDE to hack on
127Unity 8.
129If using VIM, make sure you install some syntax highlighting for QML, like
130https://github.com/peterhoeg/vim-qml
132Running tests
133=============
135Tests are run from the build directory (which will be ./builddir if you used
136the ./build.sh script).
138To run the tests that do not require any graphical capability and therefore
139are pretty fast run:
141$ make test
143or, alternatively:
145$ ctest
147To run all graphical tests, which can take a couple of minutes:
149$ make uitests
151To run the tests for a single component/class:
153$ make testComponentName
155So, for the DragHandle component that would be:
157$ make testDragHandle
159To run the tests for a single component/class under gdb (so you can catch SEGFAULTS)
161$ make gdbtestComponentName
163To run a single test function of a single component/class:
165$ make testComponentName FUNCTION="TestCaseName::functionName"
167To run a test application that allow you to manually test or to simply try out
168a given component:
170$ make tryComponentName
172So to try out, for instance, the DragHandle component, you would do:
174$ make tryDragHandle
176NB: Manual test or interation doesn't make sense for all components or classes,
177particularly the non-graphical ones. In such cases no "tryFoo" make target is
178provided.
180Running autopilot tests
181=======================
183Autopilot tests are run from the build directory (which will be ./builddir if you used
184the ./build.sh script).
186$ make autopilot
188If you want you can also run tests individually, for that you need to install first,
189otherwise the tests will run on the system-installed version
191$ make install
193To see the list of existing autopilot tests you can do
195$ PYTHONPATH=../tests/autopilot autopilot3 list unity8
197And then run a single test with
199$ PYTHONPATH=../tests/autopilot autopilot3 run unity8.some.very.long.test.name
201or run them all with
203$ PYTHONPATH=../tests/autopilot autopilot3 run unity8