on master help sign in
unity8/CODING
188 lines 5.2 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 and build Unity 8
19--------------------
21$ cd ~/unity8/trunk
22$ ./build.sh
24 If its your first time, this will install the required dependencies to build and
25 build it.
27 You might want to also install unity-scope-home and unity-scope-click which
28 are technically "recommends", not strict dependencies
30You may also rebuild with the -c for clean, which just deletes the build
31directory.
34Running Unity 8 on your desktop
35===============================
37run the Unity 8 shell
38---------------------
39$ cd ~/unity8/trunk
40$ cd builddir
42Each component of unity8 can be ran independently for development and testing
43For example:
44$ make tryShell
45$ make tryLauncher
46$ make tryLockscreen
48Check out the tests/qmltests/ directory for a list of things that can be ran.
50Notes
51-----
52- to navigate, utilize the mouse left button as you would your finger
53- a three point drag (for side stage operations) can be performed by using
54 the Shift+Control+Alt (all together) keyboard modifiers while using the mouse.
55- to get the translations work, currently you have to do make install to
56 put the *.mo files into correct structure. We'll look for a better solution
57 later.
58 $ cd builddir; make install
59- if you wish to populate contacts
60 $ sudo apt-get install gir1.2-ebook-1.2
61 $ manage-address-book.py create
62 this will:
63 - Create an EDS address book
64 - Populate the address book with sample data
67Running Unity 8 on devices
68==========================
70Running unity8 on a device should be done using crossbuilder.
71Go to
72* https://launchpad.net/crossbuilder and
73* https://wiki.ubuntu.com/Touch/Crossbuilder
74for more details on crossbuilder.
76unity8 will automatically restart on the phone once deployment
77has finished due to post-build-steps set up in this repository.
79Coding guidelines
80=================
81The work-in-progress coding guidelines are available under:
82https://launchpad.net/canonical-client-development-guidelines
85Development Environment
86=======================
87QtCreator (available via the Software Center) is the best IDE to hack on
88Unity 8.
90If using VIM, make sure you install some syntax highlighting for QML, like
91https://github.com/peterhoeg/vim-qml
93Running tests
94=============
96Tests are run from the build directory (which will be ./builddir if you used
97the ./build.sh script).
99To run the tests that do not require any graphical capability and therefore
100are pretty fast run:
102$ make test
104or, alternatively:
106$ ctest
108To run all graphical tests, which can take a couple of minutes:
110$ make uitests
112To run the tests for a single component/class:
114$ make testComponentName
116So, for the DragHandle component that would be:
118$ make testDragHandle
120To run the tests for a single component/class under gdb (so you can catch SEGFAULTS)
122$ make gdbtestComponentName
124To run a single test function of a single component/class:
126$ make testComponentName FUNCTION="TestCaseName::functionName"
128To run a test application that allow you to manually test or to simply try out
129a given component:
131$ make tryComponentName
133So to try out, for instance, the DragHandle component, you would do:
135$ make tryDragHandle
137NB: Manual test or interation doesn't make sense for all components or classes,
138particularly the non-graphical ones. In such cases no "tryFoo" make target is
139provided.
141Running autopilot tests
142=======================
144Autopilot tests are run from the build directory (which will be ./builddir if you used
145the ./build.sh script).
147$ make autopilot
149If you want you can also run tests individually, for that you need to install first,
150otherwise the tests will run on the system-installed version
152$ make install
154To see the list of existing autopilot tests you can do
156$ PYTHONPATH=../tests/autopilot autopilot3 list unity8
158And then run a single test with
160$ PYTHONPATH=../tests/autopilot autopilot3 run unity8.some.very.long.test.name
162or run them all with
164$ PYTHONPATH=../tests/autopilot autopilot3 run unity8
166Debugging techniques
167====================
169Unity8 heavily uses Qt and with that Qt debugging techniques mostly apply in the
170same fashion. There are, however, some additional unity8-specific notes:
172* Enable/disable Qt scenegraph visualizer on the fly:
174 $ qdbus com.canonical.Unity8.Debugging /com/canonical/Unity8/Debugging SetSceneGraphVisualizer <mode>
176 This is equivalent to exporting QSG_VISUALIZE=<mode> before running unity8, except it does it on the
177 fly.
179* Toggle slow animations on the fly:
181 $ qdbus com.canonical.Unity8.Debugging /com/canonical/Unity8/Debugging SetSlowAnimations <true|false>
183* Change logging filter rules on the fly:
185 $ qdbus com.canonical.Unity8.Debugging /com/canonical/Unity8/Debugging SetLoggingFilterRules <filter>
187 This is equivalent to exporting QT_LOGGING_RULES or defining them in QT_LOGGING_CONF, except it does
188 it on the fly.