Archive:Create a repository for add-ons: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Anarchintosh
>NedBot
m (Robot: Cosmetic changes)
Line 1: Line 1:
When you have created your repository, why not add it to [[Unofficial Add-on Repositories]]?
When you have created your repository, why not add it to [[Unofficial Add-on Repositories]]?
==Things you will require==
== Things you will require ==
*Any HTTP server. A popular method is to use the svn or git source code servers of googlecode, gitorious and github.
* Any HTTP server. A popular method is to use the svn or git source code servers of googlecode, gitorious and github.
*A folder containing one or more add-on.
* A folder containing one or more add-on.
*A master addon'''s'''.xml file. This file contains metadata about all available add-ons.
* A master addon'''s'''.xml file. This file contains metadata about all available add-ons.
*A checksum of the above file.
* A checksum of the above file.
*A zipped repository add-on for distribution. This allows you to share your repository with others.
* A zipped repository add-on for distribution. This allows you to share your repository with others.


You can use addons_xml_generator.py[http://anarchintosh-projects.googlecode.com/files/addons_xml_generator.py] to generate the master xml and the MD5.
You can use addons_xml_generator.py[http://anarchintosh-projects.googlecode.com/files/addons_xml_generator.py] to generate the master xml and the MD5.
Line 12: Line 12:
Every time you update an add-on run the addons_xml_generator.py before uploading the add-ons folder.
Every time you update an add-on run the addons_xml_generator.py before uploading the add-ons folder.


==Repository Files==
== Repository Files ==
Repositories are distributed just like any other add-on. In order for you to browse one in XBMC, you'll need to [[Add-ons_for_XBMC_(Developement)|create an add-on]] and install it. The repository addon extends the xbmc.addon.repository extension point, so in addition to the general XML structure and icons required for an icon, you'll need an <extension> block specfically pointing to your repository.
Repositories are distributed just like any other add-on. In order for you to browse one in XBMC, you'll need to [[Add-ons for XBMC (Developement)|create an add-on]] and install it. The repository addon extends the xbmc.addon.repository extension point, so in addition to the general XML structure and icons required for an icon, you'll need an <extension> block specfically pointing to your repository.
Use the addon.xml of any of the [[Unofficial Add-on Repositories]] as a template.
Use the addon.xml of any of the [[Unofficial Add-on Repositories]] as a template.
Online repositories should always have zip set to true, both for efficiency of download and for the protection that .zip offers by way of verifying the download (i.e. can we unzip it).
Online repositories should always have zip set to true, both for efficiency of download and for the protection that .zip offers by way of verifying the download (i.e. can we unzip it).


==Tips==
== Tips ==
===Using your repo to host images===
=== Using your repo to host images ===
You may as a developer need to host images from time to time.
You may as a developer need to host images from time to time.
Something like photobucket or flickr may work, but you can also use your repo.
Something like photobucket or flickr may work, but you can also use your repo.
Line 27: Line 27:
This can then be accessed easily from python code, or even embedded on the XBMC forums.
This can then be accessed easily from python code, or even embedded on the XBMC forums.


===How to make an add-on self-updating without distributing a repository file===
=== How to make an add-on self-updating without distributing a repository file ===
This is optional.
This is optional.
You still need a repository for this, you just distribute the actual zipped plugin or script, as opposed to the repository file.
You still need a repository for this, you just distribute the actual zipped plugin or script, as opposed to the repository file.
Line 42: Line 42:
Then simply add it under the other <extension point> entries of your add-on's addon.xml
Then simply add it under the other <extension point> entries of your add-on's addon.xml
The name= part of this repository extension must never be the same as your add-on.
The name= part of this repository extension must never be the same as your add-on.


[[category:Add-ons]]
[[Category:Add-ons]]

Revision as of 16:11, 7 September 2011

When you have created your repository, why not add it to Unofficial Add-on Repositories?

Things you will require

  • Any HTTP server. A popular method is to use the svn or git source code servers of googlecode, gitorious and github.
  • A folder containing one or more add-on.
  • A master addons.xml file. This file contains metadata about all available add-ons.
  • A checksum of the above file.
  • A zipped repository add-on for distribution. This allows you to share your repository with others.

You can use addons_xml_generator.py[1] to generate the master xml and the MD5. Put it in the folder with all your add-ons and run it from your Python interpreter. If using a source code server, you can now upload your add-on folder via svn or git to your repository. Every time you update an add-on run the addons_xml_generator.py before uploading the add-ons folder.

Repository Files

Repositories are distributed just like any other add-on. In order for you to browse one in XBMC, you'll need to create an add-on and install it. The repository addon extends the xbmc.addon.repository extension point, so in addition to the general XML structure and icons required for an icon, you'll need an <extension> block specfically pointing to your repository. Use the addon.xml of any of the Unofficial Add-on Repositories as a template. Online repositories should always have zip set to true, both for efficiency of download and for the protection that .zip offers by way of verifying the download (i.e. can we unzip it).

Tips

Using your repo to host images

You may as a developer need to host images from time to time. Something like photobucket or flickr may work, but you can also use your repo. Commit an image to it, and then form the url to it as you would if you were accessing the image via git or svn (like below):

http://xbmc-adult.googlecode.com/svn/trunk/repository.xbmc-adult/icon.png

This can then be accessed easily from python code, or even embedded on the XBMC forums.

How to make an add-on self-updating without distributing a repository file

This is optional. You still need a repository for this, you just distribute the actual zipped plugin or script, as opposed to the repository file. First you need to have a working repository file. Copy the equivalent of this code from the addon.xml of your repository file:

  <extension point="xbmc.addon.repository"
              name="Official XBMC.org Add-on Repository">
    <info compressed="true">http://mirrors.xbmc.org/addons/dharma-pre/addons.xml</info>
    <checksum>http://mirrors.xbmc.org/addons/dharma-pre/addons.xml.md5</checksum>
    <datadir zip="true">http://mirrors.xbmc.org/addons/dharma-pre</datadir>
  </extension>

Then simply add it under the other <extension point> entries of your add-on's addon.xml The name= part of this repository extension must never be the same as your add-on.