@@ -348,13 +348,16 @@ def prepare_ios(attributes={}, assert_success=True, log_trace=False, tns_path=No
348
348
return output
349
349
350
350
@staticmethod
351
- def build_android (attributes = {}, assert_success = True , tns_path = None ):
352
- output = Tns .run_tns_command ("build android" , attributes = attributes , tns_path = tns_path )
351
+ def build_android (attributes = {}, assert_success = True , tns_path = None , log_trace = False ):
352
+ output = Tns .run_tns_command ("build android" , attributes = attributes , tns_path = tns_path , log_trace = log_trace )
353
353
if assert_success :
354
354
# Verify output of build command
355
- assert "BUILD SUCCESSFUL" in output , "Build failed!" + os .linesep + output
356
355
assert "Project successfully built" in output , "Build failed!" + os .linesep + output
357
356
assert "NOT FOUND" not in output # Test for https://github.com/NativeScript/android-runtime/issues/390
357
+ if log_trace :
358
+ assert "BUILD SUCCESSFUL" in output , "Build failed!" + os .linesep + output
359
+ else :
360
+ assert "BUILD SUCCESSFUL" not in output , "Native build out is displayed even without --log trace"
358
361
359
362
# Verify apk packages
360
363
app_name = Tns .__get_app_name_from_attributes (attributes = attributes )
@@ -397,6 +400,9 @@ def build_ios(attributes={}, assert_success=True, tns_path=None, log_trace=False
397
400
if log_trace :
398
401
assert "BUILD SUCCEEDED" in output
399
402
assert "CodeSign" in output
403
+ else :
404
+ assert "BUILD SUCCEEDED" not in output , "Native build out is displayed even without --log trace"
405
+ assert "CodeSign" not in output , "Native build out is displayed even without --log trace"
400
406
401
407
# Verify release/debug builds
402
408
if "--release" in attributes .keys ():
@@ -416,6 +422,9 @@ def build_ios(attributes={}, assert_success=True, tns_path=None, log_trace=False
416
422
assert "build/device/" + app_id + ".app" in output
417
423
assert "ARCHIVE SUCCEEDED" in output
418
424
assert "EXPORT SUCCEEDED" in output
425
+ else :
426
+ assert "ARCHIVE SUCCEEDED" not in output , "Native build out is displayed even without --log trace"
427
+ assert "EXPORT SUCCEEDED" not in output , "Native build out is displayed even without --log trace"
419
428
assert File .exists (device_folder + app_id + ".ipa" ), "IPA file not found!"
420
429
bundle_content = File .read (device_folder + app_id + ".app/" + app_id )
421
430
xcode_project = Tns .__get_xcode_project_file (app_name )
@@ -427,6 +436,9 @@ def build_ios(attributes={}, assert_success=True, tns_path=None, log_trace=False
427
436
else :
428
437
if log_trace :
429
438
assert "build/emulator/" + app_id + ".app" in output
439
+ else :
440
+ assert "build/emulator/" + app_id + ".app" not in output , \
441
+ "Native build out is displayed even without --log trace"
430
442
assert File .exists (app_name + "/platforms/ios/" + app_id + "/" + app_id + "-Prefix.pch" )
431
443
assert File .exists (emu_folder + app_id + ".app" )
432
444
bundle_content = File .read (emu_folder + app_id + ".app/" + app_id )
0 commit comments