File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33# import all the environment
44source $( dirname $0 ) /common_env.sh
55
6- exec " ${ANDROID_BUNDLE} /android-sdk/tools/android" " $@ "
6+ if [ -z " $USE_GLOBAL_ADK " ] ; then
7+ exec " ${ANDROID_BUNDLE} /android-sdk/tools/android" " $@ "
8+ else
9+ # android should be in global path
10+ exec android " $@ "
11+ fi
712
Original file line number Diff line number Diff line change @@ -33,19 +33,25 @@ ANDROID_BUNDLE="$BUNDLE_ROOT_DIR/android_bundle"
3333# Devbundle is still stored in meteor-tool
3434DEV_BUNDLE=" $SCRIPT_DIR /dev_bundle"
3535
36- # Put Android build tool-chain into path
37- export PATH=" ${ANDROID_BUNDLE} /android-sdk/tools:${ANDROID_BUNDLE} /android-sdk/platform-tools:${PATH} "
38-
3936# Put ios-sim and ios-deploy binaries' paths into path
4037export PATH=" ${DEV_BUNDLE} /lib/ios-sim:${DEV_BUNDLE} /lib/ios-deploy:${PATH} "
4138
42- # add ant
43- export ANT_HOME=" ${ANDROID_BUNDLE} /apache-ant-1.9.4"
44- export PATH=" ${ANT_HOME} /bin:${PATH} "
39+ if [ -z " $USE_GLOBAL_ADK " ] ; then
40+ # Put Android build tool-chain into path
41+ export PATH=" ${ANDROID_BUNDLE} /android-sdk/tools:${ANDROID_BUNDLE} /android-sdk/platform-tools:${PATH} "
42+
43+ # add ant
44+ export ANT_HOME=" ${ANDROID_BUNDLE} /apache-ant-1.9.4"
45+ export PATH=" ${ANT_HOME} /bin:${PATH} "
46+
47+ export HOME=" ${ANDROID_BUNDLE} "
48+ else
49+ # to use a global ADK we don't set PATH, ANT_HOME and HOME
50+ # relying that they are installed and available globally
51+ true
52+ fi
4553
4654# add node
4755export PATH=" ${DEV_BUNDLE} /bin:${PATH} "
4856export NODE_PATH=" ${DEV_BUNDLE} /lib/node_modules"
4957
50- export HOME=" ${ANDROID_BUNDLE} "
51-
Original file line number Diff line number Diff line change @@ -27,6 +27,25 @@ command -v java >/dev/null 2>&1 || {
2727
2828cd " $ORIG_DIR "
2929
30+
31+ if [ -z " $USE_GLOBAL_ADK " ] ; then
32+ # not using global ADK
33+ true
34+ else
35+ # using global ADK, check all utilities
36+ set -e
37+ trap " echo One of the required utilities wasn't found in global PATH: java javac ant android" EXIT
38+
39+ which java
40+ which javac
41+ which ant
42+ which android
43+
44+ trap - EXIT
45+ set +e
46+ exit 0
47+ fi
48+
3049install_android_bundle () {
3150 echo " Going to install Android Bundle (300M-400M)."
3251 echo " This might take a while, please hold on."
You can’t perform that action at this time.
0 commit comments