forked from AgoraIO/Basic-Video-Call
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.env.py
40 lines (32 loc) · 1.27 KB
/
ci.env.py
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
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import re
import os
def main():
SDK_URL = "https://download.agora.io/sdk/release/Agora_Native_SDK_for_iOS_v2_9_1_FULL.zip?_ga=2.77403094.2116723707.1570875325-5559409.1503304822"
TARGET_LIBS_ZIP = "agora_sdk.zip"
TARGET_INTERNAL_FOLDER = "agora_sdk"
ZIP_STRUCTURE_FOLDER = "Agora_Native_SDK_for_iOS_FULL/libs"
FRAMEWORK_NAME = "AgoraRtcEngineKit.framework"
APP_NAME = "Agora iOS Tutorial Objective-C"
wget = "wget -q " + SDK_URL + " -O " + TARGET_LIBS_ZIP
os.system(wget)
unzip = "unzip -q " + TARGET_LIBS_ZIP + " -d " + TARGET_INTERNAL_FOLDER
os.system(unzip)
mv = "mv -f " + TARGET_INTERNAL_FOLDER + "/" + ZIP_STRUCTURE_FOLDER + "/" + FRAMEWORK_NAME + " \"" + APP_NAME +"\""
os.system(mv)
appId = ""
if "AGORA_APP_ID" in os.environ:
appId = os.environ["AGORA_APP_ID"]
token = ""
f = open("./Agora iOS Tutorial Objective-C/VideoChat/AppID.m", 'r+')
content = f.read()
appString = "@\"" + appId + "\""
tokenString = "@\"" + token + "\""
contentNew = re.sub(r'<#Your App ID#>', appString, content)
contentNew = re.sub(r'<#Temp Token#>', tokenString, contentNew)
f.seek(0)
f.write(contentNew)
f.truncate()
if __name__ == "__main__":
main()