3 SCRIPT_PATH=$(readlink -f $(dirname $0))
5 [ -n "$DEPLOY_DIR" ] || DEPLOY_DIR="/opt/usr/dev"
6 [ -n "$OUT_DIR" ] || OUT_DIR=$(readlink -f "$SCRIPT_PATH/../out.mobile.arm")
7 [ -n "$DEPLOY_STRIPPED_LIBS" ] || DEPLOY_STRIPPED_LIBS=1
8 [ -n "$TIZEN_SDK_PATH" ] || TIZEN_SDK_PATH="$HOME/tizen-sdk"
18 Usage: $0 debug|release [-o outdir] [lib|ewk]
20 default outdir: out.mobile.arm
26 default: out.mobile.arm
41 trap 'die $0 $LINENO' ERR SIGINT SIGTERM SIGQUIT
46 size=$(ls -1s --block-size=1 $src | cut -f 1 -d ' ')
47 trashold="524288" # 512K
48 # Avoid setup overhead for small files.
49 if [ "$size" -le "$trashold" ]; then
52 $SCRIPT_PATH/tizensync.sh push $src $dst
53 # Print a report that is somewhat consistent with sdb push.
54 echo "fast-pushed $src"
59 # Do a quick heuristic check that it was already installed via package.
60 # We don't handle everything so the package has to be installed once.
61 lsout=$(sdb shell "ls /usr/lib/chromium-efl/icudtl.dat 2>/dev/null")
62 if [ -z "$lsout" ]; then
63 >&2 echo "It seems like you have never installed chromium-efl via package."
64 >&2 echo "Sorry but it won't work, exiting..."
71 mkdir -p "$DEPLOY_DIR/lib/release"
72 mkdir -p "$DEPLOY_DIR/lib/debug"
73 [ -f /var/run/sshd.pid ] || /usr/sbin/sshd
76 sdb push "$SCRIPT_PATH/device_envsetup.sh" $DEPLOY_DIR
80 _setupDevice > /dev/null
84 if [ -n "$CROSS_COMPILE" ] && type "${CROSS_COMPILE}strip" &> /dev/null; then
85 echo "${CROSS_COMPILE}strip"
89 # Try to use the one from tizen sdk.
90 for _dummy in $(seq 1 1); do # dummy loop for bailing on error to print message.
91 # Glob (*) to handle different versions.
92 pushd $TIZEN_SDK_PATH/tools/arm-linux-gnueabi-gcc*/bin > /dev/null || break
93 path="$(pwd)/arm-linux-gnueabi-strip"
94 [ -x "$path" ] || break
95 popd > /dev/null || break
99 >&2 echo "Cannot find usable strip binary. Hint: try setting TIZEN_SDK_PATH to your installation."
108 if [ "$DEPLOY_STRIPPED_LIBS" != "1" ]; then
110 elif [ ! -e "$stripped" -o "$stripped" -ot "$lib" ]; then
111 echo "stripping $lib to $stripped..."
112 $arm_strip -s $lib -o $stripped
115 fastpush $stripped $target_dir/$(basename $lib)
118 deploychromiumlib() {
119 lib="$out_subdir/lib/libchromium-efl.so"
120 echo "deploying $lib..."
121 deploylib $lib $deploy_subdir
123 web_proc=$out_subdir/efl_webprocess
124 echo "deploying $web_proc..."
125 fastpush $web_proc $deploy_subdir
129 lib="$out_subdir/lib/libchromium-ewk.so"
130 echo "deploying $lib..."
131 deploylib $lib $deploy_subdir
133 webview_app="$out_subdir/efl_webview_app"
134 if [ -f "$webview_app" ]; then
135 echo "deploying $webview_app..."
136 fastpush "$webview_app" $DEPLOY_DIR
138 minibrowser="$out_subdir/mini_browser"
139 if [ -f "$minibrowser" ]; then
140 echo "deploying $minibrowser..."
141 fastpush "$minibrowser" $DEPLOY_DIR
147 if echo "$@" | grep -Eqw "\-h|\-\-help"; then
153 [ "$buildtype" == "release" -o "$buildtype" == "debug" ]
158 while [ "$#" -gt "0" ]; do
159 if [ "$1" == "-o" ]; then
163 [ -z "$deploy_part" ]
170 [ "$deploy_part" == "all" -o "$deploy_part" == "lib" -o "$deploy_part" == "ewk" ]
172 if [ "$buildtype" == "release" ]; then
173 deploy_subdir="$DEPLOY_DIR/lib/release"
174 out_subdir="${out_dir}/Release"
175 elif [ "$buildtype" == "debug" ]; then
176 deploy_subdir="$DEPLOY_DIR/lib/debug"
177 out_subdir="${out_dir}/Debug"
182 if [ "$DEPLOY_STRIPPED_LIBS" == "1" ]; then
183 arm_strip="$(get_arm_strip)"
188 case "$deploy_part" in
196 deploychromiumlib && deployewk
202 echo "Build has been deployed to device."
203 echo "Source in device_envsetup.sh in $DEPLOY_DIR before starting application."