forked from radarlabs/radar-sdk-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset_version.sh
More file actions
executable file
·28 lines (21 loc) · 1.09 KB
/
set_version.sh
File metadata and controls
executable file
·28 lines (21 loc) · 1.09 KB
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
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 <version_string>"
exit 1
fi
# sed has slightly different syntax on linux vs mac
if [ $(uname -s) = "Darwin" ]; then
alias sed_inplace="sed -E -i ''"
else
alias sed_inplace="sed -E -i"
fi
version_full=$1
version="${version_full%%-*}"
sed_inplace "s/s.version( +)= '(.+)'/s.version\1= '$version_full'/" RadarSDK.podspec
sed_inplace "s/s.version( +)= '(.+)'/s.version\1= '$version_full'/" RadarSDKMotion.podspec
sed_inplace "s/s.version( +)= '(.+)'/s.version\1= '$version_full'/" RadarSDKIndoors.podspec
sed_inplace "s/let version = \"(.+)\"/let version = \"$version_full\"/" Package.swift
sed_inplace "s/MARKETING_VERSION = .+;/MARKETING_VERSION = $version;/" RadarSDK.xcodeproj/project.pbxproj
sed_inplace "s/MARKETING_VERSION = .+;/MARKETING_VERSION = $version;/" RadarSDKMotion/RadarSDKMotion.xcodeproj/project.pbxproj
sed_inplace "s/MARKETING_VERSION = .+;/MARKETING_VERSION = $version;/" RadarSDKIndoors/RadarSDKIndoors.xcodeproj/project.pbxproj
sed_inplace "s/return @\"[0-9]+\.[0-9]+\.[0-9]+\";/return @\"$version_full\";/" RadarSDK/RadarUtils.m