Use previous efl-tool before official SDK release
[scm/meta/abs.git] / build.template
index c0c244c..88241e3 100644 (file)
@@ -1,4 +1,4 @@
-$!/bin/bash
+#!/bin/bash
 set -x
 
 ABS_CMD=/home/build/abs
@@ -12,6 +12,7 @@ PARALLEL_JOBS=__PARALLEL_JOBS__
 TMP_DIR=${BUILD_ROOT}/${PACKAGE}/_abs_out_
 SDK_CMD=$SDK_PATH/tools/ide/bin/tizen
 LIST="$SDK_CMD list rootstrap "
+BUILD_TYPE=__BUILD_TYPE__
 
 chown -R build:build $SHARE_ROOT
 su - build -c "cp $SHARE_ROOT/abs/abs $BUILD_ROOT/"
@@ -45,25 +46,77 @@ for i in "${arr[@]}"; do
     fi
   fi
 done
-echo $tizen_studio_distribution >> $SHARE_ROOT/tizen_studio_distribution
+echo $tizen_studio_distribution > $SHARE_ROOT/tizen_studio_distribution
 
 rs_list=`su - build -c "tizen list rootstrap | grep ${PROFILE}-.*.core.private.* | cut -d ' ' -f 1"`
-echo $rs_list >> $SHARE_ROOT/rsver
+#FIXME: remove hard-coded expression
+if [ "${PROFILE}" = "da-hfp" ]; then
+  rs_list=`su - build -c "tizen list rootstrap | grep ${PROFILE}-.*device.core.private.* | cut -d ' ' -f 1"`
+fi
+echo $rs_list > $SHARE_ROOT/rsver
+if [[ ! $rs_list =~ [0-9]{8}_[0-9] ]]; then
+  conf=`cat ${SDK_PATH}/tools/smart-build-interface/plugins/${rs_list}.xml`
+  dateversion=`echo $conf | sed "s/.*(\([0-9]\{8\}_[0-9]\{1\}\).*/\1/"`
+  echo ${rs_list}.${dateversion} > $SHARE_ROOT/rsver
+fi
+
+#FIXME: Use previous efl-tool before official SDK release
+top_platform=$(ls ${SDK_PATH}/platforms/ | sort -r | head -n1)
+for pfm in $(ls ${SDK_PATH}/platforms/ | sort -r); do
+  if [[ -d ${SDK_PATH}/platforms/${pfm}/common/efl-tool ]]; then
+    if [ "${top_platform}" = "${pfm}" ]; then
+      echo "OK. We have efl-tool"
+    else
+      echo "Try link efl-tool from ${pfm}"
+      mkdir -p ${SDK_PATH}/platforms/${top_platform}/common/ || true
+      ln -s ${SDK_PATH}/platforms/${pfm}/common/efl-tool ${SDK_PATH}/platforms/${top_platform}/common/efl-tool || true
+      ln -s ${SDK_PATH}/platforms/${pfm}/common/tidl ${SDK_PATH}/platforms/${top_platform}/common/tidl || true
+    fi
+    break
+  fi
+done
+
+# Inject tidlc path
+TIDLC_PATH=`sed -n '/tidl/p' /home/build/.bashrc | cut -f2 -d':'`
+if [ ! -z ${TIDLC_PATH} ]; then echo "PATH=\$PATH:${TIDLC_PATH}" >> /home/build/.profile; fi
+su - build -c "tidlc --version"
 
 for rs in $rs_list; do
   echo "BUILDING START TIME: `date`"
   #if [[ $rs == *"64.core"* ]]; then
   #  echo "SKIP! 64-bit not supported!"; continue;
   #else
-    su - build -c "${ABS_CMD} build -r $rs -w ${BUILD_ROOT}/${PACKAGE} -s ABS -c ${BUILD_MODE} ${PARALLEL_JOBS}"
+
+  su - build -c "${ABS_CMD} build -r $rs -w ${BUILD_ROOT}/${PACKAGE} -s ABS -c ${BUILD_MODE} ${PARALLEL_JOBS} --profile-to-search ${PROFILE}"
+  build_result=$?
+  echo "BUILD RET: ${build_result}"
   #fi
-  mv ${TMP_DIR}/*.tpk ${SHARE_ROOT}
+  count=`ls -1 ${TMP_DIR}/*.tpk 2>/dev/null | wc -l`
+  if [ $count != 0 ]; then
+    mv ${TMP_DIR}/*.tpk ${SHARE_ROOT}
+  else
+    mv ${TMP_DIR}/*.wgt ${SHARE_ROOT}
+  fi
   ret=$?; echo "BUILDING FINISH TIME: `date`"
   if [ $ret != 0 ]; then
-    echo $rs build fail; _clear 8
+    echo $rs build fail; _clear $build_result
   fi
 done
 
+echo "OUTPUT CONTENTS..."
+ls -al ${SHARE_ROOT}
+
+#FIXME: Check 64 bit rootstraps for mobile profile.
+#if [[ $BUILD_TYPE = "SUBMIT" ]] && [[ $PROFILE = "mobile" ]]; then
+#  if [[ $rs_list = *"device64"* ]] && [[ $rs_list = *"emulator64"* ]]; then
+#    echo "OK. $PROFILE have 64 bit rootstraps"
+#  else
+#    echo "NOK. $PROFILE does not have 64 bit rootstraps"
+#    echo "$PROFILE does not have 64 bit rootstraps" > ${SHARE_ROOT}/build_rootstrap_check.log
+#    _clear 9
+#  fi  
+#fi
+
 _clear 0
 su - build -c "df -hT"