Skip to content

Commit

Permalink
When the SDK link is empty, do not download the SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinhui committed Oct 29, 2024
1 parent d2a01fd commit 757ed01
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
34 changes: 19 additions & 15 deletions .github/ci/build/build_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,28 @@ echo sdk_url: $sdk_url
zip_name=${sdk_url##*/}
echo zip_name: $zip_name

curl -o $zip_name $sdk_url || exit 1
7za x ./$zip_name -y > log.txt
if [ "$sdk_url" != "" ]; then
echo "sdk_url: $sdk_url"
curl -o $zip_name $sdk_url || exit 1
7za x ./$zip_name -y > log.txt

unzip_name=`ls -S -d */ | grep Agora | sed 's/\///g'`
echo unzip_name: $unzip_name

rm -rf ./$unzip_name/bin
rm ./$unzip_name/commits
rm ./$unzip_name/package_size_report.txt
mkdir ./$unzip_name/samples

cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/API-Example || exit 1
ls -al ./$unzip_name/samples/API-Example/
mv ./$unzip_name/samples/API-Example/sdk.podspec ./$unzip_name/ || exit 1
unzip_name=`ls -S -d */ | grep Agora | sed 's/\///g'`
echo unzip_name: $unzip_name
rm -rf ./$unzip_name/bin
rm ./$unzip_name/commits
rm ./$unzip_name/package_size_report.txt

mkdir ./$unzip_name/samples
cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/API-Example || exit 1
ls -al ./$unzip_name/samples/API-Example/
mv ./$unzip_name/samples/API-Example/sdk.podspec ./$unzip_name/ || exit 1
else
echo "sdk_url is empty!"
cp -rf ./iOS/${ios_direction} ./ || exit 1
fi

echo "work space1: $WORKSPACE"
python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/API-Example/Podfile || exit 1

python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/API-Example/Podfile $sdk_url || exit 1

7za a -tzip result.zip -r $unzip_name > log.txt
mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name
Expand Down
10 changes: 6 additions & 4 deletions .github/ci/build/modify_podfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os, sys

def modfiy(path):
def modfiy(path, sdk_url):
with open(path, 'r', encoding='utf-8') as file:
contents = []
for num, line in enumerate(file):
if "pod 'Agora" in line:
line = '\t'+"pod 'sdk', :path => '../../sdk.podspec'" + "\n"
if sdk_url != "":
line = '\t'+"pod 'sdk', :path => '../../sdk.podspec'" + "\n"
elif "pod 'sdk" in line:
line = ""
elif 'sh .download_script' in line:
Expand All @@ -20,5 +21,6 @@ def modfiy(path):


if __name__ == '__main__':
path = sys.argv[1:][0]
modfiy(path.strip())
path = sys.argv[1]
sdk_url = sys.argv[2]
modfiy(path.strip(), sdk_url.strip())
4 changes: 2 additions & 2 deletions iOS/APIExample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

def common_pods
pod 'AgoraRtcEngine_iOS', '4.5.0'
pod 'AgoraRtcEngine_iOS', '4.3.2'
#pod 'sdk', :path => 'sdk.podspec'
end

Expand All @@ -23,7 +23,7 @@ target 'APIExample' do
pod 'SnapKit', '~> 5.7.0'

# pod 'SenseLib', :path => 'sense.podspec'
# pod 'bytedEffect', :path => 'bytedEffect.podspec'
pod 'bytedEffect', :path => 'bytedEffect.podspec'
# pod 'fuLib', :path => 'fu.podspec'
end

Expand Down

0 comments on commit 757ed01

Please sign in to comment.