Explorar o código

Add android monolithic to sdk (#18271)

* Add additional android monolithic jobs to the windows install config and add android-api to the monolithic variant
* Remove API level sublevel and add Android ProjectBuilder and ProjectGenerator files to the install
* Fixes to support monolithic non-host files in the cmake
* Add android linux support for the linux installer
* Remove android profile from install pipe for windows and linux. Fix windows mono api level
* Fix builtin 3rd party package permutation files for installed non-host platforms
* Add SDK Installer restrictions on monolithic builds
* Make sure android exports from the SDK are release-monolithic only
* Fix missing LY_NDK_DIR for the windows node and fix unit tests
* Update scripts/build/Platform/Linux/build_config.json
* Remove linux snap package jobs
* Fix LY_NDK_DIR to set as a fixed value based on the value in install-windows-android.ps1

Co-authored-by: Mike Chang <[email protected]>
Signed-off-by: Steve Pham <[email protected]>
Steve Pham hai 1 ano
pai
achega
31c64ef8f4

+ 12 - 0
Code/Framework/AzAndroid/CMakeLists.txt

@@ -0,0 +1,12 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+ly_install_directory(
+    DIRECTORIES
+        java
+)

+ 1 - 0
Code/Framework/CMakeLists.txt

@@ -6,6 +6,7 @@
 #
 #
 #
 #
 
 
+add_subdirectory(AzAndroid)
 add_subdirectory(AtomCore)
 add_subdirectory(AtomCore)
 add_subdirectory(AzCore)
 add_subdirectory(AzCore)
 add_subdirectory(AzQtComponents)
 add_subdirectory(AzQtComponents)

+ 13 - 0
Code/Tools/Android/CMakeLists.txt

@@ -0,0 +1,13 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+ly_install_directory(
+    DIRECTORIES
+        ProjectBuilder
+        ProjectGenerator
+)

+ 1 - 0
Code/Tools/CMakeLists.txt

@@ -20,3 +20,4 @@ add_subdirectory(LuaIDE)
 add_subdirectory(TestImpactFramework)
 add_subdirectory(TestImpactFramework)
 add_subdirectory(ProjectManager)
 add_subdirectory(ProjectManager)
 add_subdirectory(BundleLauncher)
 add_subdirectory(BundleLauncher)
+add_subdirectory(Android)

+ 14 - 6
cmake/Platform/Common/Install_common.cmake

@@ -519,7 +519,11 @@ function(ly_setup_subdirectory absolute_target_source_dir)
     # 1. Create the base CMakeLists.txt that will just include a cmake file per platform
     # 1. Create the base CMakeLists.txt that will just include a cmake file per platform
     string(CONFIGURE [[
     string(CONFIGURE [[
 @cmake_copyright_comment@
 @cmake_copyright_comment@
-include(Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
+if(LY_MONOLITHIC_GAME)
+    include(Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake OPTIONAL)
+else()
+    include(Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
+endif()
 ]] subdirectory_cmakelist_content @ONLY)
 ]] subdirectory_cmakelist_content @ONLY)
 
 
     # Store off the generated CMakeLists.txt into a DIRECTORY property based on the subdirectory being visited
     # Store off the generated CMakeLists.txt into a DIRECTORY property based on the subdirectory being visited
@@ -750,14 +754,14 @@ ${find_subdirectories}
         COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}
         COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}
     )
     )
 
 
-    set(pal_builtin_file ${CMAKE_CURRENT_BINARY_DIR}/cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}${LY_HOST_ARCHITECTURE_NAME_EXTENSION}.cmake)
+    set(pal_builtin_file ${CMAKE_CURRENT_BINARY_DIR}/cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}${LY_ARCHITECTURE_NAME_EXTENSION}.cmake)
     file(GENERATE OUTPUT ${pal_builtin_file}
     file(GENERATE OUTPUT ${pal_builtin_file}
         CONTENT
         CONTENT
 "# Generated by O3DE install\n
 "# Generated by O3DE install\n
 if(LY_MONOLITHIC_GAME)
 if(LY_MONOLITHIC_GAME)
-    include(cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/Monolithic/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}${LY_HOST_ARCHITECTURE_NAME_EXTENSION}.cmake)
+    include(cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/Monolithic/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}${LY_ARCHITECTURE_NAME_EXTENSION}.cmake)
 else()
 else()
-    include(cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/Default/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}${LY_HOST_ARCHITECTURE_NAME_EXTENSION}.cmake)
+    include(cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/Default/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}${LY_ARCHITECTURE_NAME_EXTENSION}.cmake)
 endif()
 endif()
 "
 "
     )
     )
@@ -786,7 +790,7 @@ endif()
         string(APPEND builtinpackages "${builtin_packages_inject_code}\n")
         string(APPEND builtinpackages "${builtin_packages_inject_code}\n")
     endif()
     endif()
 
 
-    set(permutation_builtin_file ${CMAKE_CURRENT_BINARY_DIR}/cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}${LY_HOST_ARCHITECTURE_NAME_EXTENSION}.cmake)
+    set(permutation_builtin_file ${CMAKE_CURRENT_BINARY_DIR}/cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}${LY_ARCHITECTURE_NAME_EXTENSION}.cmake)
     file(GENERATE OUTPUT ${permutation_builtin_file}
     file(GENERATE OUTPUT ${permutation_builtin_file}
         CONTENT "${builtinpackages}"
         CONTENT "${builtinpackages}"
     )
     )
@@ -1025,7 +1029,11 @@ function(ly_setup_assets)
                     @cmake_copyright_comment@
                     @cmake_copyright_comment@
                     o3de_read_json_key(GEM_TYPE ${CMAKE_CURRENT_SOURCE_DIR}/gem.json "type")
                     o3de_read_json_key(GEM_TYPE ${CMAKE_CURRENT_SOURCE_DIR}/gem.json "type")
                     if (GEM_TYPE STREQUAL "Asset")
                     if (GEM_TYPE STREQUAL "Asset")
-                        include(Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
+                        if(LY_MONOLITHIC_GAME)
+                            include(Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake OPTIONAL)                    
+                        else()
+                            include(Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
+                        endif()
                     endif()
                     endif()
                     ]] subdirectory_cmakelist_content @ONLY)
                     ]] subdirectory_cmakelist_content @ONLY)
                     
                     

+ 26 - 27
scripts/build/Platform/Linux/build_config.json

@@ -400,46 +400,45 @@
       "CMAKE_TARGET": "install"
       "CMAKE_TARGET": "install"
     }
     }
   },
   },
-  "installer_pipe": {
-    "TAGS": [
-      "periodic-clean-weekly-internal",
-      "nightly-installer"
-    ],
-    "steps": [
-      "install_mono_22_release",
-      "installer"
-    ]
-  },
-  "installer": {
+  "install_mono_android_api_24_profile": {
     "TAGS": [],
     "TAGS": [],
     "PIPELINE_ENV": {
     "PIPELINE_ENV": {
-      "NODE_LABEL": "ubuntu-20-packaging"
+      "NODE_LABEL":"ubuntu-22-packaging"
     },
     },
-    "COMMAND": "build_installer_linux.sh",
+    "COMMAND": "build_linux.sh",
     "PARAMETERS": {
     "PARAMETERS": {
       "CONFIGURATION": "profile",
       "CONFIGURATION": "profile",
-      "OUTPUT_DIRECTORY": "build/linux",
-      "O3DE_PACKAGE_TYPE": "DEB",
-      "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_PARALLEL_LINK_JOBS=4 -DLY_DISABLE_TEST_MODULES=TRUE -DO3DE_INSTALL_ENGINE_NAME=o3de-sdk -DLY_STRIP_DEBUG_SYMBOLS=TRUE",
-      "EXTRA_CMAKE_OPTIONS": "-DLY_INSTALLER_AUTO_GEN_TAG=TRUE -DLY_INSTALLER_DOWNLOAD_URL=${INSTALLER_DOWNLOAD_URL} -DLY_INSTALLER_LICENSE_URL=${INSTALLER_DOWNLOAD_URL}/license -DO3DE_INCLUDE_INSTALL_IN_PACKAGE=TRUE",
-      "CPACK_OPTIONS": "-D CPACK_UPLOAD_URL=${CPACK_UPLOAD_URL}",
-      "CMAKE_TARGET": "all"
+      "OUTPUT_DIRECTORY": "build/android_api_mono",
+      "CMAKE_OPTIONS":"-G 'Ninja Multi-Config' -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/Android/Toolchain_android.cmake -DLY_MONOLITHIC_GAME=TRUE -DLY_DISABLE_TEST_MODULES=TRUE -DANDROID_NATIVE_API_LEVEL=24 -DLY_NDK_DIR=\"${LY_NDK_DIR}\"",
+      "CMAKE_TARGET": "install"
+    }
+  },
+  "install_mono_android_api_24_release": {
+    "TAGS": [],
+    "PIPELINE_ENV": {
+      "NODE_LABEL":"ubuntu-22-packaging"
+    },
+    "COMMAND": "build_linux.sh",
+    "PARAMETERS": {
+      "CONFIGURATION": "release",
+      "OUTPUT_DIRECTORY": "build/android_api_mono",
+      "CMAKE_OPTIONS":"-G 'Ninja Multi-Config' -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/Android/Toolchain_android.cmake -DLY_MONOLITHIC_GAME=TRUE -DLY_DISABLE_TEST_MODULES=TRUE -DANDROID_NATIVE_API_LEVEL=24 -DLY_NDK_DIR=\"${LY_NDK_DIR}\"",
+      "CMAKE_TARGET": "install"
     }
     }
   },
   },
-  "snap_pipe": {
+  "installer_pipe": {
     "TAGS": [
     "TAGS": [
       "periodic-clean-weekly-internal",
       "periodic-clean-weekly-internal",
       "nightly-installer"
       "nightly-installer"
     ],
     ],
     "steps": [
     "steps": [
       "install_mono_22_release",
       "install_mono_22_release",
-      "snap_package"
+      "install_mono_android_api_24_release",
+      "installer"
     ]
     ]
   },
   },
-  "snap_package": {
-    "TAGS": [
-      "periodic-clean-weekly-internal"
-    ],
+  "installer": {
+    "TAGS": [],
     "PIPELINE_ENV": {
     "PIPELINE_ENV": {
       "NODE_LABEL": "ubuntu-22-packaging"
       "NODE_LABEL": "ubuntu-22-packaging"
     },
     },
@@ -447,9 +446,9 @@
     "PARAMETERS": {
     "PARAMETERS": {
       "CONFIGURATION": "profile",
       "CONFIGURATION": "profile",
       "OUTPUT_DIRECTORY": "build/linux",
       "OUTPUT_DIRECTORY": "build/linux",
-      "O3DE_PACKAGE_TYPE": "SNAP",
+      "O3DE_PACKAGE_TYPE": "DEB",
       "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_PARALLEL_LINK_JOBS=4 -DLY_DISABLE_TEST_MODULES=TRUE -DO3DE_INSTALL_ENGINE_NAME=o3de-sdk -DLY_STRIP_DEBUG_SYMBOLS=TRUE",
       "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_PARALLEL_LINK_JOBS=4 -DLY_DISABLE_TEST_MODULES=TRUE -DO3DE_INSTALL_ENGINE_NAME=o3de-sdk -DLY_STRIP_DEBUG_SYMBOLS=TRUE",
-      "EXTRA_CMAKE_OPTIONS": "-DO3DE_INCLUDE_INSTALL_IN_PACKAGE=TRUE",
+      "EXTRA_CMAKE_OPTIONS": "-DLY_INSTALLER_AUTO_GEN_TAG=TRUE -DLY_INSTALLER_DOWNLOAD_URL=${INSTALLER_DOWNLOAD_URL} -DLY_INSTALLER_LICENSE_URL=${INSTALLER_DOWNLOAD_URL}/license -DO3DE_INCLUDE_INSTALL_IN_PACKAGE=TRUE",
       "CPACK_OPTIONS": "-D CPACK_UPLOAD_URL=${CPACK_UPLOAD_URL}",
       "CPACK_OPTIONS": "-D CPACK_UPLOAD_URL=${CPACK_UPLOAD_URL}",
       "CMAKE_TARGET": "all"
       "CMAKE_TARGET": "all"
     }
     }

+ 29 - 0
scripts/build/Platform/Windows/build_config.json

@@ -470,6 +470,7 @@
     ],
     ],
     "steps": [
     "steps": [
       "install_mono_release",
       "install_mono_release",
+      "install_mono_android_api_24_release",
       "installer",
       "installer",
       "installer_test"
       "installer_test"
     ]
     ]
@@ -582,5 +583,33 @@
     "PARAMETERS": {
     "PARAMETERS": {
       "CDK_VERSION": "2.68.0"
       "CDK_VERSION": "2.68.0"
     }
     }
+  },
+  "install_mono_android_api_24_release": {
+    "TAGS": [],
+    "PIPELINE_ENV": {
+      "NODE_LABEL":"windows-packaging"
+    },
+    "COMMAND": "build_windows.cmd",
+    "PARAMETERS": {
+      "CONFIGURATION": "release",
+      "OUTPUT_DIRECTORY": "build\\android_api_mono",
+      "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DLY_MONOLITHIC_GAME=TRUE -DLY_DISABLE_TEST_MODULES=TRUE -DANDROID_NATIVE_API_LEVEL=24 -DLY_NDK_DIR=\"C:/AndroidSdk/ndk/25.1.8937393\"",
+      "CMAKE_TARGET": "install",
+      "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!"
+    }
+  },
+  "install_mono_android_api_24_profile": {
+    "TAGS": [],
+    "PIPELINE_ENV": {
+      "NODE_LABEL":"windows-packaging"
+    },
+    "COMMAND": "build_windows.cmd",
+    "PARAMETERS": {
+      "CONFIGURATION": "profile",
+      "OUTPUT_DIRECTORY": "build\\android_api_mono",
+      "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DLY_MONOLITHIC_GAME=TRUE -DLY_DISABLE_TEST_MODULES=TRUE -DANDROID_NATIVE_API_LEVEL=24 -DLY_NDK_DIR=\"C:/AndroidSdk/ndk/25.1.8937393\"",
+      "CMAKE_TARGET": "install",
+      "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!"
+    }
   }
   }
 }
 }

+ 62 - 0
scripts/build/build_node/Platform/Linux/install-ubuntu-android-tools.sh

@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# This script must be run as root
+if [[ $EUID -ne 0 ]]
+then
+    echo "This script must be run as root (sudo)"
+    exit 1
+fi
+
+#
+# Make sure we are installing on a supported ubuntu distro
+#
+lsb_release -c >/dev/null 2>&1
+if [ $? -ne 0 ]
+then
+    echo This script is only supported on Ubuntu Distros
+    exit 1
+fi
+
+#
+# Install the necessary tools to download, install, and run the android tools
+#
+apt install -y openjdk-11-jdk unzip wget
+
+mkdir /opt/android-sdk-linux
+wget -q https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip -O /tmp/commandlinetools-linux.zip
+if [ $? -ne 0 ]
+then
+    echo "Error downloading the Android command line tools"
+    exit 1
+fi
+
+unzip /tmp/commandlinetools-linux.zip -d /opt/android-sdk-linux/cmdline-tools
+if [ $? -ne 0 ]
+then
+    echo "Error extracting the Android command line tools to /opt/android-sdk-linux/cmdline-tools"
+    exit 1
+fi
+rm -f /tmp/commandlinetools-linux.zip
+
+for i in "cmdline-tools;latest" "build-tools;30.0.2" "platform-tools" "platforms;android-24" "ndk;25.2.9519653"
+do
+    echo "Installing official $i"
+    yes | /opt/android-sdk-linux/cmdline-tools/tools/bin/sdkmanager --install "$i"
+    if [ $? -ne 0 ]
+    then
+        echo "Error installing '$i'"
+        exit 1
+    fi
+done
+
+# Add the path and necessary environment variable to build android based on NDK 25.2.9519653
+echo 'export PATH="$PATH:/opt/android-sdk-linux/cmdline-tools/latest/bin/"' > /etc/profile.d/android-env.sh
+echo "export LY_NDK_DIR=/opt/android-sdk-linux/ndk/25.2.9519653" >> /etc/profile.d/android-env.sh
+chmod a+x /etc/profile.d/android-env.sh
+

+ 8 - 0
scripts/build/build_node/Platform/Linux/install-ubuntu.sh

@@ -55,6 +55,14 @@ then
     exit 1
     exit 1
 fi
 fi
 
 
+# Install the necessary build tools for android on linux
+./install-ubuntu-build-android-tools.sh
+if [ $? -ne 0 ]
+then
+    echo Error installing ubuntu android tools
+    exit 1
+fi
+
 # Install the packages in the platform list
 # Install the packages in the platform list
 ./install-ubuntu-packages.sh
 ./install-ubuntu-packages.sh
 if [ $? -ne 0 ]
 if [ $? -ne 0 ]

+ 2 - 0
scripts/build/build_node/Platform/Windows/install-windows-android.ps1

@@ -21,6 +21,8 @@ Start-Process -FilePath $sdkmanager -ArgumentList $android_packages -NoNewWindow
 Start-Process -FilePath $sdkmanager -ArgumentList $googleplay_packages -NoNewWindow -Wait
 Start-Process -FilePath $sdkmanager -ArgumentList $googleplay_packages -NoNewWindow -Wait
 Start-Process -FilePath $sdkmanager -ArgumentList $build_tools -NoNewWindow -Wait
 Start-Process -FilePath $sdkmanager -ArgumentList $build_tools -NoNewWindow -Wait
 Start-Process -FilePath $sdkmanager -ArgumentList $ndk -NoNewWindow -Wait
 Start-Process -FilePath $sdkmanager -ArgumentList $ndk -NoNewWindow -Wait
+# Set the NDK environment
+[Environment]::SetEnvironmentVariable("LY_NDK_DIR", "C:\AndroidSdk\ndk\25.1.8937393", [EnvironmentVariableTarget]::Machine)
 
 
 Write-Host "Installing Gradle"
 Write-Host "Installing Gradle"
 $gradle_version = '7.0'
 $gradle_version = '7.0'

+ 11 - 0
scripts/o3de/ExportScripts/export_source_android.py

@@ -47,6 +47,17 @@ def export_source_android_project(ctx: exp.O3DEScriptExportContext,
 
 
     is_installer_sdk = manifest.is_sdk_engine(engine_path=ctx.engine_path)
     is_installer_sdk = manifest.is_sdk_engine(engine_path=ctx.engine_path)
 
 
+    # For installed SDKs, only the release monolithic android artifacts are installed with the SDK
+    if is_installer_sdk:
+        # Make sure monolithic artifacts are present
+        if not exp.has_monolithic_artifacts(ctx):
+            logger.error("No monolithic artifacts are detected in the engine installation.")
+            raise exp.ExportProjectError("Trying to build monolithic without libraries.")
+
+        if build_config != exp.BUILD_CONFIG_RELEASE:
+            logger.warning("Only release packages are supported for Android in the O3DE SDK.")
+        build_config = exp.BUILD_CONFIG_RELEASE
+
     android_arg_parser = argparse.ArgumentParser()
     android_arg_parser = argparse.ArgumentParser()
     android_subparser = android_arg_parser.add_subparsers(title="Android sub-commands")
     android_subparser = android_arg_parser.add_subparsers(title="Android sub-commands")
     android.add_args(android_subparser)
     android.add_args(android_subparser)

+ 18 - 5
scripts/o3de/ExportScripts/export_source_built_project.py

@@ -96,12 +96,25 @@ def export_standalone_project(ctx: exp.O3DEScriptExportContext,
     # Calculate the tools and game build paths
     # Calculate the tools and game build paths
     default_base_path = ctx.engine_path if engine_centric else ctx.project_path
     default_base_path = ctx.engine_path if engine_centric else ctx.project_path
     
     
+    # For installed SDKs, the monolithic option depends on the build configuration that is selected since only profile shared objects and release static libraries
+    # are produced. Debug is not allowed.
     if is_installer_sdk:
     if is_installer_sdk:
-        # Check if we have any monolithic entries if building monolithic
-        if monolithic_build and not exp.has_monolithic_artifacts(ctx):
-            logger.error("Trying to create monolithic build, but no monolithic artifacts are detected in the engine installation! Please re-run the script with '--non-monolithic' and '-config profile'.")
-            raise exp.ExportProjectError("Trying to build monolithic without libraries.")
-    
+        if build_config == exp.BUILD_CONFIG_DEBUG:
+            raise exp.ExportProjectError("Exporting debug projects not supported with the O3DE SDK.")
+
+        if build_config == exp.BUILD_CONFIG_RELEASE:
+
+            # Check if we have any monolithic entries if building monolithic
+            if not exp.has_monolithic_artifacts(ctx):
+                logger.error("No monolithic artifacts are detected in the engine installation.")
+                raise exp.ExportProjectError("Trying to build monolithic without libraries.")
+
+            logger.info(f"Preparing monolithic build for export.")
+            monolithic_build = True
+
+        else:
+            logger.info(f"Preparing non-monolithic build for export.")
+            monolithic_build = False
     
     
     if not launcher_build_path:
     if not launcher_build_path:
         launcher_build_path = default_base_path / 'build/launcher'
         launcher_build_path = default_base_path / 'build/launcher'

+ 11 - 4
scripts/o3de/o3de/ui/export_project.py

@@ -347,7 +347,10 @@ class MainWindow(tkp.Tk):
         project_build_options_frame.columnconfigure(1, weight=1)
         project_build_options_frame.columnconfigure(1, weight=1)
         project_build_options_frame.grid(padx=8, sticky=tk.EW)
         project_build_options_frame.grid(padx=8, sticky=tk.EW)
 
 
-        build_config_choices = ['debug', 'profile', 'release']
+        build_config_choices = ['profile', 'release']
+        if not self.is_sdk:
+            build_config_choices.insert(0, 'debug')
+
         self.add_dropdown_entry(parent=project_build_options_frame,
         self.add_dropdown_entry(parent=project_build_options_frame,
                                 label_text='Project Build Configuration',
                                 label_text='Project Build Configuration',
                                 config_key='project.build.config',
                                 config_key='project.build.config',
@@ -429,9 +432,13 @@ class MainWindow(tkp.Tk):
                                   row_number=1,
                                   row_number=1,
                                   column_number=1)
                                   column_number=1)
         
         
-        self.add_labeled_checkbox(parent=pc_build_options_frame,
-                                  label_text="Build Monolithic",
-                                  config_key='option.build.monolithic')
+        # For pre-built SDKs builds, the monolithic build are determined by whether or not the 
+        # build configuration is profile (false) or release (true), so only display the option
+        # for source builds
+        if not self.is_sdk:
+            self.add_labeled_checkbox(parent=pc_build_options_frame,
+                                      label_text="Build Monolithic",
+                                      config_key='option.build.monolithic')
         
         
         self.add_labeled_checkbox(parent=pc_build_options_frame,
         self.add_labeled_checkbox(parent=pc_build_options_frame,
                                   label_text='Allow Asset Processor Registry Overrides',
                                   label_text='Allow Asset Processor Registry Overrides',

+ 189 - 177
scripts/o3de/tests/ExportScripts/test_export_source_android.py

@@ -10,7 +10,7 @@ import logging
 import pytest
 import pytest
 import pathlib
 import pathlib
 from unittest.mock import patch, create_autospec, MagicMock, Mock, PropertyMock
 from unittest.mock import patch, create_autospec, MagicMock, Mock, PropertyMock
-from o3de.export_project import O3DEScriptExportContext
+from o3de.export_project import O3DEScriptExportContext, ExportProjectError
 from o3de.command_utils import O3DEConfig
 from o3de.command_utils import O3DEConfig
 
 
 # Because the export scripts are standalone, we have to manually import them to test
 # Because the export scripts are standalone, we have to manually import them to test
@@ -314,52 +314,56 @@ def test_build_tool_combinations(tmp_path, use_sdk, should_build_tools_flag, has
         mock_ctx.project_path = test_project_path
         mock_ctx.project_path = test_project_path
         mock_ctx.engine_path = test_engine_path
         mock_ctx.engine_path = test_engine_path
         mock_ctx.project_name = test_project_name
         mock_ctx.project_name = test_project_name
-        for base_path in [None, test_o3de_base_path, test_absolute_base_path, test_relative_base_path]:
 
 
-            if base_path:
-                test_tools_build_path = (base_path / "build" / 'tools') 
+        try:
+            for base_path in [None, test_o3de_base_path, test_absolute_base_path, test_relative_base_path]:
 
 
-                if test_tools_build_path.is_absolute():
-                    test_tools_build_path.mkdir(parents=True)
-                    
-            else:
-                test_tools_build_path = None
+                if base_path:
+                    test_tools_build_path = (base_path / "build" / 'tools')
 
 
-            buildconf = 'release'
-        
-            expa.export_source_android_project(mock_ctx,
-                            test_output_path,
-                            [],
-                            [],
-                            [],
-                            asset_pack_mode = 'PAK',
-                            engine_centric = is_engine_centric,
-                            should_build_tools = should_build_tools_flag,
-                            should_build_all_assets = True,
-                            build_config = buildconf,
-                            tool_config = 'profile',
-                            tools_build_path = test_tools_build_path,
-                            max_bundle_size = 2048,
-                            fail_on_asset_errors = False,
-                            deploy_to_device = False,
-                            logger=mock_logger)
-                
-            if expect_toolchain_build_called:
-                if not test_tools_build_path:
-                    test_tools_build_path = test_o3de_base_path / 'build/tools'
-                elif not test_tools_build_path.is_absolute():
-                    test_tools_build_path  = test_o3de_base_path / test_tools_build_path
-
-                mock_build_export_toolchain.assert_called_once_with(ctx=mock_ctx,
-                                                                    tools_build_path=test_tools_build_path,
-                                                                    engine_centric=is_engine_centric,
-                                                                    tool_config="profile",
-                                                                    logger=mock_logger)
-            else:
-                mock_build_export_toolchain.assert_not_called()
-                
-            
-            mock_build_export_toolchain.reset_mock()
+                    if test_tools_build_path.is_absolute():
+                        test_tools_build_path.mkdir(parents=True)
+
+                else:
+                    test_tools_build_path = None
+
+                buildconf = 'release'
+
+                expa.export_source_android_project(mock_ctx,
+                                test_output_path,
+                                [],
+                                [],
+                                [],
+                                asset_pack_mode = 'PAK',
+                                engine_centric = is_engine_centric,
+                                should_build_tools = should_build_tools_flag,
+                                should_build_all_assets = True,
+                                build_config = buildconf,
+                                tool_config = 'profile',
+                                tools_build_path = test_tools_build_path,
+                                max_bundle_size = 2048,
+                                fail_on_asset_errors = False,
+                                deploy_to_device = False,
+                                logger=mock_logger)
+
+                if expect_toolchain_build_called:
+                    if not test_tools_build_path:
+                        test_tools_build_path = test_o3de_base_path / 'build/tools'
+                    elif not test_tools_build_path.is_absolute():
+                        test_tools_build_path  = test_o3de_base_path / test_tools_build_path
+
+                    mock_build_export_toolchain.assert_called_once_with(ctx=mock_ctx,
+                                                                        tools_build_path=test_tools_build_path,
+                                                                        engine_centric=is_engine_centric,
+                                                                        tool_config="profile",
+                                                                        logger=mock_logger)
+                else:
+                    mock_build_export_toolchain.assert_not_called()
+
+
+                mock_build_export_toolchain.reset_mock()
+        except ExportProjectError:
+            assert not has_monolithic, "Error expected if we do not have monolithic binaries what requesting monolithic builds."
 
 
 
 
 @pytest.mark.parametrize("use_sdk", [True,False])
 @pytest.mark.parametrize("use_sdk", [True,False])
@@ -407,57 +411,62 @@ def test_asset_bundler_combinations(tmp_path, use_sdk, should_build_tools_flag,
         mock_ctx.project_path = test_project_path
         mock_ctx.project_path = test_project_path
         mock_ctx.engine_path = test_engine_path
         mock_ctx.engine_path = test_engine_path
         mock_ctx.project_name = test_project_name
         mock_ctx.project_name = test_project_name
-        for base_path in [None, test_o3de_base_path, test_absolute_base_path, test_relative_base_path]:
 
 
-            test_tools_build_path = None if not base_path else (base_path / "build" / "tools") 
+        try:
 
 
-            test_tools_sdk_path = (test_engine_path / 'bin/Windows/profile/Default')
-            
+            for base_path in [None, test_o3de_base_path, test_absolute_base_path, test_relative_base_path]:
 
 
-            if test_tools_build_path and test_tools_build_path.is_absolute():
-                test_tools_build_path.mkdir(exist_ok=True, parents=True)
+                test_tools_build_path = None if not base_path else (base_path / "build" / "tools")
 
 
-            buildconf = 'release'
-        
-            expa.export_source_android_project(mock_ctx,
-                            test_output_path,
-                            [],
-                            [],
-                            [],
-                            asset_pack_mode = 'PAK',
-                            engine_centric = is_engine_centric,
-                            should_build_tools = should_build_tools_flag,
-                            should_build_all_assets = True,
-                            build_config = buildconf,
-                            tool_config = 'profile',
-                            tools_build_path = test_tools_build_path,
-                            max_bundle_size = 2048,
-                            fail_on_asset_errors = False,
-                            deploy_to_device = False,
-                            logger=mock_logger)
-                
-            selected_tools_build_path = test_tools_build_path if not use_sdk else test_tools_sdk_path
-
-            if not selected_tools_build_path:
-                selected_tools_build_path = test_o3de_base_path / 'build/tools'
-            
-            if not selected_tools_build_path.is_absolute():
-                selected_tools_build_path = test_o3de_base_path / selected_tools_build_path
-            
-            mock_bundle_assets.assert_called_once_with(ctx=mock_ctx,
-                                                    selected_platforms=['android'],
-                                                    seedlist_paths=[],
-                                                    seedfile_paths=[],
-                                                    tools_build_path=selected_tools_build_path,
-                                                    engine_centric=is_engine_centric,
-                                                    asset_bundling_path=test_project_path/'AssetBundling',
-                                                    using_installer_sdk=use_sdk,
-                                                    tool_config='profile',
-                                                    max_bundle_size=2048)
-                    
-            mock_get_asset_bundler_path.reset_mock()
-            mock_bundle_assets.reset_mock()
-            mock_build_export_toolchain.reset_mock()
+                test_tools_sdk_path = (test_engine_path / 'bin/Windows/profile/Default')
+
+
+                if test_tools_build_path and test_tools_build_path.is_absolute():
+                    test_tools_build_path.mkdir(exist_ok=True, parents=True)
+
+                buildconf = 'release'
+
+                expa.export_source_android_project(mock_ctx,
+                                test_output_path,
+                                [],
+                                [],
+                                [],
+                                asset_pack_mode = 'PAK',
+                                engine_centric = is_engine_centric,
+                                should_build_tools = should_build_tools_flag,
+                                should_build_all_assets = True,
+                                build_config = buildconf,
+                                tool_config = 'profile',
+                                tools_build_path = test_tools_build_path,
+                                max_bundle_size = 2048,
+                                fail_on_asset_errors = False,
+                                deploy_to_device = False,
+                                logger=mock_logger)
+
+                selected_tools_build_path = test_tools_build_path if not use_sdk else test_tools_sdk_path
+
+                if not selected_tools_build_path:
+                    selected_tools_build_path = test_o3de_base_path / 'build/tools'
+
+                if not selected_tools_build_path.is_absolute():
+                    selected_tools_build_path = test_o3de_base_path / selected_tools_build_path
+
+                mock_bundle_assets.assert_called_once_with(ctx=mock_ctx,
+                                                        selected_platforms=['android'],
+                                                        seedlist_paths=[],
+                                                        seedfile_paths=[],
+                                                        tools_build_path=selected_tools_build_path,
+                                                        engine_centric=is_engine_centric,
+                                                        asset_bundling_path=test_project_path/'AssetBundling',
+                                                        using_installer_sdk=use_sdk,
+                                                        tool_config='profile',
+                                                        max_bundle_size=2048)
+
+                mock_get_asset_bundler_path.reset_mock()
+                mock_bundle_assets.reset_mock()
+                mock_build_export_toolchain.reset_mock()
+        except ExportProjectError:
+            assert not has_monolithic, "Error expected if we do not have monolithic binaries what requesting monolithic builds."
 
 
 
 
 @pytest.mark.parametrize("test_seedlists, test_seedfiles, test_levelnames",[
 @pytest.mark.parametrize("test_seedlists, test_seedfiles, test_levelnames",[
@@ -601,89 +610,92 @@ def test_asset_processor_combinations(tmp_path, use_sdk, should_build_tools_flag
         mock_ctx.project_path = test_project_path
         mock_ctx.project_path = test_project_path
         mock_ctx.engine_path = test_engine_path
         mock_ctx.engine_path = test_engine_path
         mock_ctx.project_name = test_project_name
         mock_ctx.project_name = test_project_name
-        for base_path in [None, test_o3de_base_path, test_absolute_base_path, test_relative_base_path]:
-
-            test_tools_build_path = None if not base_path else (base_path / "build" / "tools") 
-
-            test_tools_sdk_path = (test_engine_path / 'bin/Windows/profile/Default')
-
-            if test_tools_build_path and test_tools_build_path.is_absolute():
-                test_tools_build_path.mkdir(exist_ok=True, parents=True)
-
-            buildconf = 'release'
-
-            
-            expa.export_source_android_project(mock_ctx,
-                            test_output_path,
-                            [],
-                            [],
-                            [],
-                            asset_pack_mode = 'PAK',
-                            engine_centric = is_engine_centric,
-                            should_build_tools = should_build_tools_flag,
-                            should_build_all_assets = True,
-                            build_config = buildconf,
-                            tool_config = 'profile',
-                            tools_build_path = test_tools_build_path,
-                            max_bundle_size = 2048,
-                            fail_on_asset_errors = False,
-                            deploy_to_device = False,
-                            logger=mock_logger)
-                
-            selected_tools_build_path = test_tools_build_path if not use_sdk else test_tools_sdk_path
-
-            if not selected_tools_build_path:
-                selected_tools_build_path = test_o3de_base_path / 'build/tools'
-            
-            if not selected_tools_build_path.is_absolute():
-                selected_tools_build_path = test_o3de_base_path / selected_tools_build_path
-            
-            mock_get_asset_processor_path.assert_called_once_with(tools_build_path=selected_tools_build_path,
-                                                                    using_installer_sdk=use_sdk,
-                                                                    tool_config='profile',
-                                                                    required=True)
-                
-            mock_build_assets.assert_called_once_with(ctx=mock_ctx,
-                                                    tools_build_path=selected_tools_build_path,
-                                                    engine_centric=is_engine_centric,
-                                                    fail_on_ap_errors=False,
-                                                    using_installer_sdk=use_sdk,
-                                                    tool_config='profile',
-                                                    selected_platforms=['android'],
-                                                    logger=mock_logger)
-                    
-            mock_get_asset_processor_path.reset_mock()
-            mock_build_assets.reset_mock()
-
-            # now test when we skip asset building
-            
-            expa.export_source_android_project(mock_ctx,
-                            test_output_path,
-                            [],
-                            [],
-                            [],
-                            asset_pack_mode = 'PAK',
-                            engine_centric = is_engine_centric,
-                            should_build_tools = should_build_tools_flag,
-                            should_build_all_assets = False,
-                            build_config = buildconf,
-                            tool_config = 'profile',
-                            tools_build_path = test_tools_build_path,
-                            max_bundle_size = 2048,
-                            fail_on_asset_errors = False,
-                            deploy_to_device = False,
-                            logger=mock_logger)
-                
-            selected_tools_build_path = test_tools_build_path if not use_sdk else test_tools_sdk_path
-
-            if not selected_tools_build_path:
-                selected_tools_build_path = test_o3de_base_path / 'build/tools'
-            
-            if not selected_tools_build_path.is_absolute():
-                selected_tools_build_path = test_o3de_base_path / selected_tools_build_path
-            
-            mock_get_asset_processor_path.assert_not_called()
-            mock_build_assets.assert_not_called()
-                    
-            mock_get_asset_processor_path.reset_mock()
-            mock_build_assets.reset_mock()
+        try:
+            for base_path in [None, test_o3de_base_path, test_absolute_base_path, test_relative_base_path]:
+
+                test_tools_build_path = None if not base_path else (base_path / "build" / "tools")
+
+                test_tools_sdk_path = (test_engine_path / 'bin/Windows/profile/Default')
+
+                if test_tools_build_path and test_tools_build_path.is_absolute():
+                    test_tools_build_path.mkdir(exist_ok=True, parents=True)
+
+                buildconf = 'release'
+
+
+                expa.export_source_android_project(mock_ctx,
+                                test_output_path,
+                                [],
+                                [],
+                                [],
+                                asset_pack_mode = 'PAK',
+                                engine_centric = is_engine_centric,
+                                should_build_tools = should_build_tools_flag,
+                                should_build_all_assets = True,
+                                build_config = buildconf,
+                                tool_config = 'profile',
+                                tools_build_path = test_tools_build_path,
+                                max_bundle_size = 2048,
+                                fail_on_asset_errors = False,
+                                deploy_to_device = False,
+                                logger=mock_logger)
+
+                selected_tools_build_path = test_tools_build_path if not use_sdk else test_tools_sdk_path
+
+                if not selected_tools_build_path:
+                    selected_tools_build_path = test_o3de_base_path / 'build/tools'
+
+                if not selected_tools_build_path.is_absolute():
+                    selected_tools_build_path = test_o3de_base_path / selected_tools_build_path
+
+                mock_get_asset_processor_path.assert_called_once_with(tools_build_path=selected_tools_build_path,
+                                                                        using_installer_sdk=use_sdk,
+                                                                        tool_config='profile',
+                                                                        required=True)
+
+                mock_build_assets.assert_called_once_with(ctx=mock_ctx,
+                                                        tools_build_path=selected_tools_build_path,
+                                                        engine_centric=is_engine_centric,
+                                                        fail_on_ap_errors=False,
+                                                        using_installer_sdk=use_sdk,
+                                                        tool_config='profile',
+                                                        selected_platforms=['android'],
+                                                        logger=mock_logger)
+
+                mock_get_asset_processor_path.reset_mock()
+                mock_build_assets.reset_mock()
+
+                # now test when we skip asset building
+
+                expa.export_source_android_project(mock_ctx,
+                                test_output_path,
+                                [],
+                                [],
+                                [],
+                                asset_pack_mode = 'PAK',
+                                engine_centric = is_engine_centric,
+                                should_build_tools = should_build_tools_flag,
+                                should_build_all_assets = False,
+                                build_config = buildconf,
+                                tool_config = 'profile',
+                                tools_build_path = test_tools_build_path,
+                                max_bundle_size = 2048,
+                                fail_on_asset_errors = False,
+                                deploy_to_device = False,
+                                logger=mock_logger)
+
+                selected_tools_build_path = test_tools_build_path if not use_sdk else test_tools_sdk_path
+
+                if not selected_tools_build_path:
+                    selected_tools_build_path = test_o3de_base_path / 'build/tools'
+
+                if not selected_tools_build_path.is_absolute():
+                    selected_tools_build_path = test_o3de_base_path / selected_tools_build_path
+
+                mock_get_asset_processor_path.assert_not_called()
+                mock_build_assets.assert_not_called()
+
+                mock_get_asset_processor_path.reset_mock()
+                mock_build_assets.reset_mock()
+        except ExportProjectError:
+            assert not has_monolithic, "Error expected if we do not have monolithic binaries what requesting monolithic builds."

+ 55 - 145
scripts/o3de/tests/ExportScripts/test_export_source_built_project.py

@@ -8,8 +8,8 @@
 
 
 import pytest
 import pytest
 import pathlib
 import pathlib
-from unittest.mock import patch, create_autospec, MagicMock, Mock, PropertyMock
-from o3de.export_project import O3DEScriptExportContext, LauncherType
+from unittest.mock import patch, create_autospec, MagicMock, Mock, PropertyMock, ANY
+from o3de.export_project import ExportProjectError, O3DEScriptExportContext, LauncherType
 import logging
 import logging
 import configparser
 import configparser
 
 
@@ -139,21 +139,8 @@ def test_build_tools_combinations(tmp_path, is_engine_centric, use_sdk, should_b
             else:
             else:
                 test_tools_build_path = None
                 test_tools_build_path = None
 
 
-            cannot_build_monolithic = (use_sdk and not has_monolithic and use_monolithic)
             buildconf = 'release' if use_monolithic else 'profile'
             buildconf = 'release' if use_monolithic else 'profile'
-            if not expect_toolchain_build_called and cannot_build_monolithic:
-                pytest.raises(exp.ExportProjectError, export_standalone_project, 
-                              mock_ctx,
-                              mock_platform,
-                              test_output_path,
-                              should_build_tools_flag,
-                              buildconf,
-                              "profile",
-                              [],[],[],
-                              monolithic_build=use_monolithic,
-                              tools_build_path=test_tools_build_path,
-                              engine_centric=is_engine_centric)
-            else:
+            try:
                 export_standalone_project(mock_ctx,
                 export_standalone_project(mock_ctx,
                                         mock_platform,
                                         mock_platform,
                                         test_output_path,
                                         test_output_path,
@@ -178,7 +165,10 @@ def test_build_tools_combinations(tmp_path, is_engine_centric, use_sdk, should_b
                                                                         logger=mock_logger)
                                                                         logger=mock_logger)
                 else:
                 else:
                     mock_build_export_toolchain.assert_not_called()
                     mock_build_export_toolchain.assert_not_called()
-            
+                    
+            except ExportProjectError:
+                assert not has_monolithic, "Error expected if we do not have monolithic binaries what requesting monolithic builds."
+
             mock_build_export_toolchain.reset_mock()
             mock_build_export_toolchain.reset_mock()
 
 
 
 
@@ -249,29 +239,11 @@ def test_asset_bundler_combinations(tmp_path, is_engine_centric, use_sdk, has_mo
                 if test_tools_build_path and test_tools_build_path.is_absolute():
                 if test_tools_build_path and test_tools_build_path.is_absolute():
                     test_tools_build_path.mkdir(exist_ok=True, parents=True)
                     test_tools_build_path.mkdir(exist_ok=True, parents=True)
 
 
-                cannot_build_monolithic = (use_sdk and not has_monolithic and use_monolithic)
-
-
-                if cannot_build_monolithic:
-                    pytest.raises(exp.ExportProjectError, export_standalone_project,
-                                  mock_ctx,
-                                  mock_platform,
-                                  test_output_path,
-                                  should_build_tools, 
-                                  buildconf,
-                                  'profile',
-                                  [],[],[],
-                                  monolithic_build=use_monolithic,
-                                  engine_centric=is_engine_centric,
-                                  tools_build_path=test_tools_build_path,
-                                  asset_bundling_path=test_asset_bundling_path)
-                    mock_get_asset_bundler_path.assert_not_called()
-                    mock_bundle_assets.assert_not_called()
-                else:
+                try:
                     export_standalone_project(mock_ctx,
                     export_standalone_project(mock_ctx,
                                         mock_platform,
                                         mock_platform,
                                         test_output_path,
                                         test_output_path,
-                                        should_build_tools, 
+                                        should_build_tools,
                                         buildconf,
                                         buildconf,
                                         'profile',
                                         'profile',
                                         [],[],[],
                                         [],[],[],
@@ -283,18 +255,18 @@ def test_asset_bundler_combinations(tmp_path, is_engine_centric, use_sdk, has_mo
 
 
                     if not selected_tools_build_path:
                     if not selected_tools_build_path:
                         selected_tools_build_path = test_o3de_base_path / 'build/tools'
                         selected_tools_build_path = test_o3de_base_path / 'build/tools'
-                    
+
                     if not selected_tools_build_path.is_absolute():
                     if not selected_tools_build_path.is_absolute():
                         selected_tools_build_path = test_o3de_base_path / selected_tools_build_path
                         selected_tools_build_path = test_o3de_base_path / selected_tools_build_path
-                    
+
                     selected_asset_bundling_path = test_asset_bundling_path if test_asset_bundling_path else \
                     selected_asset_bundling_path = test_asset_bundling_path if test_asset_bundling_path else \
                                                         test_o3de_base_path / 'build/asset_bundling'
                                                         test_o3de_base_path / 'build/asset_bundling'
-                
+
                     if not selected_asset_bundling_path.is_absolute():
                     if not selected_asset_bundling_path.is_absolute():
                         selected_asset_bundling_path = test_o3de_base_path / selected_asset_bundling_path
                         selected_asset_bundling_path = test_o3de_base_path / selected_asset_bundling_path
 
 
                     mock_get_asset_bundler_path.assert_not_called()
                     mock_get_asset_bundler_path.assert_not_called()
-                    
+
                     mock_bundle_assets.assert_called_once_with(ctx=mock_ctx,
                     mock_bundle_assets.assert_called_once_with(ctx=mock_ctx,
                                                             selected_platforms=[mock_platform],
                                                             selected_platforms=[mock_platform],
                                                             seedlist_paths=[],
                                                             seedlist_paths=[],
@@ -305,6 +277,8 @@ def test_asset_bundler_combinations(tmp_path, is_engine_centric, use_sdk, has_mo
                                                             using_installer_sdk=use_sdk,
                                                             using_installer_sdk=use_sdk,
                                                             tool_config='profile',
                                                             tool_config='profile',
                                                             max_bundle_size=2048)
                                                             max_bundle_size=2048)
+                except ExportProjectError:
+                    assert not has_monolithic, "Error expected if we do not have monolithic binaries what requesting monolithic builds."
 
 
                 mock_get_asset_bundler_path.reset_mock()
                 mock_get_asset_bundler_path.reset_mock()
                 mock_bundle_assets.reset_mock()
                 mock_bundle_assets.reset_mock()
@@ -450,7 +424,6 @@ def test_asset_processor_combinations(tmp_path, is_engine_centric, use_sdk, has_
                 test_tools_build_path = None if not base_path else base_path / 'build/tools'
                 test_tools_build_path = None if not base_path else base_path / 'build/tools'
                 test_tools_sdk_path = (test_engine_path / 'bin/Windows/profile/Default')
                 test_tools_sdk_path = (test_engine_path / 'bin/Windows/profile/Default')
 
 
-                cannot_build_monolithic = (use_sdk and not has_monolithic and use_monolithic)
                 selected_tools_build_path = test_tools_build_path if not use_sdk else test_tools_sdk_path
                 selected_tools_build_path = test_tools_build_path if not use_sdk else test_tools_sdk_path
 
 
                 if not selected_tools_build_path:
                 if not selected_tools_build_path:
@@ -459,26 +432,11 @@ def test_asset_processor_combinations(tmp_path, is_engine_centric, use_sdk, has_
                 if not selected_tools_build_path.is_absolute():
                 if not selected_tools_build_path.is_absolute():
                     selected_tools_build_path = test_o3de_base_path / selected_tools_build_path                
                     selected_tools_build_path = test_o3de_base_path / selected_tools_build_path                
 
 
-                if cannot_build_monolithic:
-                    pytest.raises(exp.ExportProjectError, export_standalone_project,
-                                  mock_ctx,
-                                  mock_platform,
-                                  test_output_path,
-                                  should_build_tools, 
-                                  buildconf,
-                                  'profile',
-                                  [],[],[],
-                                  monolithic_build=use_monolithic,
-                                  engine_centric=is_engine_centric,
-                                  tools_build_path=test_tools_build_path,
-                                  should_build_all_assets=True)
-                    mock_get_asset_processor_path.assert_not_called()
-                    mock_build_assets.assert_not_called()
-                else:
+                try:
                     export_standalone_project(mock_ctx,
                     export_standalone_project(mock_ctx,
                                         mock_platform,
                                         mock_platform,
                                         test_output_path,
                                         test_output_path,
-                                        should_build_tools, 
+                                        should_build_tools,
                                         buildconf,
                                         buildconf,
                                         'profile',
                                         'profile',
                                         [],[],[],
                                         [],[],[],
@@ -490,7 +448,7 @@ def test_asset_processor_combinations(tmp_path, is_engine_centric, use_sdk, has_
                                                                         using_installer_sdk=use_sdk,
                                                                         using_installer_sdk=use_sdk,
                                                                         tool_config='profile',
                                                                         tool_config='profile',
                                                                         required=True)
                                                                         required=True)
-                    
+
                     mock_build_assets.assert_called_once_with(ctx=mock_ctx,
                     mock_build_assets.assert_called_once_with(ctx=mock_ctx,
                                                             tools_build_path=selected_tools_build_path,
                                                             tools_build_path=selected_tools_build_path,
                                                             engine_centric=is_engine_centric,
                                                             engine_centric=is_engine_centric,
@@ -500,24 +458,13 @@ def test_asset_processor_combinations(tmp_path, is_engine_centric, use_sdk, has_
                                                             selected_platforms=[mock_platform],
                                                             selected_platforms=[mock_platform],
                                                             logger=mock_logger)
                                                             logger=mock_logger)
 
 
-                mock_get_asset_processor_path.reset_mock()
-                mock_build_assets.reset_mock()
+                    mock_get_asset_processor_path.reset_mock()
+                    mock_build_assets.reset_mock()
+                except ExportProjectError:
+                    assert not has_monolithic, "Error expected if we do not have monolithic binaries what requesting monolithic builds."
 
 
                 #now test for when we skip the asset build process
                 #now test for when we skip the asset build process
-                if cannot_build_monolithic:
-                    pytest.raises(exp.ExportProjectError, export_standalone_project,
-                                  mock_ctx,
-                                  mock_platform,
-                                  test_output_path,
-                                  should_build_tools, 
-                                  buildconf,
-                                  'profile',
-                                  [],[],[],
-                                  monolithic_build=use_monolithic,
-                                  engine_centric=is_engine_centric,
-                                  tools_build_path=test_tools_build_path,
-                                  should_build_all_assets=False)
-                else:
+                try:
                     export_standalone_project(mock_ctx,
                     export_standalone_project(mock_ctx,
                                             mock_platform,
                                             mock_platform,
                                             test_output_path,
                                             test_output_path,
@@ -532,6 +479,8 @@ def test_asset_processor_combinations(tmp_path, is_engine_centric, use_sdk, has_
                     
                     
                     mock_get_asset_processor_path.assert_not_called()
                     mock_get_asset_processor_path.assert_not_called()
                     mock_build_assets.assert_not_called()
                     mock_build_assets.assert_not_called()
+                except ExportProjectError:
+                    assert not has_monolithic, "Error expected if we do not have monolithic binaries what requesting monolithic builds."
 
 
                 mock_get_asset_processor_path.reset_mock()
                 mock_get_asset_processor_path.reset_mock()
                 mock_build_assets.reset_mock()
                 mock_build_assets.reset_mock()
@@ -581,7 +530,7 @@ def test_build_game_targets_combinations(tmp_path, is_engine_centric, use_sdk, h
     mock_logger = create_autospec(logging.Logger)
     mock_logger = create_autospec(logging.Logger)
 
 
     with patch('o3de.manifest.is_sdk_engine', return_value=use_sdk) as mock_is_sdk_engine,\
     with patch('o3de.manifest.is_sdk_engine', return_value=use_sdk) as mock_is_sdk_engine,\
-         patch('o3de.export_project.has_monolithic_artifacts', return_value=has_monolithic) as mock_has_mono_artifacts,\
+         patch('o3de.export_project.has_monolithic_artifacts', return_value=True) as mock_has_mono_artifacts,\
          patch('o3de.export_project.get_platform_installer_folder_name', return_value="Windows") as mock_platform_folder_name,\
          patch('o3de.export_project.get_platform_installer_folder_name', return_value="Windows") as mock_platform_folder_name,\
          patch('o3de.export_project.validate_project_artifact_paths', return_value=[]) as mock_validate_project_artifacts,\
          patch('o3de.export_project.validate_project_artifact_paths', return_value=[]) as mock_validate_project_artifacts,\
          patch('o3de.export_project.kill_existing_processes') as mock_kill_processes,\
          patch('o3de.export_project.kill_existing_processes') as mock_kill_processes,\
@@ -644,55 +593,34 @@ def test_build_game_targets_combinations(tmp_path, is_engine_centric, use_sdk, h
                     if not selected_launcher_build_path.is_absolute():
                     if not selected_launcher_build_path.is_absolute():
                         selected_launcher_build_path = test_o3de_base_path / selected_launcher_build_path
                         selected_launcher_build_path = test_o3de_base_path / selected_launcher_build_path
 
 
-                    cannot_build_monolithic = (use_sdk and not has_monolithic and use_monolithic)
-                    if cannot_build_monolithic:
-                        pytest.raises(exp.ExportProjectError, export_standalone_project,
-                                      mock_ctx,
-                                      mock_platform,
-                                      test_output_path,
-                                      should_build_tools, 
-                                      buildconf,
-                                      'profile',
-                                      [],[],[],
-                                      monolithic_build=use_monolithic,
-                                      engine_centric=is_engine_centric,
-                                      tools_build_path=test_tools_build_path,
-                                      should_build_all_assets=True,
-                                      launcher_build_path=test_launcher_build_path,
-                                      should_build_game_launcher=should_build_game,
-                                      should_build_server_launcher=should_build_server,
-                                      should_build_headless_server_launcher=should_build_headless_server,
-                                      should_build_unified_launcher=should_build_unified)
+                    export_standalone_project(mock_ctx,
+                                    mock_platform,
+                                    test_output_path,
+                                    should_build_tools,
+                                    buildconf,
+                                    'profile',
+                                    [],[],[],
+                                    monolithic_build=use_monolithic,
+                                    engine_centric=is_engine_centric,
+                                    tools_build_path=test_tools_build_path,
+                                    should_build_all_assets=True,
+                                    launcher_build_path=test_launcher_build_path,
+                                    should_build_game_launcher=should_build_game,
+                                    should_build_server_launcher=should_build_server,
+                                    should_build_headless_server_launcher=should_build_headless_server,
+                                    should_build_unified_launcher=should_build_unified)
+                    if check_launcher_type == 0:
                         mock_build_game_targets.assert_not_called()
                         mock_build_game_targets.assert_not_called()
                     else:
                     else:
-                        export_standalone_project(mock_ctx,
-                                        mock_platform,
-                                        test_output_path,
-                                        should_build_tools, 
-                                        buildconf,
-                                        'profile',
-                                        [],[],[],
-                                        monolithic_build=use_monolithic,
-                                        engine_centric=is_engine_centric,
-                                        tools_build_path=test_tools_build_path,
-                                        should_build_all_assets=True,
-                                        launcher_build_path=test_launcher_build_path,
-                                        should_build_game_launcher=should_build_game,
-                                        should_build_server_launcher=should_build_server,
-                                        should_build_headless_server_launcher=should_build_headless_server,
-                                        should_build_unified_launcher=should_build_unified)
-                        if check_launcher_type == 0:
-                            mock_build_game_targets.assert_not_called()
-                        else:
-                            mock_build_game_targets.assert_called_once_with(ctx=mock_ctx,
-                                                                            build_config=buildconf,
-                                                                            game_build_path=selected_launcher_build_path,
-                                                                            engine_centric=is_engine_centric,
-                                                                            launcher_types=check_launcher_type,
-                                                                            allow_registry_overrides=False,
-                                                                            tool_config='profile',
-                                                                            monolithic_build=use_monolithic,
-                                                                            logger=mock_logger)
+                        mock_build_game_targets.assert_called_once_with(ctx=mock_ctx,
+                                                                        build_config=buildconf,
+                                                                        game_build_path=selected_launcher_build_path,
+                                                                        engine_centric=is_engine_centric,
+                                                                        launcher_types=check_launcher_type,
+                                                                        allow_registry_overrides=False,
+                                                                        tool_config='profile',
+                                                                        monolithic_build=ANY,
+                                                                        logger=mock_logger)
                     mock_build_game_targets.reset_mock()
                     mock_build_game_targets.reset_mock()
 
 
 
 
@@ -813,27 +741,7 @@ def test_setup_launcher_layout_directory(tmp_path, is_engine_centric, use_sdk, h
                     if not selected_launcher_build_path.is_absolute():
                     if not selected_launcher_build_path.is_absolute():
                         selected_launcher_build_path = test_o3de_base_path / selected_launcher_build_path
                         selected_launcher_build_path = test_o3de_base_path / selected_launcher_build_path
 
 
-                    cannot_build_monolithic = (use_sdk and not has_monolithic and use_monolithic)
-                    if cannot_build_monolithic:
-                        pytest.raises(exp.ExportProjectError, export_standalone_project,
-                                      mock_ctx,
-                                      mock_platform,
-                                      test_output_path,
-                                      should_build_tools, 
-                                      buildconf,
-                                      'profile',
-                                      [],[],[],
-                                      monolithic_build=use_monolithic,
-                                      engine_centric=is_engine_centric,
-                                      tools_build_path=test_tools_build_path,
-                                      should_build_all_assets=True,
-                                      launcher_build_path=test_launcher_build_path,
-                                      should_build_game_launcher=should_build_game,
-                                      should_build_server_launcher=should_build_server,
-                                      should_build_headless_server_launcher=should_build_headless_server,
-                                      should_build_unified_launcher=should_build_unified)
-                        mock_setup_launcher_layout_directory.assert_not_called()
-                    else:
+                    try:
                         export_standalone_project(mock_ctx,
                         export_standalone_project(mock_ctx,
                                         mock_platform,
                                         mock_platform,
                                         test_output_path,
                                         test_output_path,
@@ -880,6 +788,8 @@ def test_setup_launcher_layout_directory(tmp_path, is_engine_centric, use_sdk, h
                                     break
                                     break
                         
                         
                         assert settings_remaining == 0
                         assert settings_remaining == 0
+                    except ExportProjectError:
+                        assert not has_monolithic, "Error expected if we do not have monolithic binaries what requesting monolithic builds."
 
 
                     reset_cache()
                     reset_cache()
                     mock_setup_launcher_layout_directory.reset_mock()
                     mock_setup_launcher_layout_directory.reset_mock()