blob: 93d3c1314871be0fd7adc1336587a189b31fe7f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
BUILDTHREADS=${BUILDTHREADS:-1}
SDK_VERSION=${SDK_VERSION:-"Default"}
Configuration=${Configuration:-"Default"}
XBMC_DEPENDS_ROOT=${XBMC_DEPENDS_ROOT:-"Default"}
PATH_CHANGE_REV_FILENAME=".last_success_revision"
#TARBALLS ENV-VAR is only used by android scripts atm
TARBALLS=${TARBALLS:-"/opt/xbmc-tarballs"}
#set platform defaults
#$XBMC_PLATFORM_DIR matches the platform subdirs!
case $XBMC_PLATFORM_DIR in
atv2)
DEFAULT_SDK_VERSION=4.3
DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
DEFAULT_CONFIGURATION="Debug"
;;
ios)
DEFAULT_SDK_VERSION=4.3
DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
DEFAULT_CONFIGURATION="Debug"
;;
osx32)
DEFAULT_SDK_VERSION=10.8
DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
DEFAULT_CONFIGURATION="Debug"
;;
osx64)
DEFAULT_SDK_VERSION=10.8
DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
DEFAULT_CONFIGURATION="Debug"
;;
android)
DEFAULT_SDK_VERSION="Default"
DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
DEFAULT_CONFIGURATION="Debug"
;;
linux*)
DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends
DEFAULT_CONFIGURATION="Debug"
esac
if [ "$SDK_VERSION" == "Default" ]
then
SDK_VERSION=$DEFAULT_SDK_VERSION
fi
if [ "$XBMC_DEPENDS_ROOT" == "Default" ]
then
XBMC_DEPENDS_ROOT=$DEFAULT_XBMC_DEPENDS_ROOT
fi
if [ "$Configuration" == "Default" ]
then
Configuration=$DEFAULT_CONFIGURATION
fi
#clamp release builds to 1 thread only
if [ "$Configuration" == "Release" ]
then
BUILDTHREADS=1
fi
#helper functions
#hash a dir based on the git revision, SDK_PATH, NDK_PATH, SDK_VERSION, TOOLCHAIN and XBMC_DEPENDS_ROOT
function getBuildHash ()
{
local checkPath
checkPath="$1"
local hashStr
hashStr="$(git rev-list HEAD --max-count=1 -- $checkPath)"
hashStr="$hashStr $SDK_PATH $NDK_PATH $SDK_VERSION $TOOLCHAIN $XBMC_DEPENDS_ROOT"
echo $hashStr
}
function pathChanged ()
{
local ret
local checkPath
ret="0"
#no optims in release builds!
if [ "$Configuration" == "Release" ]
then
echo "1"
return
fi
checkPath="$1"
if [ -e $checkPath/$PATH_CHANGE_REV_FILENAME ]
then
if [ "$(cat $checkPath/$PATH_CHANGE_REV_FILENAME)" != "$(getBuildHash $WORKSPACE/tools/depends)" ]
then
ret="1"
fi
else
ret="1"
fi
echo $ret
}
function tagSuccessFulBuild ()
{
local checkPath
checkPath="$1"
echo "$(getBuildHash $checkPath)" > $checkPath/$PATH_CHANGE_REV_FILENAME
}
function getBuildRevDateStr ()
{
local revStr
#fetch date-rev
revStr=`git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}' 2>/dev/null`
if [ "$?" == "0" ]
then
#fetch the first branch containing head
revStr=$revStr"-"`git branch -r --contains HEAD | sed "/origin\/pr\//d" | head -n1 | awk '{gsub(".*/","");print $1}'`
if [ "$?" == "0" ]
then
echo $revStr
else
echo "Unknown"
fi
else
echo "Unknown"
fi
}
|