1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #!/bin/bash
- CURDIR=$PWD
- SCRIPT_DIR=$( cd $(dirname $0) ; pwd -P )
- cd $SCRIPT_DIR
- set -e
- if [ -z "$QTC_BUILD" ]; then
- echo "undefined QTC_BUILD environment variable"
- exit 1;
- fi
- export DISPLAY=:0
- QT_CREATOR_VERSION_OUTPUT=$("$QTC_BUILD"/bin/qtcreator -version 2>&1)
- QT_CREATOR_VERSION=$(echo $QT_CREATOR_VERSION_OUTPUT | grep -o "Qt Creator [0-9][0-9\.]*" | grep -o "[0-9\.]*")
- QT_CREATOR_QT_VERSION=$(echo $QT_CREATOR_VERSION_OUTPUT | grep -o "based on Qt [0-9][0-9\.]*" | grep -o "[0-9\.]*")
- QT_CREATOR_QT_MAJOR_VERSION=$(echo $QT_CREATOR_QT_VERSION | cut -d . -f1)
- QMAKE_QT_PATH_VERSION=$(qmake -version | grep -o "Using Qt version [0-9\.]*" | grep -o "[0-9\.]*")
- QMAKE_QT_PATH_MAJOR_VERSION=$(echo $QMAKE_QT_PATH_VERSION | cut -d . -f1)
- if [ "$QT_CREATOR_QT_MAJOR_VERSION" != "$QMAKE_QT_PATH_MAJOR_VERSION" ]; then
- echo "qmake Qt version ($QMAKE_QT_PATH_VERSION) is not compatible with Qt used by Qt creator($QT_CREATOR_QT_VERSION)"
- exit 1
- fi
- if [[ "$QT_CREATOR_VERSION" != "3"* ]]; then
- echo "The plugin is compatible only with QtCreator 3.* version"
- exit 1
- fi
- echo found Qt Creator - version $QT_CREATOR_VERSION build with Qt $QT_CREATOR_QT_VERSION in $QTC_BUILD
- if [ -z "$QTC_SOURCE" ]; then
- if [ ! -d qt-creator-sources ]; then
- echo "undefined QTC_SOURCE environment variable and no qt-creator directory in $SCRIPT_DIR. Downloading creator sources for Qt Creator $QT_CREATOR_VERSION"
- QT_CREATOR_BRANCH=${QT_CREATOR_VERSION:0:-2}
- git clone http://git.gitorious.org/qt-creator/qt-creator.git -b $QT_CREATOR_BRANCH qt-creator-sources
- fi
- QTC_SOURCE="$PWD/qt-creator-sources"
- fi
- cd "$QTC_SOURCE"
- set +e
- echo fetching latest Qt Creator sources
- git fetch origin
- set -e
- git checkout v$QT_CREATOR_VERSION
- QTC_SOURCE=$PWD
- echo Qt Creator source set to $QTC_SOURCE
- export QTC_BUILD
- export QTC_SOURCE
- mkdir -p $SCRIPT_DIR/plugins
- cd $SCRIPT_DIR/plugins
- if [ ! -d tizen ]; then
- echo downloading plugin sources
- git clone https://git.gitorious.org/tizenbuildtools/qtcreator-tizen-plugin.git tizen
- fi
- cd tizen
- git fetch
- QTCREATOR_TIZEN_PLUGIN_BRANCH=${QT_CREATOR_VERSION:0:-2}
- CONTAINS_BRANCH=$(git branch -r | grep -c "origin/$QTCREATOR_TIZEN_PLUGIN_BRANCH")
- if [ "$CONTAINS_BRANCH" == "0" ]; then
- echo "There is no Tizen plugin for QtCreator: $QTCREATOR_TIZEN_PLUGIN_BRANCH"
- exit 1;
- fi
- git reset --hard origin/$QTCREATOR_TIZEN_PLUGIN_BRANCH
- qmake -r
- make
- echo "Done !!!"
- echo "Tizen Plugin built and deployed to Qt Creator plugins directory"
- cd "$CUR_DIR"
|