-
Notifications
You must be signed in to change notification settings - Fork 1
/
setVersion.sh
46 lines (37 loc) · 1.47 KB
/
setVersion.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
#!/bin/bash
IDENTIFIER=com.totetero.gururin2
VERSIONCODE=11
VERSIONNAME=1.5.0
# --------------------------------
# make id設定
sed -i '' -e 's/IDENTIFIER = .*/IDENTIFIER = '${IDENTIFIER}'/g' Makefile
# android id設定
sed -i '' -e 's/project.ext.fuhahaApplicationId = ".*"/project.ext.fuhahaApplicationId = "'${IDENTIFIER}'"/g' src_client/platform_android/build.gradle
# ios id設定
sed -i '' -e 's/PRODUCT_BUNDLE_IDENTIFIER = .*;/PRODUCT_BUNDLE_IDENTIFIER = '${IDENTIFIER}';/g' src_client/platform_ios/fuhaha.xcodeproj/project.pbxproj
# android version設定
sed -i '' -e 's/project.ext.fuhahaVersionCode = .*/project.ext.fuhahaVersionCode = '${VERSIONCODE}'/g' src_client/platform_android/build.gradle
sed -i '' -e 's/project.ext.fuhahaVersionName = ".*"/project.ext.fuhahaVersionName = "'${VERSIONNAME}'"/g' src_client/platform_android/build.gradle
# ios version設定
cat src_client/platform_ios/fuhaha/Info.plist | perl -e '
$true = 1;
$false = 0;
$isCode = $false;
$isName = $false;
while($line = <STDIN>){
if($isCode){
$isCode = $false;
$line =~ s/<string>.*<\/string>/<string>'${VERSIONCODE}'<\/string>/;
}elsif($isName){
$isName = $false;
$line =~ s/<string>.*<\/string>/<string>'${VERSIONNAME}'<\/string>/;
}elsif($line =~ /CFBundleShortVersionString/){
$isName = $true;
}elsif($line =~ /CFBundleVersion/){
$isCode = $true;
}
print $line
}
' > temp.txt
mv temp.txt src_client/platform_ios/fuhaha/Info.plist
# --------------------------------