@@ -38,6 +38,7 @@ struct Options
38
38
int timeoutSecs = 600 ; // 10 minutes
39
39
int resultsPullRetries = 3 ;
40
40
QString buildPath;
41
+ QString manifestPath;
41
42
QString adbCommand{" adb" _L1};
42
43
QString serial;
43
44
QString makeCommand;
@@ -137,6 +138,11 @@ static bool parseOptions()
137
138
g_options.helpRequested = true ;
138
139
else
139
140
g_options.buildPath = arguments.at (++i);
141
+ } else if (argument.compare (" --manifest" _L1, Qt::CaseInsensitive) == 0 ) {
142
+ if (i + 1 == arguments.size ())
143
+ g_options.helpRequested = true ;
144
+ else
145
+ g_options.manifestPath = arguments.at (++i);
140
146
} else if (argument.compare (" --make" _L1, Qt::CaseInsensitive) == 0 ) {
141
147
if (i + 1 == arguments.size ())
142
148
g_options.helpRequested = true ;
@@ -208,6 +214,9 @@ static bool parseOptions()
208
214
g_options.ndkStackPath = ndkStackPath;
209
215
}
210
216
217
+ if (g_options.manifestPath .isEmpty ())
218
+ g_options.manifestPath = g_options.buildPath + " /AndroidManifest.xml" _L1;
219
+
211
220
return true ;
212
221
}
213
222
@@ -254,6 +263,8 @@ static void printHelp()
254
263
" --pre-test-adb-command <command>: call the adb <command> after\n "
255
264
" installation and before the test run.\n "
256
265
" \n "
266
+ " --manifest <path>: Custom path to the AndroidManifest.xml.\n "
267
+ " \n "
257
268
" --help: Displays this information.\n " ,
258
269
qPrintable (QCoreApplication::arguments ().at (0 ))
259
270
);
@@ -860,14 +871,13 @@ int main(int argc, char *argv[])
860
871
861
872
g_testInfo.userId = userId ();
862
873
863
- QString manifest = g_options.buildPath + " /AndroidManifest.xml" _L1;
864
- if (!QFile::exists (manifest)) {
865
- qCritical (" Unable to find '%s'." , qPrintable (manifest));
874
+ if (!QFile::exists (g_options.manifestPath )) {
875
+ qCritical (" Unable to find '%s'." , qPrintable (g_options.manifestPath ));
866
876
return EXIT_ERROR;
867
877
}
868
- g_options.package = packageNameFromAndroidManifest (manifest );
878
+ g_options.package = packageNameFromAndroidManifest (g_options. manifestPath );
869
879
if (g_options.activity .isEmpty ())
870
- g_options.activity = activityFromAndroidManifest (manifest );
880
+ g_options.activity = activityFromAndroidManifest (g_options. manifestPath );
871
881
872
882
// parseTestArgs depends on g_options.package
873
883
if (!parseTestArgs ())
0 commit comments