3 USAGE="Usage: ./build.sh DEPLOY_DIR [TYPE]
5 The type option can be one of the following:
6 sdk - Build the whole Ext SDK
7 sass - Build css files. Assumes compass is installed
8 bootstrap-data - Build bootstrap data
9 tests - Build test indexes"
11 CURRENT_DIR="$(dirname $0)"
17 JSBUILDER_PATH="../jsbuilder/JSBuilder.sh"
18 BUILD_SDK_CMD="${JSBUILDER_PATH} --projectFile sdk.jsb3 --deployDir ${DEPLOY_DIR} --verbose"
19 BUILD_SASS="compass compile ../resources/sass -f"
20 BUILD_TESTS="./build-tests.sh"
22 # Build Ext.Loader paths to platform for dynamic loading
25 JSBUILDER_DIRNAME="$(dirname $JSBUILDER_PATH)"
26 if [ $UNAME = "Darwin" ] ; then
28 elif [ ${UNAME%%_*} = "CYGWIN" ] ; then
30 elif [ ${UNAME%%32*} = "MINGW" ] ; then
32 elif [ ${UNAME%%64*} = "MINGW" ] ; then
37 JSDB_PATH="${JSBUILDER_DIRNAME}/jsdb/${OS}"
38 BUILD_BOOTSTRAP_DATA_CMD="${JSDB_PATH}/jsdb build-bootstrap-data.js ${DEPLOY_DIR} ${OS}"
41 if [ -z ${DEPLOY_DIR} ] ; then
48 if [ -z ${BUILD_OPTION} ] ; then
49 # empty second arg, build sdk/all
52 CUSTOM_BUILD_EXAMPLES="app/simple app/feed-viewer app/nested-loading portal desktop"
54 for CUSTOM_BUILD_EXAMPLE in $CUSTOM_BUILD_EXAMPLES
56 echo "Processing custom build: ${CUSTOM_BUILD_EXAMPLE}..."
57 ${JSBUILDER_PATH} --projectFile ../examples/${CUSTOM_BUILD_EXAMPLE}/app.jsb3 --deployDir ${DEPLOY_DIR}/examples/${CUSTOM_BUILD_EXAMPLE} --verbose
60 # I know this is dirty but there's no other way to automate this
61 # JSBuilder does not support file moving
62 MVC_EXAMPLES="simple feed-viewer nested-loading"
63 for MVC_EXAMPLE_NAME in $MVC_EXAMPLES
65 echo "Processing MVC example: ${MVC_EXAMPLE_NAME}..."
66 mv -f ${DEPLOY_DIR}/examples/app/${MVC_EXAMPLE_NAME}/${MVC_EXAMPLE_NAME}-release.html ${DEPLOY_DIR}/examples/app/${MVC_EXAMPLE_NAME}/${MVC_EXAMPLE_NAME}.html
70 echo "Processing Portal example..."
71 mv -f ${DEPLOY_DIR}/examples/portal/portal-release.html ${DEPLOY_DIR}/examples/portal/portal.html
74 echo "Processing Desktop example..."
75 mv -f ${DEPLOY_DIR}/examples/desktop/desktop-release.html ${DEPLOY_DIR}/examples/desktop/desktop.html
78 # Check second arg is valid, build it
79 if [ ${BUILD_OPTION} = "sdk" ] ; then
81 elif [ ${BUILD_OPTION} = "ext-all" ] ; then
82 echo "There's no longer a separate ext-all build, simply build sdk instead"
83 elif [ ${BUILD_OPTION} = "sass" ] ; then
85 elif [ ${BUILD_OPTION} = "bootstrap-data" ] ; then
86 echo "[HINT] You can simply execute `build-bootstrap.sh` instead for convenience"
87 ${BUILD_BOOTSTRAP_DATA_CMD}
89 elif [ ${BUILD_OPTION} = "tests" ] ; then
90 echo "[HINT] You can simply execute build-tests.sh instead for convenience"