Skip to content

Commit a8f16bf

Browse files
committed
bootstrap: make configurable the entrypoint per bootstrap via a bootstrap.properties that is merged with local.properties during the distribution.
1 parent f224505 commit a8f16bf

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

bootstrap/common/build.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,4 +492,19 @@ def make_package(args):
492492
and not x.startswith('#')]
493493
WHITELIST_PATTERNS += patterns
494494

495+
# read bootstrap.properties and fill the args
496+
args.bootstrap = {}
497+
with open("local.properties") as fd:
498+
for line in fd.readlines():
499+
items = line.split("=", 1)
500+
if len(items) != 2:
501+
continue
502+
key, value = items
503+
if not key.startswith("bootstrap."):
504+
continue
505+
key = key[len("bootstrap:"):]
506+
args.bootstrap[key] = value.splitlines()[0]
507+
508+
print args.bootstrap
509+
495510
make_package(args)

bootstrap/common/templates/AndroidManifest.tmpl.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<meta-data android:name="wakelock" android:value="{% if args.wakelock %}1{% else %}0{% endif %}"/>
2828

2929

30-
<activity android:name="org.renpy.android.PythonActivity"
30+
<activity android:name="{{ args.bootstrap.entrypoint }}"
3131
android:label="@string/iconName"
3232
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode{% if android_api >= 13 %}|screenSize{% endif %}"
3333
android:launchMode="singleTask"

bootstrap/legacy/bootstrap.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bootstrap.entrypoint=org.renpy.android.PythonActivity
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bootstrap.entrypoint=org.renpy.android.PythonActivity

distribute.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ function run_distribute() {
745745
debug "Copy default files"
746746
try cp -a $SRC_PATH/default.properties .
747747
try cp -a $SRC_PATH/local.properties .
748+
try cat $SRC_PATH/bootstrap.properties >> "local.properties"
748749
try cp -a $BOOTSTRAP_COMMON_PATH/build.py .
749750
try cp -a $BOOTSTRAP_COMMON_PATH/buildlib .
750751
try cp -a $BOOTSTRAP_COMMON_PATH/src .

0 commit comments

Comments
 (0)