diff options
author | Rechi <Rechi@users.noreply.github.com> | 2017-03-12 20:07:02 +0100 |
---|---|---|
committer | Rechi <Rechi@users.noreply.github.com> | 2017-03-12 20:07:02 +0100 |
commit | 51b905b1d642d598c9e74277477129ce8612169e (patch) | |
tree | 80cee2996451342f0a8b0c85f7479089e6d8f525 | |
parent | 71837f8bc620b264205e627704d82ad059a89921 (diff) |
[jenkins][windows] don't remove previous compiled version of ffmpeg and libdvd if nothing changed
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | tools/buildsteps/win32/buildffmpeg.sh | 14 | ||||
-rw-r--r-- | tools/buildsteps/win32/buildhelpers.sh | 55 | ||||
-rw-r--r-- | tools/buildsteps/win32/buildlibdvd.sh | 15 | ||||
-rw-r--r-- | tools/buildsteps/win32/prepare-env.bat | 4 |
5 files changed, 85 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore index 0f2f048a6e..bce1af0db8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ testMain config.cache config.status config.log +.last_success_revision *.d *.depend *.pc diff --git a/tools/buildsteps/win32/buildffmpeg.sh b/tools/buildsteps/win32/buildffmpeg.sh index 8b5ae23233..9a16a01802 100644 --- a/tools/buildsteps/win32/buildffmpeg.sh +++ b/tools/buildsteps/win32/buildffmpeg.sh @@ -12,6 +12,17 @@ FFMPEG_TARGET_OS=mingw32 do_loaddeps $FFMPEG_VERSION_FILE FFMPEGDESTDIR=/xbmc/lib/win32/$LIBNAME +if [ "$(pathChanged $FFMPEGDESTDIR $FFMPEG_VERSION_FILE /xbmc/project/BuildDependencies/DownloadMingwBuildEnv.bat /xbmc/tools/buildsteps/win32)" == "0" ] +then + cp $FFMPEGDESTDIR/bin/*.dll /xbmc/system/ + if [ -f $BGPROCESSFILE ]; then + rm $BGPROCESSFILE + fi + exit +else + git clean -dffx $FFMPEGDESTDIR +fi + do_getFFmpegConfig() { if [[ -f "$FFMPEG_CONFIG_FILE" ]]; then FFMPEG_OPTS_SHARED="$FFMPEG_BASE_OPTS $(cat "$FFMPEG_CONFIG_FILE" | sed -e 's:\\::g' -e 's/#.*//')" @@ -148,7 +159,8 @@ do_print_status "$LIBNAME-$VERSION (${BITS})" "$blue_color" "Configuring" --extra-cflags="$extra_cflags" --extra-ldflags="$extra_ldflags" do_makelib && -cp $FFMPEGDESTDIR/bin/*.dll /xbmc/system/ +cp $FFMPEGDESTDIR/bin/*.dll /xbmc/system/ && +tagSuccessFulBuild $FFMPEGDESTDIR $FFMPEG_VERSION_FILE /xbmc/project/BuildDependencies/DownloadMingwBuildEnv.bat /xbmc/tools/buildsteps/win32 #remove the bgprocessfile for signaling the process end if [ -f $BGPROCESSFILE ]; then diff --git a/tools/buildsteps/win32/buildhelpers.sh b/tools/buildsteps/win32/buildhelpers.sh index 6e73e67ed8..34663b8275 100644 --- a/tools/buildsteps/win32/buildhelpers.sh +++ b/tools/buildsteps/win32/buildhelpers.sh @@ -149,3 +149,58 @@ do_clean_get() { do_clean $1 do_download } + + +PATH_CHANGE_REV_FILENAME=".last_success_revision" + +#hash a dir based on the git revision, $BITS and $tools +#param1 path to be hashed +function getBuildHash () +{ + local checkPath + checkPath="$1" + shift 1 + local hashStr + hashStr="$(git rev-list HEAD --max-count=1 -- $checkPath $@)" + hashStr="$hashStr $@ $BITS $tools" + echo $hashStr +} + +#param1 path to be checked for changes +function pathChanged () +{ + local ret + local checkPath + ret="0" + #no optims in release builds! + if [ "$Configuration" == "Release" ] + then + echo "1" + return + fi + + checkPath="$1" + shift 1 + if [ -e $checkPath/$PATH_CHANGE_REV_FILENAME ] + then + if [ "$(cat $checkPath/$PATH_CHANGE_REV_FILENAME)" != "$(getBuildHash $checkPath $@)" ] + then + ret="1" + fi + else + ret="1" + fi + + echo $ret +} + +#param1 path to be tagged with hash +function tagSuccessFulBuild () +{ + local pathToTag + pathToTag="$1" + shift 1 + # tag last successful build with revisions of the given dir + # needs to match the checks in function getBuildHash + echo "$(getBuildHash $pathToTag $@)" > $pathToTag/$PATH_CHANGE_REV_FILENAME +} diff --git a/tools/buildsteps/win32/buildlibdvd.sh b/tools/buildsteps/win32/buildlibdvd.sh index 3dab42476d..db99da3d82 100644 --- a/tools/buildsteps/win32/buildlibdvd.sh +++ b/tools/buildsteps/win32/buildlibdvd.sh @@ -7,6 +7,18 @@ LIBDVDPREFIX=/xbmc/lib/libdvd PKG_CONFIG_PATH=$LIBDVDPREFIX/lib/pkgconfig export PKG_CONFIG_PATH +if [ "$(pathChanged $LIBDVDPREFIX /xbmc/tools/depends/target/libdvdcss/DVDCSS-VERSION /xbmc/tools/depends/target/libdvdread/DVDREAD-VERSION /xbmc/tools/depends/target/libdvdnav/DVDNAV-VERSION /xbmc/project/BuildDependencies/DownloadMingwBuildEnv.bat /xbmc/tools/buildsteps/win32)" == "0" ] +then + cp "$LIBDVDPREFIX/bin/libdvdcss-2.dll" /xbmc/system/ + cp $LIBDVDPREFIX/bin/libdvdnav.dll /xbmc/system/ + if [ -f $BGPROCESSFILE ]; then + rm $BGPROCESSFILE + fi + exit +else + git clean -dffx $LIBDVDPREFIX +fi + do_load_autoconf() { do_loaddeps $1 do_clean_get $MAKEFLAGS @@ -62,7 +74,8 @@ gcc \ -static-libgcc strip -S $LIBDVDPREFIX/bin/libdvdnav.dll && -cp $LIBDVDPREFIX/bin/libdvdnav.dll /xbmc/system/ +cp $LIBDVDPREFIX/bin/libdvdnav.dll /xbmc/system/ && +tagSuccessFulBuild $LIBDVDPREFIX /xbmc/tools/depends/target/libdvdcss/DVDCSS-VERSION /xbmc/tools/depends/target/libdvdread/DVDREAD-VERSION /xbmc/tools/depends/target/libdvdnav/DVDNAV-VERSION /xbmc/project/BuildDependencies/DownloadMingwBuildEnv.bat /xbmc/tools/buildsteps/win32 do_print_status "libdvd (${BITS})" "$green_color" "Done" #remove the bgprocessfile for signaling the process end diff --git a/tools/buildsteps/win32/prepare-env.bat b/tools/buildsteps/win32/prepare-env.bat index b1a169abb5..46a544f320 100644 --- a/tools/buildsteps/win32/prepare-env.bat +++ b/tools/buildsteps/win32/prepare-env.bat @@ -9,8 +9,8 @@ IF EXIST %WORKSPACE%\project\Win32BuildSetup\BUILD_WIN32 rmdir %WORKSPACE%\proje rem we assume git in path as this is a requirement rem git clean the untracked files and directories rem but keep the downloaded dependencies -ECHO running git clean -xfd -e "project/BuildDependencies/downloads" -e "project/BuildDependencies/downloads2" -git clean -xfd -e "project/BuildDependencies/downloads" -e "project/BuildDependencies/downloads2" +ECHO running git clean -xfd -e "lib/libdvd" -e "lib/win32/ffmpeg" -e "project/BuildDependencies/downloads" -e "project/BuildDependencies/downloads2" +git clean -xfd -e "lib/libdvd" -e "lib/win32/ffmpeg" -e "project/BuildDependencies/downloads" -e "project/BuildDependencies/downloads2" rem cleaning additional directories ECHO delete build directories |