on xenial help sign in
Update and rename CODING to CODING.md
commit9ab73c5acc3598e24366a75f54d0a37109fe9861 authorMarius Gripsgard <marius@ubports.com> dateTue 20 Nov 2018, 12:25 (8 years ago) parent0a3913b
2 files changed+74−164
CODING−164 CODING.md+74
CODINGdeleted−164
@@ -1,164 +0,0 @@
1−Building Unity 8
2−================
3−
4−Only Ubuntu 14.04 (trusty) is supported as a developement environment.
5−
6−download 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)
10−
11− $ mkdir ~/unity8
12−
13−- fetch Unity 8 source
14− $ sudo apt-get install bzr
15− $ bzr branch lp:unity8 ~/unity8/trunk
16− $ cd ~/unity8/trunk
17−
18−install dependencies and build Unity 8
19−--------------------
20−
21−$ cd ~/unity8/trunk
22−$ ./build.sh
23−
24− If its your first time, this will install the required dependencies to build and
25− build it.
26−
27− You might want to also install unity-scope-home and unity-scope-click which
28− are technically "recommends", not strict dependencies
29−
30−You may also rebuild with the -c for clean, which just deletes the build
31−directory.
32−
33−
34−Running Unity 8 on your desktop
35−===============================
36−
37−run the Unity 8 shell
38−---------------------
39−$ cd ~/unity8/trunk
40−$ cd builddir
41−
42−Each component of unity8 can be ran independently for development and testing
43−For example:
44−$ make tryShell
45−$ make tryLauncher
46−$ make tryLockscreen
47−
48−Check out the tests/qmltests/ directory for a list of things that can be ran.
49−
50−Notes
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
65−
66−
67−Running Unity 8 on devices
68−==========================
69−
70−Running unity8 on a device should be done using crossbuilder.
71−Go to
72−* https://launchpad.net/crossbuilder and
73−* https://wiki.ubuntu.com/Touch/Crossbuilder
74−for more details on crossbuilder.
75−
76−unity8 will automatically restart on the phone once deployment
77−has finished due to post-build-steps set up in this repository.
78−
79−Coding guidelines
80−=================
81−The work-in-progress coding guidelines are available under:
82−https://launchpad.net/canonical-client-development-guidelines
83−
84−
85−Development Environment
86−=======================
87−QtCreator (available via the Software Center) is the best IDE to hack on
88−Unity 8.
89−
90−If using VIM, make sure you install some syntax highlighting for QML, like
91−https://github.com/peterhoeg/vim-qml
92−
93−Running tests
94−=============
95−
96−Tests are run from the build directory (which will be ./builddir if you used
97−the ./build.sh script).
98−
99−To run the tests that do not require any graphical capability and therefore
100−are pretty fast run:
101−
102−$ make test
103−
104−or, alternatively:
105−
106−$ ctest
107−
108−To run all graphical tests, which can take a couple of minutes:
109−
110−$ make uitests
111−
112−To run the tests for a single component/class:
113−
114−$ make testComponentName
115−
116−So, for the DragHandle component that would be:
117−
118−$ make testDragHandle
119−
120−To run the tests for a single component/class under gdb (so you can catch SEGFAULTS)
121−
122−$ make gdbtestComponentName
123−
124−To run a single test function of a single component/class:
125−
126−$ make testComponentName FUNCTION="TestCaseName::functionName"
127−
128−To run a test application that allow you to manually test or to simply try out
129−a given component:
130−
131−$ make tryComponentName
132−
133−So to try out, for instance, the DragHandle component, you would do:
134−
135−$ make tryDragHandle
136−
137−NB: Manual test or interation doesn't make sense for all components or classes,
138−particularly the non-graphical ones. In such cases no "tryFoo" make target is
139−provided.
140−
141−Running autopilot tests
142−=======================
143−
144−Autopilot tests are run from the build directory (which will be ./builddir if you used
145−the ./build.sh script).
146−
147−$ make autopilot
148−
149−If you want you can also run tests individually, for that you need to install first,
150−otherwise the tests will run on the system-installed version
151−
152−$ make install
153−
154−To see the list of existing autopilot tests you can do
155−
156−$ PYTHONPATH=../tests/autopilot autopilot3 list unity8
157−
158−And then run a single test with
159−
160−$ PYTHONPATH=../tests/autopilot autopilot3 run unity8.some.very.long.test.name
161−
162−or run them all with
163−
164−$ PYTHONPATH=../tests/autopilot autopilot3 run unity8
CODING.mdnew file+74
@@ -0,0 +1,74 @@
1+# Unity8 development docs
2+
3+It is recommended to use [crossbuilder](#crosscompile) for platform-independent building. You can also [build natively](#build-natively), but keep in mind that you will have to install lots of dependencies on your host OS.
4+
5+## Crosscompile
6+
7+To crosscompile, we have a tool called [crossbuilder](https://github.com/ubports/crossbuilder), this will automatically build and deploy to the device. [Here's how to set it up](https://docs.ubports.com/en/latest/systemdev/testing-locally.html#cross-building-with-crossbuilder).
8+
9+To build deb package just run:
10+```
11+crossbuilder
12+```
13+
14+or if you want to build without packaging:
15+```
16+crossbuilder --no-deb
17+```
18+
19+Use crossbuilder shell if you want to define your own cmake options. (this will not automaticly deploy to your device!)
20+```
21+crossbuilder shell
22+cd unity8
23+mkdir build-arm
24+cmake .. {OPTION(S)}
25+make
26+```
27+
28+For these changes to take effect, you will need to restart unity8, you can do this with `restart unity8` or reboot the device.
29+
30+You dont need to rebuild if changes is made to QML files, you can simply adb push the qml files and copy them to there location, then restart unity8.
31+
32+QML folder for unity8 is `/usr/share/unity8`.
33+
34+# Build natively
35+
36+## Install deps
37+
38+You need to add repo.ubports.com to your sources.list.
39+
40+Here is an example for bionic:
41+```
42+sudo apt install gnupg
43+echo "deb http://repo.ubports.com/ bionic main" | sudo tee /etc/apt/sources.list.d/ubports.list
44+wget http://repo.ubports.com/keyring.gpg -O - | sudo apt-key add
45+sudo apt update
46+```
47+
48+Then run mk-build-tools to install all the dependencies needed to build unity8.
49+```
50+sudo mk-build-deps -i
51+```
52+
53+## Build
54+
55+Then make build directory `mkdir build && cd build`
56+
57+Then run cmake `cmake ..` here you can also provide your build options
58+
59+Now its the fun part, build! `make -j4` (-j defines number of threads to build on)
60+
61+# Tests
62+
63+To run tests,
64+
65+```
66+make test
67+```
68+
69+You can also specify the differnet test targets to run with `make tryComponentName and make testComponentName`
70+
71+# Doxygen docs
72+
73+You can also install docs from the bionic or xenial repo that inclues a auto-generated docs including class infomation. This package is called unity8-doc and will be installed to `/usr/share/doc/unity8` here there will be an index.html, open this in your browser.
74+