diff --git a/products/nativescript/tns.py b/products/nativescript/tns.py index 7d87952e..19d86520 100644 --- a/products/nativescript/tns.py +++ b/products/nativescript/tns.py @@ -318,10 +318,10 @@ def prepare_ios(app_name, release=False, for_device=False, log_trace=False, veri @staticmethod def build(app_name, platform, release=False, provision=Settings.IOS.PROVISIONING, for_device=False, bundle=True, - aot=False, uglify=False, snapshot=False, log_trace=False, verify=True, app_data=None): + aot=False, uglify=False, source_map=False, snapshot=False, log_trace=False, verify=True, app_data=None): result = Tns.exec_command(command='build', path=app_name, platform=platform, release=release, provision=provision, for_device=for_device, bundle=bundle, aot=aot, uglify=uglify, - snapshot=snapshot, wait=True, log_trace=log_trace) + source_map=source_map, snapshot=snapshot, wait=True, log_trace=log_trace) if verify: # Verify output assert result.exit_code == 0, 'Build failed with non zero exit code.' @@ -344,10 +344,11 @@ def build(app_name, platform, release=False, provision=Settings.IOS.PROVISIONING return result @staticmethod - def build_android(app_name, release=False, bundle=True, aot=False, uglify=False, snapshot=False, log_trace=False, - verify=True, app_data=None): + def build_android(app_name, release=False, bundle=True, aot=False, source_map=False, uglify=False, snapshot=False, + log_trace=False, verify=True, app_data=None): return Tns.build(app_name=app_name, platform=Platform.ANDROID, release=release, bundle=bundle, aot=aot, - uglify=uglify, snapshot=snapshot, log_trace=log_trace, verify=verify, app_data=app_data) + source_map=source_map, uglify=uglify, snapshot=snapshot, log_trace=log_trace, verify=verify, + app_data=app_data) @staticmethod def build_ios(app_name, release=False, provision=Settings.IOS.PROVISIONING, for_device=False, diff --git a/tests/cli/build/build_tests.py b/tests/cli/build/build_tests.py index 42cc3acb..beadefa6 100644 --- a/tests/cli/build/build_tests.py +++ b/tests/cli/build/build_tests.py @@ -93,7 +93,7 @@ def test_001_build_android(self): assert result.output.count("Gradle build...") == 1, "More than 1 gradle build is triggered." def test_002_build_android_release(self): - Tns.build_android(self.app_name, release=True) + Tns.build_android(self.app_name, release=True, source_map=True, uglify=True, aot=True) # Configs are respected assert File.exists(TnsPaths.get_apk_path(self.app_name, release=True)) @@ -103,6 +103,12 @@ def test_002_build_android_release(self): run(cmd=command, cwd=Settings.TEST_RUN_HOME, wait=True) assert File.exists(os.path.join(self.app_path, 'app', 'app.tar.gz')) + def test_100_build_snapshot_uglify_release_aot_sourceMap(self): + #https://github.com/NativeScript/nativescript-dev-webpack/issues/920 + result = Tns.build_android(self.app_name, release=True, aot=True, uglify=True, snapshot=True, source_map=True) + assert not "ERROR in NativeScriptSnapshot. Snapshot generation failed!" in result.output + assert not "Target architecture: arm64-v8a" in result.output + def test_301_build_project_with_space_release(self): # Ensure ANDROID_KEYSTORE_PATH contain spaces (verification for CLI issue 2650)