-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport.sh
executable file
·85 lines (77 loc) · 3.56 KB
/
export.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
# 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 packaging script simplifies the project export command by defaulting the required and important
# arguments to the values based on:
# --project-path $O3DE_PROJECT_PATH <- The path to this project for exporting
# --tools-build-path $TOOLS_BUILD_PATH <- The location of the tools/editor build to make sure all the tools necessary
# for packaging are built and available (if applicable)
# -out $OUTPUT_PATH <- The output location for the exported project. This can be set by passing in
# a path to the arguments to this script. If not provided, it will default
# to $O3DE_PROJECT_PATH/ProjectPackages
#
# Feel free to adjust any of the arguments as necessary. For more information about the project export command, type in the
# following command from the engine root
#
# scripts\o3de.sh export-project -es ExportScripts\export_source_built_project.py --script-help
#
# To see the default options the export-project command will use other than the above required override arguments, you can view/edit
# the parameters with the export-project-configure command
#
# $O3DE_PATH\scripts\o3de.bat export-project-configure --help
#
# To view the settings for the current project:
#
# $O3DE_PATH\scripts\o3de.bat export-project-configure -p $O3DE_PROJECT_PATH --list
#
#
# Note: The location of the engine (O3DE_PATH) is hardcoded to the location of the engine that was used to generate
# this project. The engine path must reflect the path to the engine on the local machine.
# Resolve the current folder in order to resolve the project path
SOURCE="${BASH_SOURCE[0]}"
# While $SOURCE is a symlink, resolve it
while [[ -h "$SOURCE" ]]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$( readlink "$SOURCE" )"
# If $SOURCE was a relative symlink (so no "/" as prefix, need to resolve it relative to the symlink base directory
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
O3DE_PROJECT_PATH=$DIR
echo Using project path at $O3DE_PROJECT_PATH
O3DE_PATH=/home/jhanca/devroot/o3de
if [ ! -f ${O3DE_PATH}/scripts/o3de.sh ]
then
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.
exit 1
fi
echo Using engine path at $O3DE_PATH
if [[ $1 == "-h" ]]
then
echo
echo "Usage: $0 EXPORT_PATH"
echo "where:"
echo " EXPORT_PATH The optional path to export the project package to. "
echo " Default: ${O3DE_PROJECT_PATH}/ProjectPackages"
echo
exit 0
elif [[ $1 == "" ]]
then
OUTPUT_PATH=${O3DE_PROJECT_PATH}/build/export
else
OUTPUT_PATH=$1
fi
echo Exporting project to $OUTPUT_PATH
# The default path where the tools are built is platform dependent
if [[ "$OSTYPE" == *"darwin"* ]]; then
TOOLS_BUILD_PATH=${O3DE_PROJECT_PATH}/build/mac
elif [[ "$OSTYPE" == "msys" ]]; then
TOOLS_BUILD_PATH=${O3DE_PROJECT_PATH}/build/windows
else
TOOLS_BUILD_PATH=${O3DE_PROJECT_PATH}/build/linux
fi
${O3DE_PATH}/scripts/o3de.sh export-project -es ExportScripts/export_source_built_project.py --project-path ${O3DE_PROJECT_PATH} --log-level INFO -out ${OUTPUT_PATH}