4
Ubuntu Component Store is intended to be a community project where app developers are
5
encouraged to contribute any component that they think would be useful to other developers.
6
To contribute a component to UCS, we recommend first joining the team by applying `here`_.
7
This would then make it possible for you to maintain your component by pushing bug fixes and
8
improvements as and when you choose.
10
By moderating the members of the team and components in UCS, we can promise a well tested
11
component with a stable API. We recognize that this can impede the rate at which new components
12
can be added to UCS, but we feel that this is an acceptable drawback to ensure good quality
13
components to our userbase.
15
Let's go through the steps required to upload a new component to the store.
20
You can technically contribute new components to the store without being a member of the team by
21
requesting someone from the team to maintain your component. However we highly recommend that you
22
join the team since that would allow you to push bug fixes and improvements to your component
23
quickly. You can apply to become a member by applying `here`_. The approval should be done within a
26
UCS is hosted on launchpad and requires bazaar (bzr) to grab or push the code. As such you would
27
need to have an account on launchpad and be familiar with bzr. You can grab the code by, ::
29
bzr branch lp:component-store
31
UCS by itself is an ordinary QML project. You should be able to open it using qtcreator like any other
32
project. Run the UCS Gallery app by either pressing the green button in qtcreator or via the command line
37
This should open the UCS Gallery app as shown below. It provides a visual overview of all the components
40
.. image:: _images/gallery.png
44
.. note:: At the time of writing this documentation, you would need a 14.10 desktop to run the component store gallery. You can run the gallery app on the phone or emulator using a 14.04 desktop, however the gallery app doesn't converge well on the phone yet. This should be fixed soon.
46
Adding a new component to the store
47
-----------------------------------
49
Adding a new component to the store involves 3 main steps which are,
51
1. Adding a new component to the ComponentStore folder
52
2. Updating the gallery app to showcase your new component
53
3. Updating the documentation
55
Adding a new component to the ComponentStore Folder
56
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
The components are stored in their own folders in the ComponentStore folder. Let's assume for illustration purposes,
59
we are trying to add a new component *MyNewComponent* to UCS. Let's grab UCS first and then add the new component. ::
61
bzr branch lp:component-store MyNewComponentBranch
63
Let create a new folder for our component in the ComponentStore folder, ::
65
cd MyNewComponentBranch/ComponentStore
66
mkdir MyNewComponent && bzr add MyNewComponent
69
Inside your *MyNewComponent* folder, add your generic component files. Everything that is required to use your component
70
must be included in this folder. Let's now add these files to the source control bzr and commit them. ::
73
bzr commit -m "Added my new component"
75
Updating the gallery app
76
^^^^^^^^^^^^^^^^^^^^^^^^
78
Now that we have our component ready and added, let's update the gallery app to show that. Create a new file in the GallerySRC
79
folder called MyNewComponentWidget.qml. This file is rather easy to fill out. Just copy the code from the other widget template
80
files. It basically involves filling in information like the author, license, contact and a description of your component which
81
is rather simple. Once completed, add MyNewComponentWidget.qml to the version control. ::
84
bzr add MyNewComponentWidget.qml
85
bzr commit -m "Showcase new component in the gallery"
87
Next, open WidgetsModel.qml and add your component to the list. That's it! Run the gallery app and see if your component shows up
90
Updating the documentation
91
^^^^^^^^^^^^^^^^^^^^^^^^^^
93
This is one of the most important steps and benefits of adding your component to UCS. By providing a well written and clear documentation
94
you make it easier for other app developers to use your component in their app. All the documentation is hosted in the docs folder. Create
95
a new documentation file in the _components folder and fill in the necessary documentation. Use the existing documentation files to help you
98
Once done, add your component to the list in index.rst. Now let's test if the documentation looks good. To build the documentation, you
99
need sphinx and pip packages to be installed. Let's install that for the first time. ::
101
sudo apt-get install pip
102
sudo pip install sphinx sphinx-autobuild
104
Building your documentation is now really simple. Once the build process is complete, open _build/index.html in your browser to see your documentation. ::
108
Once again, let's add this to the version control. ::
111
bzr add MyNewComponent.rst
112
bzr commit -m "Added documentation for the new component"
114
That was it! Your component is ready. Let's push this online to UCS. ::
116
bzr push lp:~launchpad-id/component-store/MyNewComponentBranch
118
From there on, it is just a matter of reviewing the code (for new components, we try to ensure everything is in order) and then merging to trunk.
120
.. _here: https://launchpad.net/~ubuntu-touch-community-dev
4
There are two sorts of components in the Ubuntu Component Store: *Curated* components and *Community* components. As a developer, you can publish your component to either. Components in the Curated store have higher requirements to ensure that they are high-quality; anyone can publish to the Community store without approval.
6
Contributing a component
7
------------------------