File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed
Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,14 @@ def uploadtofir():
2020 appversion = sys .argv [3 ] # app版本号
2121 appbuild = sys .argv [4 ] # app build号
2222 apitoken = sys .argv [5 ] # fir token
23- apklogo = sys .argv [6 ] # 等待上传的APK logo路径
24- apkpath = sys .argv [7 ] # 等待上传的APK路径
23+ apklogov1 = sys .argv [6 ] # 等待上传的APK logo路径
24+ apklogov2 = sys .argv [7 ] # 等待上传的APK logo路径
25+ apkpathv1 = sys .argv [8 ] # 等待上传的APK路径
26+ apkpathv2 = sys .argv [9 ] # 等待上传的APK路径
2527
28+ # mac环境不知为何gradle传参给python字符长度太长导致字符串被切割成两份,破解
29+ apklogo = apklogov1 + " " + apklogov2
30+ apkpath = apkpathv1 + " " + apkpathv2
2631 # 第一步:获取fir上传凭证
2732 print ("get fir upload certificate" )
2833 icondict = {} # 后面上传图标和apk需要使用的参数,这里保存下来
@@ -55,7 +60,7 @@ def uploadtofir():
5560
5661 # 第三步:上传APK logo
5762 try :
58- print ("uploading apk ......" + apklogo )
63+ print ("uploading apklogo ......" )
5964 apklogofile = {'file' : open (apklogo , 'rb' )}
6065 param = {"key" : icondict ["key" ],
6166 "token" : icondict ["token" ]}
Original file line number Diff line number Diff line change @@ -49,19 +49,20 @@ android {
4949
5050
5151 // 自定义一个任务,实现打包meisha渠道自动上传到fir
52- task assembleWithFir{
52+ task assembleWithFir {
5353 dependsOn ' assembleDebug'
54- doLast{
55- def appname= " 薄荷健康"
56- def apppackage= project. android. defaultConfig. applicationId
57- def appversion= project. android. defaultConfig. versionName
58- def appbuild= project. android. defaultConfig. versionCode
59- def apitoken= " 368967b71745181a78ea8cb01ab237c5"
54+ doLast {
55+ def appname = " 薄荷健康"
56+ def apppackage = project. android. defaultConfig. applicationId
57+ def appversion = project. android. defaultConfig. versionName
58+ def appbuild = project. android. defaultConfig. versionCode
59+ def apitoken = " 368967b71745181a78ea8cb01ab237c5"
6060 def apkpath = applicationVariants. first(). outputs. first(). outputFile
61- def apklogo= apkpath. parent. split(" build" )[0 ] + " src/main/res/drawable/icon.png"
62- println (" 路径:" + apklogo)
61+ def apklogo = applicationVariants. first(). outputs. first(). outputFile. parent. split(" build" )[0 ] + " src/main/res/drawable/icon.png"
62+ println (" apklogo路径:" + apklogo)
63+ println (" apkpath路径:" + apkpath)
6364 // 调用python脚本 这个脚本需要放在app工程目录下,不要放在project目录下
64- def process= " python UploadToFir.py ${ appname} ${ apppackage} ${ appversion} ${ appbuild} ${ apitoken} ${ apklogo} ${ apkpath} " . execute()
65+ def process = " python3 UploadToFir.py ${ appname} ${ apppackage} ${ appversion} ${ appbuild} ${ apitoken} ${ apklogo} ${ apkpath} " . execute()
6566 // 打印Python脚本日志,便于出错调试
6667 ByteArrayOutputStream result = new ByteArrayOutputStream ()
6768 def inputStream = process. getInputStream()
You can’t perform that action at this time.
0 commit comments