-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathupload.gradle
30 lines (28 loc) · 1.1 KB
/
upload.gradle
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
ext {
upUrl = "http://api.fir.im/apps"
appName = "创美e药"
bundleId = rootProject.ext.android.applicationId
verName = rootProject.ext.android.versionName
apiToken = "5d30a26ef96ca348e58c1cef17fab7c8"
iconPath = ICON_PATH
apkPath = APK_PATH
buildNumber = rootProject.ext.android.versionCode
changeLog = CONTENT
startUpload = this.&startUpload
}
//上传至fir
def startUpload() {
println("开始上传至fir")
// def process = "python upToFir.py ${upUrl} ${appName} ${bundleId} ${verName} ${apiToken} ${iconPath} ${apkPath} ${buildNumber} ${changeLog}".execute()
def process = "python upToFir.py $upUrl $appName $bundleId $verName $apiToken $iconPath $apkPath $buildNumber $changeLog".execute()
//获取Python脚本日志,便于出错调试
ByteArrayOutputStream result = new ByteArrayOutputStream()
def inputStream = process.getInputStream()
byte[] buffer = new byte[1024]
int length
while ((length = inputStream.read(buffer)) != -1) {
result.write(buffer, 0, length)
}
println(result.toString("UTF-8"))
println "上传结束 "
}