Skip to content

Commit fccae91

Browse files
committed
Added bootstrap doc
1 parent 67ae161 commit fccae91

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

doc/source/bootstraps.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,34 @@ APK. It is useful for testing recipes without building unnecessary
6363
components.
6464

6565

66+
Creating a new bootstrap
67+
========================
68+
69+
A bootstrap class consists of just a few basic components, though one of them must do a lot of work.
70+
71+
For instance, the SDL2 bootstrap looks like the following::
72+
73+
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchAndroid, logger, info_main, which
74+
from os.path import join, exists
75+
from os import walk
76+
import glob
77+
import sh
78+
79+
80+
class SDL2Bootstrap(Bootstrap):
81+
name = 'sdl2'
82+
83+
recipe_depends = ['sdl2']
84+
85+
def run_distribute(self):
86+
# much work is done here...
87+
88+
89+
The declaration of the bootstrap name and recipe dependencies should
90+
be clear. However, the :code:`run_distribute` method must do all the
91+
work of creating a build directory, copying recipes etc into it, and
92+
adding or removing any extra components as necessary.
93+
94+
If you'd like to creat a bootstrap, the best resource is to check the
95+
existing ones in the p4a source code. You can also :doc:`contact the
96+
developers <troubleshooting>` if you have problems or questions.

0 commit comments

Comments
 (0)