forked from ReactiveX/RxSwift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate-podspec.sh
executable file
·51 lines (37 loc) · 1.42 KB
/
validate-podspec.sh
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
# This is kind of naughty, I know,
# but we need to know what will the state be once RxSwift is deployed.
set -e
BRANCH=$(git rev-parse --abbrev-ref HEAD)
ESCAPED_SOURCE=$(pwd | sed -E "s/\//\\\\\//g")
function cleanup {
pushd ~/.cocoapods/repos/master
git clean -d -f
git reset master --hard
popd
}
trap cleanup EXIT
VERSION=`cat RxSwift.podspec | grep -E "s.version\s+=" | cut -d '"' -f 2`
TARGETS=(RxTest RxCocoa RxBlocking RxSwift)
pushd ~/.cocoapods/repos/master/Specs
for TARGET in ${TARGETS[@]}
do
mkdir -p ${TARGET}/${VERSION}
done
popd
for TARGET in ${TARGETS[@]}
do
mkdir -p ~/.cocoapods/repos/master/Specs/${TARGET}/${VERSION}
rm ~/.cocoapods/repos/master/Specs/${TARGET}/${VERSION}/* || echo
cat $TARGET.podspec |
sed -E "s/s.source[^\}]+\}/s.source = { :git => '${ESCAPED_SOURCE}', :branch => \'${BRANCH}\' }/" > ~/.cocoapods/repos/master/Specs/${TARGET}/${VERSION}/${TARGET}.podspec
done
function validate() {
local PODSPEC=$1
# custom cocoapods installation is because of CocoaPods incompatiblity with Swift 3
cd ~/.cocoapods/repos/master/; ~/Projects/CocoaPods/bin/pod lib lint ~/Projects/RxSwift/${PODSPEC} --no-clean --allow-warnings # temporary allow warning because of deprecated API in rc
#pod lib lint $PODSPEC --verbose --no-clean --allow-warnings # temporary allow warning because of deprecated API in rc
}
for TARGET in ${TARGETS[@]}
do
validate ${TARGET}.podspec
done