|
17 | 17 | # 'platform: string', |
18 | 18 | # 'BUILD_NUMBER: string', |
19 | 19 | # 'WORKSPACE: string' |
20 | | -# 'compress_apiexample:boolean:false' |
21 | 20 | # |
22 | 21 | # --- Test Related: --- |
23 | 22 | # PR build, zip test related to test.zip |
@@ -50,12 +49,9 @@ echo release_version: $release_version |
50 | 49 | echo short_version: $short_version |
51 | 50 | echo pwd: `pwd` |
52 | 51 | echo sdk_url: $sdk_url |
53 | | -echo compress_apiexample: $compress_apiexample |
54 | | - |
55 | 52 | unzip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT |
56 | 53 | zip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT.zip |
57 | | - |
58 | | -if [ -z "$sdk_url" ] || [ "$sdk_url" == "none" ]; then |
| 54 | +if [ -z "$sdk_url" ] || [ "$sdk_url" = "none" ]; then |
59 | 55 | echo "sdk_url is empty" |
60 | 56 | echo unzip_name: $unzip_name |
61 | 57 | echo zip_name: $zip_name |
|
72 | 68 |
|
73 | 69 | rm -rf ./$unzip_name/rtc/bin |
74 | 70 | rm -rf ./$unzip_name/rtc/demo |
75 | | - rm ./$unzip_name/rtc/commits |
76 | | - rm ./$unzip_name/rtc/package_size_report.txt |
| 71 | + rm ./$unzip_name/commits |
| 72 | + rm ./$unzip_name/spec |
77 | 73 | rm -rf ./$unzip_name/pom |
78 | 74 | fi |
79 | | - |
80 | | -# Create API-Example directory and copy files |
81 | 75 | mkdir -p ./$unzip_name/rtc/samples |
82 | 76 | cp -rf ./Android/${android_direction} ./$unzip_name/rtc/samples/API-Example || exit 1 |
| 77 | +7za a -tzip result.zip -r $unzip_name > log.txt |
| 78 | +mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name |
83 | 79 |
|
84 | | -# Define build path variable based on compress_apiexample parameter |
85 | | -if [ $compress_apiexample = true ]; then |
86 | | - build_path="./temp_apiexample" |
87 | | - result_file="apiExample_${BUILD_NUMBER}_$zip_name" |
88 | | -else |
89 | | - build_path="./$unzip_name" |
90 | | - result_file="withAPIExample_${BUILD_NUMBER}_$zip_name" |
91 | | -fi |
92 | | - |
93 | | -# Decide how to package based on compress_apiexample parameter |
94 | 80 | if [ $compress_apiexample = true ]; then |
95 | | - # Only compress API-Example code |
96 | | - echo "Only compressing API-Example code" |
97 | | - mkdir -p ./temp_apiexample/rtc/samples |
98 | | - cp -rf ./$unzip_name/rtc/samples/API-Example ./temp_apiexample/rtc/samples/ || exit 1 |
99 | | - 7za a -tzip apiExample_android.zip -r temp_apiexample > log.txt |
100 | | - rm -rf ./temp_apiexample |
101 | | - mv apiExample_android.zip $WORKSPACE/$result_file |
102 | | -else |
103 | | - # Compress the entire SDK including API-Example |
104 | | - echo "Compressing the entire SDK including API-Example" |
105 | | - 7za a -tzip apiExample_android_with_sdk.zip -r $unzip_name > log.txt |
106 | | - mv apiExample_android_with_sdk.zip $WORKSPACE/$result_file |
| 81 | + cd ./$unzip_name/rtc/samples/API-Example || exit 1 |
| 82 | + 7za a -tzip result_onlyAPIExample.zip -r ./$unzip_name/rtc/samples/API-Example > log1.txt |
| 83 | + mv result_onlyAPIExample.zip $WORKSPACE/onlyAPIExample_${BUILD_NUMBER}_$zip_name |
107 | 84 | fi |
108 | 85 |
|
109 | 86 | if [ $compile_project = true ]; then |
110 | | - # Based on compress_apiexample, use the appropriate build path |
111 | | - if [ $compress_apiexample = true ]; then |
112 | | - echo "Building with API-Example only package" |
113 | | - mkdir -p ./temp_apiexample/rtc/samples |
114 | | - cp -rf ./$unzip_name/rtc/samples/API-Example ./temp_apiexample/rtc/samples/ || exit 1 |
115 | | - cd ./temp_apiexample/rtc/samples/API-Example || exit 1 |
116 | | - else |
117 | | - echo "Building with full SDK package" |
118 | | - cd ./$unzip_name/rtc/samples/API-Example || exit 1 |
119 | | - fi |
120 | | - |
121 | | - if [ -z "$sdk_url" ] || [ "$sdk_url" == "none" ]; then |
| 87 | + cd ./$unzip_name/rtc/samples/API-Example || exit 1 |
| 88 | + if [ -z "$sdk_url" ] || [ "$sdk_url" = "none" ]; then |
122 | 89 | ./cloud_build.sh false || exit 1 |
123 | 90 | else |
124 | 91 | ./cloud_build.sh true || exit 1 |
125 | 92 | fi |
126 | | - |
127 | | - # Cleanup temp directory if needed |
128 | | - if [ $compress_apiexample = true ]; then |
129 | | - cd ../../../../ |
130 | | - rm -rf ./temp_apiexample |
131 | | - fi |
132 | 93 | fi |
| 94 | + |
0 commit comments