Skip to content

Commit

Permalink
Merge pull request #429 from AgoraIO/dev/4.5.0
Browse files Browse the repository at this point in the history
Dev/4.5.0
  • Loading branch information
HugoChaan authored Nov 28, 2024
2 parents 89427d6 + 51099e4 commit b9ed8cd
Show file tree
Hide file tree
Showing 491 changed files with 38,982 additions and 6,796 deletions.
43 changes: 27 additions & 16 deletions .github/ci/build/build_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,34 @@ echo release_version: $release_version
echo short_version: $short_version
echo pwd: `pwd`
echo sdk_url: $sdk_url
unzip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT
zip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT.zip
if [ -z "$sdk_url" ]; then
echo "sdk_url is empty"
echo unzip_name: $unzip_name
echo zip_name: $zip_name
else
zip_name=${sdk_url##*/}
echo zip_name: $zip_name

zip_name=${sdk_url##*/}
echo zip_name: $zip_name
# env LC_ALL=en_US.UTF-8 python3 $WORKSPACE/artifactory_utils.py --action=download_file --file=$sdk_url || exit 1
curl -o $zip_name $sdk_url || exit 1
7za x ./$zip_name -y > log.txt

# env LC_ALL=en_US.UTF-8 python3 $WORKSPACE/artifactory_utils.py --action=download_file --file=$sdk_url || exit 1
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/rtc/bin
rm -rf ./$unzip_name/rtc/demo
rm ./$unzip_name/rtc/commits
rm ./$unzip_name/rtc/package_size_report.txt
mkdir ./$unzip_name/rtc/samples
unzip_name=`ls -S -d */ | grep Agora | sed 's/\///g'`
echo unzip_name: $unzip_name

rm -rf ./$unzip_name/rtc/bin
rm -rf ./$unzip_name/rtc/demo
rm ./$unzip_name/rtc/commits
rm ./$unzip_name/rtc/package_size_report.txt
rm -rf ./$unzip_name/pom
fi
mkdir -p ./$unzip_name/rtc/samples
cp -rf ./Android/${android_direction} ./$unzip_name/rtc/samples/API-Example || exit 1
7za a -tzip result.zip -r $unzip_name > log.txt
mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name


if [ $compile_project = true ]; then
# install android sdk
which java
Expand All @@ -79,7 +85,12 @@ if [ $compile_project = true ]; then
export ANDROID_HOME=/usr/lib/android_sdk
echo ANDROID_HOME: $ANDROID_HOME
cd ./$unzip_name/rtc/samples/API-Example || exit 1
./cloud_build.sh || exit 1
if [ -z "$sdk_url" ]; then
./cloud_build.sh false || exit 1
else
./cloud_build.sh true || exit 1
fi

fi


59 changes: 39 additions & 20 deletions .github/ci/build/build_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
# pr: output test.zip to workspace dir
# others: Rename the zip package name yourself, But need copy it to workspace dir
##################################

xcode_version=$(xcodebuild -version | grep Xcode | awk '{print $2}')
echo "Xcode Version: $xcode_version"
echo ios_direction: $ios_direction
echo Package_Publish: $Package_Publish
echo is_tag_fetch: $is_tag_fetch
Expand All @@ -52,31 +53,49 @@ echo short_version: $short_version
echo pwd: `pwd`
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

unzip_name=`ls -S -d */ | grep Agora | sed 's/\///g'`
echo unzip_name: $unzip_name
unzip_name=Agora_Native_SDK_for_iOS_FULL
zip_name=output.zip
sdk_url_flag=false
if [ -z "$sdk_url" ]; then
sdk_url_flag=false
echo "sdk_url is empty"
echo unzip_name: $unzip_name
mkdir -p ./$unzip_name/samples
cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/${ios_direction} || exit 1
ls -al ./$unzip_name/samples/${ios_direction}/
else
sdk_url_flag=true
zip_name=${sdk_url##*/}
echo zip_name: $zip_name
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 -f ./$unzip_name/commits
rm -f ./$unzip_name/package_size_report.txt

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
python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/API-Example/Podfile || exit 1
rm -f ./$unzip_name/.commits
rm -f ./$unzip_name/AgoraInfra_iOS.swift
rm -f ./$unzip_name/AgoraRtcEngine_iOS.podspec
rm -f ./$unzip_name/AgoraAudio_iOS.podspec
rm -f ./$unzip_name/Package.swift
mkdir -p ./$unzip_name/samples
cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/${ios_direction} || exit 1
ls -al ./$unzip_name/samples/${ios_direction}/
mv ./$unzip_name/samples/${ios_direction}/sdk.podspec ./$unzip_name/ || exit 1
fi

python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/${ios_direction}/Podfile $sdk_url_flag || exit 1

echo "start compress"
7za a -tzip result.zip -r $unzip_name > log.txt
mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name
echo "start move to"
echo $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name
mv result.zip $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name

if [ $compile_project = true ]; then
cd ./$unzip_name/samples/API-Example
cd ./$unzip_name/samples/${ios_direction}
./cloud_build.sh || exit 1
cd -
fi
Expand Down
50 changes: 33 additions & 17 deletions .github/ci/build/build_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,42 @@ echo short_version: $short_version
echo pwd: `pwd`
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

unzip_name=`ls -S -d */ | grep Agora`
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
unzip_name=Agora_Native_SDK_for_iOS_FULL
zip_name=output.zip
sdk_url_flag=false

echo zip_name: $zip_name
if [ -z "$sdk_url" ]; then
sdk_url_flag=false
echo "sdk_url is empty"
echo unzip_name: $unzip_name
mkdir ./$unzip_name/samples
cp -rf ./macOS ./$unzip_name/samples/APIExample || exit 1
ls -al ./$unzip_name/samples/API-Example/
else
sdk_url_flag=true
zip_name=${sdk_url##*/}
echo unzip_name: $unzip_name
curl -o $zip_name $sdk_url || exit 1
7za x ./$zip_name -y > log.txt
unzip_name=`ls -S -d */ | grep Agora`
echo unzip_name: $unzip_name

cp -rf ./macOS ./$unzip_name/samples/APIExample || exit 1
ls -al ./$unzip_name/samples/API-Example/
mv ./$unzip_name/samples/APIExample/sdk.podspec ./$unzip_name/
python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/APIExample/Podfile
rm -rf ./$unzip_name/bin
rm -f ./$unzip_name/commits
rm -f ./$unzip_name/package_size_report.txt
rm -f ./$unzip_name/.commits
rm -f ./$unzip_name/AgoraInfra_macOS.swift
rm -f ./$unzip_name/AgoraRtcEngine_macOS.podspec
rm -f ./$unzip_name/Package.swift

mkdir ./$unzip_name/samples
cp -rf ./macOS ./$unzip_name/samples/APIExample || exit 1
ls -al ./$unzip_name/samples/API-Example/
mv ./$unzip_name/samples/APIExample/sdk.podspec ./$unzip_name/
fi

python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/APIExample/Podfile $sdk_url_flag
7za a -tzip result.zip -r $unzip_name
cp result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name

Expand Down
8 changes: 6 additions & 2 deletions .github/ci/build/build_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ echo short_version: %short_version%
echo pwd: %cd%
echo sdk_url: %sdk_url%

echo off

set zip_name=Agora_Native_SDK_for_Windows_FULL_DEFAULT.zip
if %compile_project% EQU false goto SKIP_DOWNLOAD
set zip_name=%sdk_url%
:LOOP
for /f "tokens=1* delims=</>" %%a in ("%zip_name%") do (
Expand All @@ -70,11 +72,13 @@ dir
curl %sdk_url% -o %zip_name%
REM python %WORKSPACE%\\artifactory_utils.py --action=download_file --file=%sdk_url%
7z x ./%zip_name% -y

dir
rmdir /S /Q Agora_Native_SDK_for_Windows_FULL\demo
del /F /Q Agora_Native_SDK_for_Windows_FULL\commits
del /F /Q Agora_Native_SDK_for_Windows_FULL\package_size_report.txt
:SKIP_DOWNLOAD


mkdir Agora_Native_SDK_for_Windows_FULL\samples
mkdir Agora_Native_SDK_for_Windows_FULL\samples\API-example
rmdir /S /Q windows\cicd
Expand Down
14 changes: 9 additions & 5 deletions .github/ci/build/modify_podfile.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import os, sys

def modfiy(path):
def modfiy(path, sdk_flag):
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_flag:
line = '\t'+"pod 'sdk', :path => '../../sdk.podspec'" + "\n"
elif "pod 'sdk" in line:
line = ""
if sdk_flag:
line = ""
elif 'sh .download_script' in line:
line = line.replace('true', 'false') + "\n"
contents.append(line)
Expand All @@ -19,6 +21,8 @@ def modfiy(path):
fw.close()



if __name__ == '__main__':
path = sys.argv[1:][0]
modfiy(path.strip())
path = sys.argv[1]
sdk_url_is_not_empty = sys.argv[2].lower() == 'true'
modfiy(path.strip(), sdk_url_is_not_empty)
10 changes: 8 additions & 2 deletions Android/APIExample-Audio/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
apply plugin: 'com.android.application'


def sdkVersionFile = file("../gradle.properties")
def properties = new Properties()
sdkVersionFile.withInputStream { stream ->
properties.load(stream)
}
def agoraSdkVersion = properties.getProperty("rtc_sdk_version")
println("${rootProject.project.name} agoraSdkVersion: ${agoraSdkVersion}")
def localSdkPath= "${rootProject.projectDir.absolutePath}/../../sdk"
def agoraSdkVersion = '4.4.1'

android {
compileSdkVersion 32
Expand Down Expand Up @@ -103,7 +110,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.2.0'
implementation 'com.yanzhenjie:permission:2.0.3'
implementation 'de.javagl:obj:0.2.1'

implementation "com.squareup.okhttp3:okhttp:4.10.0"
Expand Down
Loading

0 comments on commit b9ed8cd

Please sign in to comment.