1 BUILDTHREADS=${BUILDTHREADS:-1}
2 SDK_VERSION=${SDK_VERSION:-"Default"}
3 NDK_VERSION=${NDK_VERSION:-"Default"}
4 NDK_API=${NDK_API:-"Default"}
5 Configuration=${Configuration:-"Default"}
6 XBMC_DEPENDS_ROOT=${XBMC_DEPENDS_ROOT:-"Default"}
7 XCODE_APP=${XCODE_APP:-"Default"}
8 PATH_CHANGE_REV_FILENAME=".last_success_revision"
9 FAILED_BUILD_FILENAME=".last_failed_revision"
10 #TARBALLS ENV-VAR is only used by android scripts atm
11 TARBALLS=${TARBALLS:-"/opt/xbmc-tarballs"}
12 RENDER_SYSTEM=${RENDER_SYSTEM:-"Default"}
13 BUILD_HOST=${BUILD_HOST:-"Default"}
15 BINARY_ADDONS_ROOT=tools/depends/target
16 BINARY_ADDONS="binary-addons"
17 DEPLOYED_BINARY_ADDONS="-e /addons"
19 # Jenkins env variables
20 JENKINS_BUILD_TIMESTAMP=${BUILD_TIMESTAMP:-"unknown"}
21 JENKINS_BUILD_COMMIT=$(echo ${GIT_COMMIT:-"unknown"} | cut -c1-8)
22 JENKINS_BUILD_REVISION=${Revision:-"unknown"}
23 JENKINS_BUILD_ID=${BUILD_ID:-"unknown"}
25 JENKINS_BUILD_STRING="${JENKINS_BUILD_TIMESTAMP}-${JENKINS_BUILD_COMMIT}-${JENKINS_BUILD_REVISION}-${JENKINS_BUILD_ID}"
27 #set platform defaults
28 #$XBMC_PLATFORM_DIR matches the platform subdirs!
29 case $XBMC_PLATFORM_DIR in
31 DEFAULT_SDK_VERSION=17.2
32 DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
33 DEFAULT_CONFIGURATION="Debug"
34 DEFAULT_XCODE_APP="Xcode_15.2.app"
38 DEFAULT_SDK_VERSION=17.2
39 DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
40 DEFAULT_CONFIGURATION="Debug"
41 DEFAULT_XCODE_APP="Xcode_15.2.app"
45 DEFAULT_SDK_VERSION=14.2
46 DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
47 DEFAULT_CONFIGURATION="Debug"
48 DEFAULT_XCODE_APP="Xcode_15.2.app"
52 DEFAULT_SDK_VERSION=14.2
53 DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
54 DEFAULT_CONFIGURATION="Debug"
55 DEFAULT_XCODE_APP="Xcode_15.2.app"
59 DEFAULT_NDK_VERSION="27.2.12479018" # NDK package version (newer API can be inside)
60 DEFAULT_NDK_API="24" # Nougat API level (24) defined in package ./sysroot/usr/include/android/api-level.h
61 DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
62 DEFAULT_CONFIGURATION="RelWithDebInfo"
66 DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
67 DEFAULT_CONFIGURATION="Debug"
68 DEFAULT_RENDER_SYSTEM="gl"
69 DEFAULT_BUILD_HOST="x86_64-linux-gnu"
73 DEFAULT_CONFIGURATION="Debug"
77 if [ "$SDK_VERSION" == "Default" ]
79 SDK_VERSION=$DEFAULT_SDK_VERSION
82 if [ "$NDK_VERSION" == "Default" ]
84 NDK_VERSION=$DEFAULT_NDK_VERSION
87 if [ "$NDK_API" == "Default" ]
89 NDK_API=$DEFAULT_NDK_API
92 if [ "$XBMC_DEPENDS_ROOT" == "Default" ]
94 XBMC_DEPENDS_ROOT=$DEFAULT_XBMC_DEPENDS_ROOT
97 if [ "$XCODE_APP" == "Default" ]
99 XCODE_APP=$DEFAULT_XCODE_APP
102 # make osx environment aware of the selected xcode app
103 export DEVELOPER_DIR=/Applications/$XCODE_APP/Contents/Developer
105 if [ "$Configuration" == "Default" ]
107 Configuration=$DEFAULT_CONFIGURATION
110 if [ "$Configuration" == "Release" ]
112 DEBUG_SWITCH='--disable-debug'
115 if [ "$RENDER_SYSTEM" == "Default" ]
117 RENDER_SYSTEM=$DEFAULT_RENDER_SYSTEM
120 if [ "$BUILD_HOST" == "Default" ]
122 BUILD_HOST=$DEFAULT_BUILD_HOST
127 #hash a dir based on the git revision, Configuration, SDK_PATH, NDK_PATH, NDK_VERSION, SDK_VERSION, TOOLCHAIN and XBMC_DEPENDS_ROOT
128 #param1 path to be hashed
129 function getBuildHash ()
134 hashStr="$(git rev-list HEAD --max-count=1 -- $checkPath)"
135 hashStr="$hashStr $Configuration $SDK_PATH $NDK_PATH $NDK_VERSION $SDK_VERSION $TOOLCHAIN $XBMC_DEPENDS_ROOT $XCODE_APP"
139 #param1 path to be checked for changes
140 function pathChanged ()
147 if [ -e $checkPath/$PATH_CHANGE_REV_FILENAME ]
149 if [ "$(cat $checkPath/$PATH_CHANGE_REV_FILENAME)" != "$(getBuildHash $checkPath)" ]
160 #param1 path to be tagged with hash
161 function tagSuccessFulBuild ()
165 # tag last successful build with revisions of the given dir
166 # needs to match the checks in function getBuildHash
167 echo "$(getBuildHash $pathToTag)" > $pathToTag/$PATH_CHANGE_REV_FILENAME
170 #param1 path to be tagged with hash
171 function tagFailedBuild ()
175 # tag last failed build with revisions of the given dir
176 # needs to match the checks in function getBuildHash
177 echo "$(getBuildHash $pathToTag)" > $pathToTag/$FAILED_BUILD_FILENAME
180 function getBuildRevDateStr ()
182 echo "${JENKINS_BUILD_STRING}"