forked from AgoraIO/Basic-Video-Call
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.env.py
34 lines (28 loc) · 852 Bytes
/
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
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import re
import os
def main():
f = open("./app/build.gradle", 'r+')
content = f.read()
sdkver = ""
if "AGORA_RTC_SDK_VER" in os.environ:
sdkver = os.environ["AGORA_RTC_SDK_VER"]
x = re.sub(
r'(dependencies {$)(.*)', r"\1\n implementation 'io.agora.rtc:full-sdk:"+sdkver+r"'\2", content, flags=re.M)
f.seek(0)
f.write(x)
f.truncate()
appId = ""
if "AGORA_APP_ID" in os.environ:
appId = os.environ["AGORA_APP_ID"]
token = ""
f = open("./app/src/main/res/values/strings_config.xml", 'r+')
content = f.read()
contentNew = re.sub(r'<#YOUR APP ID#>', appId, content)
contentNew = re.sub(r'<#YOUR ACCESS TOKEN#>', token, contentNew)
f.seek(0)
f.write(contentNew)
f.truncate()
if __name__ == "__main__":
main()