diff --git a/RxBlocking/Info.plist b/RxBlocking/Info.plist index 7e7479f0..21cb8bc3 100644 Binary files a/RxBlocking/Info.plist and b/RxBlocking/Info.plist differ diff --git a/RxCocoa/Info.plist b/RxCocoa/Info.plist index 7e7479f0..21cb8bc3 100644 Binary files a/RxCocoa/Info.plist and b/RxCocoa/Info.plist differ diff --git a/RxSwift/Info.plist b/RxSwift/Info.plist index 7e7479f0..21cb8bc3 100644 Binary files a/RxSwift/Info.plist and b/RxSwift/Info.plist differ diff --git a/RxTests/Info.plist b/RxTests/Info.plist index 7e7479f0..21cb8bc3 100644 Binary files a/RxTests/Info.plist and b/RxTests/Info.plist differ diff --git a/scripts/pre-release-tests.sh b/scripts/pre-release-tests.sh index cb24d05d..e2fbe208 100755 --- a/scripts/pre-release-tests.sh +++ b/scripts/pre-release-tests.sh @@ -13,13 +13,43 @@ if [ "$1" == "r" ]; then RELEASE_TEST=1 fi -./scripts/validate-headers.swift -./scripts/package-spm.swift > /dev/null +function ensureVersionEqual() { + if [[ "$1" != "$2" ]]; then + echo "Version $1 and $2 are not equal ($3)" + exit -1 + fi +} -if [ `git ls-files -o -d --exclude-standard | wc -l` -gt 0 ]; then - echo "Package for Swift package manager isn't updated, please run ./scripts/package-spm.swift and commit the changes" - exit -1 -fi +function ensureNoGitChanges() { + if [ `git diff HEAD | wc -l` -gt 0 ]; then + echo $1 + exit -1 + fi +} + +function checkPlistVersions() { + RXSWIFT_VERSION=`cat RxSwift.podspec | grep -E "s.version\s+=" | cut -d '"' -f 2` + + PROJECTS=(RxSwift RxCocoa RxBlocking RxTests) + for project in ${PROJECTS[@]} + do + echo "Checking version for ${project}" + PODSPEC_VERSION=`cat $project.podspec | grep -E "s.version\s+=" | cut -d '"' -f 2` + ensureVersionEqual "$RXSWIFT_VERSION" "$PODSPEC_VERSION" "${project} version not equal" + if [[ `defaults write "\`pwd\`/${project}/Info.plist" CFBundleShortVersionString $RXSWIFT_VERSION` != $RXSWIFT_VERSION ]]; then + defaults write "`pwd`/${project}/Info.plist" CFBundleShortVersionString $RXSWIFT_VERSION + fi + done + + ensureNoGitChanges "Plist versions aren't correct" +} + +checkPlistVersions + +./scripts/validate-headers.swift + +./scripts/package-spm.swift > /dev/null +ensureNoGitChanges "Package for Swift package manager isn't updated, please run ./scripts/package-spm.swift and commit the changes" # ios 7 sim #if [ `xcrun simctl list | grep "${DEFAULT_IOS7_SIMULATOR}" | wc -l` == 0 ]; then