export.bat 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. @echo off
  2. REM --------------------------------------------------------------------------------------------------
  3. REM
  4. REM Copyright (c) Contributors to the Open 3D Engine Project.
  5. REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
  6. REM
  7. REM SPDX-License-Identifier: Apache-2.0 OR MIT
  8. REM
  9. REM --------------------------------------------------------------------------------------------------
  10. REM This packaging script simplifies the project export command by defaulting the required and important
  11. REM arguments to the values based on:
  12. REM --project-path %O3DE_PROJECT_PATH% <- The path to this project for exporting
  13. REM --tools-build-path %TOOLS_BUILD_PATH% <- The location of the tools/editor build to make sure all the tools necessary
  14. REM for packaging are built and available (if applicable)
  15. REM -out %OUTPUT_PATH% <- The output location for the exported project. This can be set by passing in
  16. REM a path to the arguments to this script. If not provided, it will default
  17. REM to %O3DE_PROJECT_PATH%\ProjectPackages
  18. REM
  19. REM Feel free to adjust any of the arguments as necessary. For more information about the project export command, type in the
  20. REM following command from the engine root
  21. REM
  22. REM %O3DE_PATH%\scripts\o3de.bat export-project -es ExportScripts\export_source_built_project.py --script-help
  23. REM
  24. REM To see the default options the export-project command will use other than the above required override arguments, you can view/edit
  25. REM the parameters with the export-project-configure command
  26. REM
  27. REM %O3DE_PATH%\scripts\o3de.bat export-project-configure --help
  28. REM
  29. REM To view the settings for the current project:
  30. REM
  31. REM %O3DE_PATH%\scripts\o3de.bat export-project-configure -p %O3DE_PROJECT_PATH% --list
  32. REM
  33. REM Note: The location of the engine (O3DE_PATH) is hardcoded to the location of the engine that was used to generate
  34. REM this project. The engine path must reflect the path to the engine on the local machine.
  35. set O3DE_PATH=${EnginePath}
  36. set O3DE_PROJECT_PATH=%~dp0
  37. IF "%1" == "-h" (
  38. echo Usage: %0 EXPORT_PATH
  39. echo where:
  40. echo EXPORT_PATH The optional path to export the project package to.
  41. echo Default: %O3DE_PROJECT_PATH%ProjectPackages
  42. echo
  43. exit /B 0
  44. ) ELSE IF "%1" == "" (
  45. set OUTPUT_PATH=%O3DE_PROJECT_PATH%build\export
  46. ) ELSE (
  47. set OUTPUT_PATH=%1
  48. )
  49. set TOOLS_BUILD_PATH=%O3DE_PROJECT_PATH%build\windows
  50. echo Using project path at %O3DE_PROJECT_PATH%
  51. IF NOT EXIST %O3DE_PATH%\scripts\o3de.bat (
  52. echo Engine path %O3DE_PATH% is invalid in this script. Make sure to install the engine to %O3DE_PATH% or update this script's 'O3DE_PATH' to point to the installed engine path on this system.
  53. exit /B 1
  54. )
  55. echo Using engine path at %O3DE_PATH%
  56. echo Exporting project to %OUTPUT_PATH%
  57. call %O3DE_PATH%\scripts\o3de.bat export-project -es ExportScripts\export_source_built_project.py --project-path %O3DE_PROJECT_PATH% --log-level INFO --tools-build-path %TOOLS_BUILD_PATH% -out %OUTPUT_PATH%