Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pythonforandroid/bootstraps/common/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,8 @@ def parse_args_and_make_package(args=None):
'launcher, rather than a single app.'))
ap.add_argument('--permission', dest='permissions', action='append', default=[],
help='The permissions to give this app.', nargs='+')
ap.add_argument('--feature', dest='features', action='append', default=[],
help='Add uses-feature keys to manifest', nargs='+')
ap.add_argument('--meta-data', dest='meta_data', action='append', default=[],
help='Custom key=value to add in application metadata')
ap.add_argument('--uses-library', dest='android_used_libs', action='append', default=[],
Expand Down Expand Up @@ -827,6 +829,9 @@ def _read_configuration():
if args.permissions and isinstance(args.permissions[0], list):
args.permissions = [p for perm in args.permissions for p in perm]

if args.features and isinstance(args.features[0], list):
args.features = [f for feat in args.features for f in feat]

if args.try_system_python_compile:
# Hardcoding python2.7 is okay for now, as python3 skips the
# compilation anyway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

<!-- OpenGL ES 2.0 -->
<uses-feature android:glEsVersion="0x00020000" />
<!-- other features -->
{% for feat in args.features %}
<uses-feature android:name="{{ feat }}" />
{% endfor %}

<!-- Allow writing to external storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<!-- Android 2.3.3 -->
<uses-sdk android:minSdkVersion="{{ args.min_sdk_version }}" android:targetSdkVersion="{{ android_api }}" />

<!-- other features -->
{% for feat in args.features %}
<uses-feature android:name="{{ feat }}" />
{% endfor %}

<application {% if debug %}android:debuggable="true"{% endif %} >
{% for name in service_names %}
<service android:name="{{ args.package }}.Service{{ name|capitalize }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<!-- Android 2.3.3 -->
<uses-sdk android:minSdkVersion="{{ args.min_sdk_version }}" android:targetSdkVersion="{{ android_api }}" />

<!-- other features -->
{% for feat in args.features %}
<uses-feature android:name="{{ feat }}" />
{% endfor %}

<!-- Set permissions -->
{% for perm in args.permissions %}
{% if '.' in perm %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<!-- Android 2.3.3 -->
<uses-sdk android:minSdkVersion="{{ args.min_sdk_version }}" android:targetSdkVersion="{{ android_api }}" />

<!-- other features -->
{% for feat in args.features %}
<uses-feature android:name="{{ feat }}" />
{% endfor %}

<!-- Allow writing to external storage -->
<uses-permission android:name="android.permission.INTERNET" />
{% for perm in args.permissions %}
Expand Down