Skip to content

Commit b56460b

Browse files
dbnicholsonrtibbles
authored andcommitted
Handle default on-device test app options correctly
Now that the on-device test app is configured to build an AAB and AAR in addition to an APK, looking at the default options for the for the APK might be wrong. Try to figure out the target before looking at the options.
1 parent d44c481 commit b56460b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

testapps/on_device_unit_tests/setup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,16 @@
7878
}
7979
}
8080

81+
# Try to figure out the build target so we know the default options that
82+
# will be used.
83+
target = 'apk'
84+
for arg in sys.argv:
85+
if arg in options:
86+
target = arg
87+
break
88+
8189
# check if we overwrote the default test_app requirements via `cli`
82-
requirements = options['apk']['requirements'].rsplit(',')
90+
requirements = options[target]['requirements'].rsplit(',')
8391
for n, arg in enumerate(sys.argv):
8492
if arg == '--requirements':
8593
print('found requirements')
@@ -89,7 +97,7 @@
8997
# remove `orientation` in case that we don't detect a kivy or flask app,
9098
# since the `service_only` bootstrap does not support such argument
9199
if not ({'kivy', 'flask'} & set(requirements)):
92-
options['apk'].pop('orientation')
100+
options[target].pop('orientation', None)
93101

94102
# write a file to let the test_app know which requirements we want to test
95103
# Note: later, when running the app, we will guess if we have the right test.

0 commit comments

Comments
 (0)