diff --git a/.github/ci/build/build_android.sh b/.github/ci/build/build_android.sh index 205da4ae4..76f6543f3 100644 --- a/.github/ci/build/build_android.sh +++ b/.github/ci/build/build_android.sh @@ -49,10 +49,12 @@ 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 +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 diff --git a/Android/APIExample-Audio/app/build.gradle b/Android/APIExample-Audio/app/build.gradle index df8d7f89a..dd1dec84c 100644 --- a/Android/APIExample-Audio/app/build.gradle +++ b/Android/APIExample-Audio/app/build.gradle @@ -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.5.0' android { compileSdkVersion 32 diff --git a/Android/APIExample-Audio/cloud_build.sh b/Android/APIExample-Audio/cloud_build.sh index 812a18d85..c472c0450 100755 --- a/Android/APIExample-Audio/cloud_build.sh +++ b/Android/APIExample-Audio/cloud_build.sh @@ -15,7 +15,24 @@ rm -f app/src/main/res/values/string_configs.xml-e ./gradlew clean || exit 1 ./gradlew :app:assembleRelease || exit 1 + +SDK_VERSION="" +if [ "$1" = "false" ]; then + sdk_version_file="./gradle.properties" + if [[ -f "$sdk_version_file" ]]; then + rtc_sdk_version=$(grep "rtc_sdk_version" "$sdk_version_file" | cut -d'=' -f2) + if [[ -n "$rtc_sdk_version" ]]; then + SDK_VERSION=$(echo "$rtc_sdk_version" | sed 's/^[ \t]*//;s/[ \t]*$//') + else + echo "rtc_sdk_version value not found" + fi +else + echo "file not found: $sdk_version_file" +fi +else + SDK_VERSION=$(echo $sdk_url | cut -d "/" -f 5) +fi + if [ "$WORKSPACE" != "" ]; then -SDK_VERSION=$(echo $sdk_url | cut -d "/" -f 5) cp app/build/outputs/apk/release/*.apk $WORKSPACE/APIExample-Audio_${BUILD_NUMBER}_${SDK_VERSION}_$(date "+%Y%m%d%H%M%S").apk fi \ No newline at end of file diff --git a/Android/APIExample-Audio/gradle.properties b/Android/APIExample-Audio/gradle.properties index c0ae9b619..ae0306701 100644 --- a/Android/APIExample-Audio/gradle.properties +++ b/Android/APIExample-Audio/gradle.properties @@ -19,4 +19,6 @@ android.useAndroidX=true android.enableJetifier=true # read enable simple filter section on README first before set this flag to TRUE -simpleFilter = false \ No newline at end of file +simpleFilter = false + +rtc_sdk_version = 4.5.0 \ No newline at end of file diff --git a/Android/APIExample-Compose/app/build.gradle.kts b/Android/APIExample-Compose/app/build.gradle.kts index fb0485a35..6db4bff1a 100644 --- a/Android/APIExample-Compose/app/build.gradle.kts +++ b/Android/APIExample-Compose/app/build.gradle.kts @@ -8,6 +8,11 @@ plugins { alias(libs.plugins.jetbrainsKotlinAndroid) } +val sdkVersionFile = file("../gradle.properties") +val properties = Properties() +properties.load(sdkVersionFile.inputStream()) +val agoraSdkVersion = properties.getProperty("rtc_sdk_version") +println("${rootProject.project.name} agoraSdkVersion: ${agoraSdkVersion}") val localSdkPath = "${rootProject.projectDir.absolutePath}/../../sdk" android { @@ -85,7 +90,7 @@ android { outputs.all { if (this is ApkVariantOutputImpl) { this.outputFileName = - "${rootProject.name}_${libs.versions.agoraSdk.get()}_${ + "${rootProject.name}_${agoraSdkVersion}_${ SimpleDateFormat("yyyyMMddHHmm").format( Date() ) @@ -129,8 +134,10 @@ dependencies { if (File(localSdkPath).exists()) { implementation(fileTree(localSdkPath).include("*.jar", "*.aar")) } else { - implementation(libs.agora.full.sdk) - implementation(libs.agora.full.screen.sharing) + implementation("io.agora.rtc:full-sdk:${agoraSdkVersion}") + implementation("io.agora.rtc:full-screen-sharing:${agoraSdkVersion}") +// implementation(libs.agora.full.sdk) +// implementation(libs.agora.full.screen.sharing) } } \ No newline at end of file diff --git a/Android/APIExample-Compose/cloud_build.sh b/Android/APIExample-Compose/cloud_build.sh index 66e456cb4..206416058 100755 --- a/Android/APIExample-Compose/cloud_build.sh +++ b/Android/APIExample-Compose/cloud_build.sh @@ -24,7 +24,24 @@ fi ./gradlew clean || exit 1 ./gradlew :app:assembleRelease || exit 1 + +SDK_VERSION="" +if [ "$1" = "false" ]; then + sdk_version_file="./gradle.properties" + if [[ -f "$sdk_version_file" ]]; then + rtc_sdk_version=$(grep "rtc_sdk_version" "$sdk_version_file" | cut -d'=' -f2) + if [[ -n "$rtc_sdk_version" ]]; then + SDK_VERSION=$(echo "$rtc_sdk_version" | sed 's/^[ \t]*//;s/[ \t]*$//') + else + echo "rtc_sdk_version value not found" + fi +else + echo "file not found: $sdk_version_file" +fi +else + SDK_VERSION=$(echo $sdk_url | cut -d "/" -f 5) +fi + if [ "$WORKSPACE" != "" ]; then -SDK_VERSION=$(echo $sdk_url | cut -d "/" -f 5) cp app/build/outputs/apk/release/*.apk $WORKSPACE/APIExample-Compose_${BUILD_NUMBER}_${SDK_VERSION}_$(date "+%Y%m%d%H%M%S").apk fi \ No newline at end of file diff --git a/Android/APIExample-Compose/gradle.properties b/Android/APIExample-Compose/gradle.properties index 20e2a0152..58fe9e1a3 100644 --- a/Android/APIExample-Compose/gradle.properties +++ b/Android/APIExample-Compose/gradle.properties @@ -20,4 +20,6 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true + +rtc_sdk_version = 4.5.0 \ No newline at end of file diff --git a/Android/APIExample-Compose/gradle/libs.versions.toml b/Android/APIExample-Compose/gradle/libs.versions.toml index 1653c7e33..0a90ebb75 100644 --- a/Android/APIExample-Compose/gradle/libs.versions.toml +++ b/Android/APIExample-Compose/gradle/libs.versions.toml @@ -12,7 +12,7 @@ composeBom = "2023.08.00" loggingInterceptor = "4.10.0" materialIconsExtended = "1.6.0" navigationCompose = "2.7.7" -agoraSdk = "4.5.0" +#agoraSdk = "4.5.0" okhttp = "4.10.0" [libraries] @@ -20,8 +20,8 @@ androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "datastore" } androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore" } androidx-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "materialIconsExtended" } -agora-full-sdk = { module = "io.agora.rtc:full-sdk", version.ref = "agoraSdk" } -agora-full-screen-sharing = { module = "io.agora.rtc:full-screen-sharing", version.ref = "agoraSdk" } +#agora-full-sdk = { module = "io.agora.rtc:full-sdk", version.ref = "agoraSdk" } +#agora-full-screen-sharing = { module = "io.agora.rtc:full-screen-sharing", version.ref = "agoraSdk" } junit = { group = "junit", name = "junit", version.ref = "junit" } androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } diff --git a/Android/APIExample/app/build.gradle b/Android/APIExample/app/build.gradle index 9d029845e..dc855a8a8 100644 --- a/Android/APIExample/app/build.gradle +++ b/Android/APIExample/app/build.gradle @@ -3,7 +3,14 @@ apply plugin: 'kotlin-android' apply from: "${rootDir.absolutePath}/git-hooks.gradle" apply from: 'vendors.gradle' -def agoraSdkVersion = "4.5.0" + +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" diff --git a/Android/APIExample/cloud_build.sh b/Android/APIExample/cloud_build.sh index a47dd8f3e..e33576e7d 100755 --- a/Android/APIExample/cloud_build.sh +++ b/Android/APIExample/cloud_build.sh @@ -59,7 +59,23 @@ cd - || exit 1 ./gradlew clean || exit 1 ./gradlew :app:assembleRelease || exit 1 +SDK_VERSION="" +if [ "$1" = "false" ]; then + sdk_version_file="./gradle.properties" + if [[ -f "$sdk_version_file" ]]; then + rtc_sdk_version=$(grep "rtc_sdk_version" "$sdk_version_file" | cut -d'=' -f2) + if [[ -n "$rtc_sdk_version" ]]; then + SDK_VERSION=$(echo "$rtc_sdk_version" | sed 's/^[ \t]*//;s/[ \t]*$//') + else + echo "rtc_sdk_version value not found" + fi +else + echo "file not found: $sdk_version_file" +fi +else + SDK_VERSION=$(echo $sdk_url | cut -d "/" -f 5) +fi + if [ "$WORKSPACE" != "" ]; then -SDK_VERSION=$(echo $sdk_url | cut -d "/" -f 5) cp app/build/outputs/apk/release/*.apk $WORKSPACE/APIExample_${BUILD_NUMBER}_${SDK_VERSION}_$(date "+%Y%m%d%H%M%S").apk fi \ No newline at end of file diff --git a/Android/APIExample/gradle.properties b/Android/APIExample/gradle.properties index 0aa5dd64c..903fe7611 100644 --- a/Android/APIExample/gradle.properties +++ b/Android/APIExample/gradle.properties @@ -22,3 +22,5 @@ android.enableJetifier=true simpleFilter = false # read enable stream encrypt section on README first before set this flag to TRUE streamEncrypt = false + +rtc_sdk_version = 4.5.0